Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: SAM-ICE/Eclipse/Yagarto Tools AT91SAM9263-EK Debugging Issue
PostPosted: Wed Jun 25, 2008 3:42 am 
Offline

Joined: Wed Jun 25, 2008 3:27 am
Posts: 10
Location: Seattle, WA, USA
Hello,

I have set up a development environment using the tools described in James Lynch's tutorial. I am able to successfully compile and load an application to the AT91SAM9263-EK board. My application has come to the point now where I need to use the SAM-ICE JTAG which I recently purchased. I have set up the following GDB init script in the Eclipse debugger:

# Set up gdb, init clocks, watchdog, and SDRAM

# Change to default reset behavior
monitor long 0xFFFFFD08 0xA0000401
# Reset peripherals
monitor long 0xFFFFFd00 0xA0000004
# Unremap
monitor long 0xFFFFEF00 0x0
# Zero out registers
monitor reset 6
# Disable and clear AIC interrupt sources (important!)
monitor long 0xFFFFF124 0xFFFFFFFF
monitor long 0xFFFFF128 0xFFFFFFFF

monitor reset
monitor speed 30
monitor speed adaptive
# Disable watchdog
monitor long 0xfffffd44 0x00008000

# Configure master clock
echo Configuring the master clock...\n
# Enable main oscillator
set *0xFFFFFC20 = 0x00004001
#while ((*0xFFFFFC68 & 0x1) == 0)
#end
monitor sleep 100
# Switch to main oscillator
set *0xFFFFFC30 = 0x00000001

# Set PLLA to 100MHz
set *0xFFFFFC28 = 0x2048BF07
#while ((*0xFFFFFC68 & 0x2) == 0)
#end
#while ((*0xFFFFFC68 & 0x1) == 0)
#end
monitor sleep 100
# Select prescaler
set *0xFFFFFC30 = 0x00000101
#while ((*0xFFFFFC68 & 0x8) == 0)
#end
monitor sleep 100
# Select master clock based on PLLA
set *0xFFFFFC30 = 0x00000102
#while ((*0xFFFFFC68 & 0x8) == 0)
#end
monitor sleep 100
echo Master clock ok.\n
echo Configuring the SDRAM controller...\n

# Enable EBI chip select for the SDRAM
set *0xFFFFED20 = 0x1000A

# SDRAM configuration
set *0xFFFFE208 = 0x85227259

set *0xFFFFE200 = 0x2
set *0x20000000 = 0

set *0xFFFFE200 = 0x4
set *0x20000000 = 0x1
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0

set *0xFFFFE200 = 0x3
set *0x20000020 = 0xCAFEDEDE

set *0xFFFFE204 = 0x65B

set *0xFFFFE200 = 0
set *0x20000000 = 0

echo SDRAM configuration ok.\n

# Write an assembly instruction to SRAM0 (which will
# be put at 0x0, the reset vector) to do a load
# address jump
set *(unsigned int)0x200000 = 0xe59ff018
# The address to jump to - the beginning of SDRAM
set *(unsigned int)0x200020 = 0x20000000
# Now remap SRAM0 to 0.
set *(unsigned int)0xFFFFEF00 = 0x3
set remote memory-write-packet-size 1025
set remote memory-write-packet-size fixed
set remote memory-read-packet-size 1025
set remote memory-read-packet-size fixed
load
thbreak main
echo \nThe following value should be 0x30008000\n
p/x *0xFFFFFD44
continue


I am trying to debug the SDRAM version of my application using the above script. The JTAG is successfully able to communicate with the GDB Server however I am getting an error. A transcript of the JTAG initialization is shown below:

[size=7]317-gdb-set confirm off
317^done
318-gdb-set width 0
(gdb)
318^done
(gdb)
319-gdb-set height 0
319^done
(gdb)
320-interpreter-exec console echo
320^done
(gdb)
321-gdb-show prompt
321^done,value="(gdb) "
(gdb)
322-environment-directory C:/SAM/modem C:/SAM/modem/.settings C:/SAM/modem/at91lib C:/SAM/modem/at91lib/asp C:/SAM/modem/at91lib/boards C:/SAM/modem/at91lib/boards/at91sam9263-ek C:/SAM/modem/at91lib/boards/at91sam9263-ek/at91sam9263 C:/SAM/modem/at91lib/bsp C:/SAM/modem/at91lib/bsp/components C:/SAM/modem/at91lib/bsp/components/codec-ad1981b C:/SAM/modem/at91lib/bsp/peripherals C:/SAM/modem/at91lib/bsp/peripherals/ac97c C:/SAM/modem/at91lib/bsp/peripherals/aic C:/SAM/modem/at91lib/bsp/peripherals/dbgu C:/SAM/modem/at91lib/bsp/peripherals/pio C:/SAM/modem/at91lib/bsp/peripherals/pit C:/SAM/modem/at91lib/bsp/peripherals/pmc C:/SAM/modem/at91lib/bsp/peripherals/ssc C:/SAM/modem/at91lib/bsp/peripherals/ssc.bak C:/SAM/modem/at91lib/bsp/peripherals/tc C:/SAM/modem/at91lib/bsp/peripherals/usart C:/SAM/modem/at91lib/dms C:/SAM/modem/at91lib/dms/inc C:/SAM/modem/at91lib/dms/src C:/SAM/modem/at91lib/docs C:/SAM/modem/at91lib/ta C:/SAM/modem/at91lib/ta/inc C:/SAM/modem/at91lib/ta/src C:/SAM/modem/at91lib/ucos C:/SAM/modem/at91lib/utility C:/SAM/modem/getting-started-project C:/SAM/modem/getting-started-project/bin C:/SAM/modem/getting-started-project/obj
322^done,source-path="C:/SAM/modem;C:/SAM/modem/.settings;C:/SAM/modem/at91lib;C:/SAM/modem/at91lib/asp;C:/SAM/modem/at91lib/boards;C:/SAM/modem/at91lib/boards/at91sam9263-ek;C:/SAM/modem/at91lib/boards/at91sam9263-ek/at91sam9263;C:/SAM/modem/at91lib/bsp;C:/SAM/modem/at91lib/bsp/components;C:/SAM/modem/at91lib/bsp/components/codec-ad1981b;C:/SAM/modem/at91lib/bsp/peripherals;C:/SAM/modem/at91lib/bsp/peripherals/ac97c;C:/SAM/modem/at91lib/bsp/peripherals/aic;C:/SAM/modem/at91lib/bsp/peripherals/dbgu;C:/SAM/modem/at91lib/bsp/peripherals/pio;C:/SAM/modem/at91lib/bsp/peripherals/pit;C:/SAM/modem/at91lib/bsp/peripherals/pmc;C:/SAM/modem/at91lib/bsp/peripherals/ssc;C:/SAM/modem/at91lib/bsp/peripherals/ssc.bak;C:/SAM/modem/at91lib/bsp/peripherals/tc;C:/SAM/modem/at91lib/bsp/peripherals/usart;C:/SAM/modem/at91lib/dms;C:/SAM/modem/at91lib/dms/inc;C:/SAM/modem/at91lib/dms/src;C:/SAM/modem/at91lib/docs;C:/SAM/modem/at91lib/ta;C:/SAM/modem/at91lib/ta/inc;C:/SAM/modem/at91lib/ta/src;C:/SAM/modem/at91lib/ucos;C:/SAM/modem/at91lib/utility;C:/SAM/modem/getting-started-project;C:/SAM/modem/getting-started-project/bin;C:/SAM/modem/getting-started-project/obj;$cdir;$cwd"
(gdb)
323 info threads
&"info threads\n"
&"No registers.\n"
323^error,msg="No registers."
324-data-list-register-names
(gdb)
324^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","sp","lr","pc","f0","f1","f2","f3","f4","f5","f6","f7","fps","cpsr","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]
(gdb)
325-break-watch
&"mi_cmd_break_watch: Missing <expression>\n"
325^error,msg="mi_cmd_break_watch: Missing <expression>"
(gdb)
326 target remote localhost:2331
mi_cmd_break_watch: Missing <expression>
&"target remote localhost:2331\n"
target remote localhost:2331
~"0x00401110 in ?? ()\n"
0x00401110 in ?? ()
~"Current language: auto; currently asm\n"
Current language: auto; currently asm
326^done
(gdb)
327-stack-list-frames
327^done,stack=[frame={level="0",addr="0x00401110",func="??"}]
(gdb)
328 info proc
&"info proc\n"
&"Undefined info command: \"proc\". Try \"help info\".\n"
328^error,msg="Undefined info command: \"proc\". Try \"help info\"."
(gdb)
329 info program
&"info program\n"
~"Debugging a target over a serial line.\n"
~"Program stopped at 0x401110.\n"
~"It stopped with signal SIGTERM, Terminated.\n"
~"Type \"info stack\" or \"info registers\" for more information.\n"
329^done
(gdb)
330 monitor long 0xFFFFFD08 0xA0000401
&"monitor long 0xFFFFFD08 0xA0000401 \n"
monitor long 0xFFFFFD08 0xA0000401
@"Writing 0xA0000401 @ address 0xFFFFFD08\r\n"
330^done
(gdb)
331 monitor long 0xFFFFFd00 0xA0000004
&"monitor long 0xFFFFFd00 0xA0000004 \n"
monitor long 0xFFFFFd00 0xA0000004
@"Writing 0xA0000004 @ address 0xFFFFFD00\r\n"
331^done
(gdb)
332 monitor long 0xFFFFEF00 0x0
&"monitor long 0xFFFFEF00 0x0 \n"
monitor long 0xFFFFEF00 0x0
@"Writing 0x00000000 @ address 0xFFFFEF00\r\n"
332^done
(gdb)
333 monitor reset 6
&"monitor reset 6 \n"
monitor reset 6
@"Resetting target (soft reset)\r\n"
333^done
(gdb)
334 monitor long 0xFFFFF124 0xFFFFFFFF
monitor long 0xFFFFF124 0xFFFFFFFF
&"monitor long 0xFFFFF124 0xFFFFFFFF \n"
@"Writing 0xFFFFFFFF @ address 0xFFFFF124\r\n"
334^done
(gdb)
335 monitor long 0xFFFFF128 0xFFFFFFFF
&"monitor long 0xFFFFF128 0xFFFFFFFF \n"
monitor long 0xFFFFF128 0xFFFFFFFF
@"Writing 0xFFFFFFFF @ address 0xFFFFF128\r\n"
335^done
(gdb)
336 monitor reset
monitor reset
&"monitor reset \n"
@"Resetting target\r\n"
336^done
(gdb)
337 monitor speed 30
&"monitor speed 30 \n"
monitor speed 30
@"JTAG speed set to 30 kHz\r\n"
337^done
(gdb)
338 monitor speed adaptive
monitor speed adaptive
&"monitor speed adaptive \n"
@"Select adaptive clocking instead of fixed JTAG speed\r\n"
338^done
(gdb)
339 monitor long 0xfffffd44 0x00008000
monitor long 0xfffffd44 0x00008000
&"monitor long 0xfffffd44 0x00008000 \n"
@"Writing 0x00008000 @ address 0xFFFFFD44\r\n"
339^done
(gdb)
340 echo Configuring the master clock...\n
echo Configuring the master clock...

&"echo Configuring the master clock...\\n \n"
~"Configuring the master clock...\n"
Configuring the master clock...
340^done
(gdb)
341 set *0xFFFFFC20 = 0x00004001
&"set *0xFFFFFC20 = 0x00004001 \n"
set *0xFFFFFC20 = 0x00004001
341^done
(gdb)
342 monitor sleep 100
monitor sleep 100
&"monitor sleep 100\n"
@"Sleep 100ms\r\n"
342^done
(gdb)
343 set *0xFFFFFC30 = 0x00000001
&"set *0xFFFFFC30 = 0x00000001 \n"
set *0xFFFFFC30 = 0x00000001
343^done
(gdb)
344 set *0xFFFFFC28 = 0x2048BF07
&"set *0xFFFFFC28 = 0x2048BF07 \n"
set *0xFFFFFC28 = 0x2048BF07
344^done
(gdb)
345 monitor sleep 100
&"monitor sleep 100\n"
monitor sleep 100
@"Sleep 100ms\r\n"
345^done
(gdb)
346 set *0xFFFFFC30 = 0x00000101
set *0xFFFFFC30 = 0x00000101
&"set *0xFFFFFC30 = 0x00000101 \n"
346^done
(gdb)
347 monitor sleep 100
monitor sleep 100
&"monitor sleep 100\n"
@"Sleep 100ms\r\n"
347^done
(gdb)
348 set *0xFFFFFC30 = 0x00000102
&"set *0xFFFFFC30 = 0x00000102 \n"
set *0xFFFFFC30 = 0x00000102
348^done
(gdb)
349 monitor sleep 100
&"monitor sleep 100\n"
monitor sleep 100
@"Sleep 100ms\r\n"
349^done
(gdb)
350 echo Master clock ok.\n
echo Master clock ok.

&"echo Master clock ok.\\n \n"
~"Master clock ok.\n"
Master clock ok.
350^done
(gdb)
351 echo Configuring the SDRAM controller...\n
echo Configuring the SDRAM controller...

&"echo Configuring the SDRAM controller...\\n \n"
~"Configuring the SDRAM controller...\n"
Configuring the SDRAM controller...
351^done
(gdb)
352 set *0xFFFFED20 = 0x1000A
set *0xFFFFED20 = 0x1000A
&"set *0xFFFFED20 = 0x1000A \n"
352^done
(gdb)
353 set *0xFFFFE208 = 0x85227259
&"set *0xFFFFE208 = 0x85227259 \n"
set *0xFFFFE208 = 0x85227259
353^done
(gdb)
354 set *0xFFFFE200 = 0x2
&"set *0xFFFFE200 = 0x2 \n"
set *0xFFFFE200 = 0x2
354^done
(gdb)
355 set *0x20000000 = 0
&"set *0x20000000 = 0 \n"
set *0x20000000 = 0
355^done
(gdb)
356 set *0xFFFFE200 = 0x4
&"set *0xFFFFE200 = 0x4 \n"
set *0xFFFFE200 = 0x4
356^done
(gdb)
357 set *0x20000000 = 0x1
set *0x20000000 = 0x1
&"set *0x20000000 = 0x1 \n"
357^done
(gdb)
358 set *0xFFFFE200 = 0x4
&"set *0xFFFFE200 = 0x4 \n"
set *0xFFFFE200 = 0x4
358^done
(gdb)
359 set *0x20000000 = 0
&"set *0x20000000 = 0 \n"
set *0x20000000 = 0
359^done
(gdb)
360 set *0xFFFFE200 = 0x4
set *0xFFFFE200 = 0x4
&"set *0xFFFFE200 = 0x4 \n"
360^done
(gdb)
361 set *0x20000000 = 0
set *0x20000000 = 0
&"set *0x20000000 = 0 \n"
361^done
(gdb)
362 set *0xFFFFE200 = 0x4
set *0xFFFFE200 = 0x4
&"set *0xFFFFE200 = 0x4 \n"
362^done
(gdb)
363 set *0x20000000 = 0
&"set *0x20000000 = 0 \n"
set *0x20000000 = 0
363^done
(gdb)
364 set *0xFFFFE200 = 0x4
set *0xFFFFE200 = 0x4
&"set *0xFFFFE200 = 0x4 \n"
364^done
(gdb)
365 set *0x20000000 = 0
&"set *0x20000000 = 0 \n"
set *0x20000000 = 0
365^done
(gdb)
366 set *0xFFFFE200 = 0x4
&"set *0xFFFFE200 = 0x4 \n"
set *0xFFFFE200 = 0x4
366^done
(gdb)
367 set *0x20000000 = 0
&"set *0x20000000 = 0 \n"
set *0x20000000 = 0
367^done
(gdb)
368 set *0xFFFFE200 = 0x4
&"set *0xFFFFE200 = 0x4 \n"
set *0xFFFFE200 = 0x4
368^done
(gdb)
369 set *0x20000000 = 0
&"set *0x20000000 = 0 \n"
set *0x20000000 = 0
369^done
(gdb)
370 set *0xFFFFE200 = 0x4
&"set *0xFFFFE200 = 0x4 \n"
set *0xFFFFE200 = 0x4
370^done
(gdb)
371 set *0x20000000 = 0
set *0x20000000 = 0
&"set *0x20000000 = 0 \n"
371^done
(gdb)
372 set *0xFFFFE200 = 0x3
set *0xFFFFE200 = 0x3
&"set *0xFFFFE200 = 0x3 \n"
372^done
(gdb)
373 set *0x20000020 = 0xCAFEDEDE
&"set *0x20000020 = 0xCAFEDEDE \n"
set *0x20000020 = 0xCAFEDEDE
373^done
(gdb)
374 set *0xFFFFE204 = 0x65B
set *0xFFFFE204 = 0x65B
&"set *0xFFFFE204 = 0x65B\n"
374^done
(gdb)
375 set *0xFFFFE200 = 0
&"set *0xFFFFE200 = 0\n"
set *0xFFFFE200 = 0
375^done
(gdb)
376 set *0x20000000 = 0
&"set *0x20000000 = 0\n"
set *0x20000000 = 0
376^done
(gdb)
377 echo SDRAM configuration ok.\n
echo SDRAM configuration ok.

&"echo SDRAM configuration ok.\\n \n"
~"SDRAM configuration ok.\n"
SDRAM configuration ok.
377^done
(gdb)
378 set *(unsigned int)0x200000 = 0xe59ff018
set *(unsigned int)0x200000 = 0xe59ff018
&"set *(unsigned int)0x200000 = 0xe59ff018 \n"
378^done
(gdb)
379 set *(unsigned int)0x200020 = 0x20000000
&"set *(unsigned int)0x200020 = 0x20000000 \n"
set *(unsigned int)0x200020 = 0x20000000
379^done
(gdb)
380 set *(unsigned int)0xFFFFEF00 = 0x3
set *(unsigned int)0xFFFFEF00 = 0x3
&"set *(unsigned int)0xFFFFEF00 = 0x3 \n"
380^done
(gdb)
381 set remote memory-write-packet-size 1025
&"set remote memory-write-packet-size 1025 \n"
set remote memory-write-packet-size 1025
381^done
(gdb)
382 set remote memory-write-packet-size fixed
&"set remote memory-write-packet-size fixed \n"
set remote memory-write-packet-size fixed
382^done
(gdb)
383 set remote memory-read-packet-size 1025
&"set remote memory-read-packet-size 1025 \n"
set remote memory-read-packet-size 1025
383^done
(gdb)
384 set remote memory-read-packet-size fixed
&"set remote memory-read-packet-size fixed \n"
set remote memory-read-packet-size fixed
384^done
(gdb)
385 load
load
&"load\n"
~"Loading section .fixed, size 0x3d8e0 lma 0x20000000\n"
Loading section .fixed, size 0x3d8e0 lma 0x20000000
327+download,{section=".fixed",section-size="252128",total-size="1072631"}
327+download,{section=".fixed",section-sent="8928",section-size="252128",total-sent="8928",total-size="1072631"}
327+download,{section=".fixed",section-sent="64416",section-size="252128",total-sent="64416",total-size="1072631"}
327+download,{section=".fixed",section-sent="115776",section-size="252128",total-sent="115776",total-size="1072631"}
327+download,{section=".fixed",section-sent="167216",section-size="252128",total-sent="167216",total-size="1072631"}
327+download,{section=".fixed",section-sent="222464",section-size="252128",total-sent="222464",total-size="1072631"}
~"Loading section .postrelocate, size 0x70 lma 0x2003d8e0\n"
Loading section .postrelocate, size 0x70 lma 0x2003d8e0
327+download,{section=".postrelocate",section-size="112",total-size="1072631"}
~"Start address 0x20000000, load size 252240\n"
Start address 0x20000000, load size 252240
~"Transfer rate: 99 KB/sec, 985 bytes/write.\n"
Transfer rate: 99 KB/sec, 985 bytes/write.
385^done
(gdb)
386 thbreak main
&"thbreak main \n"
thbreak main
~"Hardware assisted breakpoint 1 at 0x200004b0: file main.c, line 90.\n"
Hardware assisted breakpoint 1 at 0x200004b0: file main.c, line 90.
386^done
(gdb)
387-break-list
387^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="hw breakpoint",disp="del",enabled="y",addr="0x200004b0",func="main",file="main.c",fullname="C:/SAM/modem/getting-started-project/main.c",line="90",times="0"}]}
(gdb)
388 echo \nThe following value should be 0x30008000\n
&"echo \\nThe following value should be 0x30008000\\n \n"
~"\n"

echo
The following value should be 0x30008000

~"The following value should be 0x30008000\n"
The following value should be 0x30008000
388^done
(gdb)
389 p/x *0xFFFFFD44
&"p/x *0xFFFFFD44 \n"
p/x *0xFFFFFD44
~"$1 = 0x8000\n"
$1 = 0x8000
389^done
(gdb)
390 continue
&"continue\n"
continue
[/size]
I would be very grateful if someone could point out the cause of the the "mi_cmd_break_watch" error. The debugging session suspends and never reaches main().

Once I have a good version of the GDB init script I will gladly post it in this forum. I am almost certain it is correct.

Thanks very much.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 8:55 pm 
Offline

Joined: Wed Jun 25, 2008 3:27 am
Posts: 10
Location: Seattle, WA, USA
This issue has been partly solved. To resolve the "mi_cmd_break_watch" errors I did the following:

1. Deinstalled the current version of Eclipse
2. Reinstalled Eclipse 3.4.0 (Ganymede)
3. Used the "Software Updates" feature in Eclipse and installed Zylin 4.3.1
4. Reloaded my project and opened the Debug perspective in Eclipse
5. Deleted everything under the Breakpoints tab (some old breakpoints
from previous debug sessions still appeared).
6. Restarted the debugging session and launched the GDB Server

My next issue is still causing problems. I still cannot get the JTAG to break
in main. There are some references to an "init_sdram.gdb" script on Atmel's website. However, I can't seem to locate anything on the Web. Does anyone have a sample script they could post for the AT91SAM9263-EK target? I would like to compare it with mine. Here is an update of my script:

# Set up gdb, init clocks, watchdog, and SDRAM
# Change to default reset behavior
monitor long 0xFFFFFD08 0x401
# Reset peripherals
monitor long 0xFFFFFd00 0x4
# Unremap
monitor long 0xFFFFEF00 0x0
# Zero out registers
monitor reset 6
# Disable and clear AIC interrupt sources
monitor long 0xFFFFF124 0xFFFFFFFF
monitor long 0xFFFFF128 0xFFFFFFFF

monitor reset
monitor speed 30
monitor speed adaptive
# Disable watchdog
monitor long 0xfffffd44 0x00008000

# Configure master clock
echo Configuring the master clock...\n
# Enable main oscillator
set *0xFFFFFC20 = 0x00004001
monitor sleep 100
# Switch to main oscillator
set *0xFFFFFC30 = 0x00000001

# Set PLLA to 100MHz
set *0xFFFFFC28 = 0x2048BF07
monitor sleep 200

# Select prescaler
set *0xFFFFFC30 = 0x00000101
monitor sleep 100

# Select master clock based on PLLA
set *0xFFFFFC30 = 0x00000102
monitor sleep 100
echo Master clock ok.\n

echo Configuring the SDRAM controller...\n
# Enable EBI chip select for the SDRAM
set *0xFFFFED20 = 0x1000A

# SDRAM configuration
set *0xFFFFE208 = 0x85227259

set *0xFFFFE200 = 0x2
set *0x20000000 = 0

set *0xFFFFE200 = 0x4
set *0x20000000 = 0x1
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0

set *0xFFFFE200 = 0x3
set *0x20000020 = 0xCAFEDEDE

set *0xFFFFE204 = 0x65B

set *0xFFFFE200 = 0
set *0x20000000 = 0

echo SDRAM configuration ok.\n

# Write an assembly instruction to SRAM0 (which will
# be put at 0x0, the reset vector) to do a load
# address jump
set *(unsigned int)0x200000 = 0xe59ff018
# The address to jump to - the beginning of SDRAM
set *(unsigned int)0x200020 = 0x20000000
# Now remap SRAM0 to 0.
set *(unsigned int)0xFFFFEF00 = 0x3
set remote memory-write-packet-size 1025
set remote memory-write-packet-size fixed
set remote memory-read-packet-size 1025
set remote memory-read-packet-size fixed
break main
load at91sam9263_sdram.elf
continue


Thanks very much!


Top
 Profile  
 
 Post subject: SAM-ICE/Eclipse/Yagarto Tools AT91SAM9263-EK Debugging Issue
PostPosted: Fri Jun 27, 2008 2:29 am 
Offline

Joined: Wed Jun 25, 2008 3:27 am
Posts: 10
Location: Seattle, WA, USA
...SOLVED!!!

For the benefit of others here is a GDB script that could be useful for debugging with the AT91SAM9263-EK hardware using SDRAM:


target remote localhost:2331
# Set up gdb, init clocks, watchdog, and SDRAM
# Change to default reset behavior
monitor long 0xFFFFFD08 0xA5000001
# Reset peripherals
monitor long 0xFFFFFD00 0x3
# Zero out registers
monitor reset 6
# Disable and clear AIC interrupt sources (important!)
monitor long 0xFFFFF124 0xFFFFFFFF
monitor long 0xFFFFF128 0xFFFFFFFF

monitor reset
monitor speed 30
monitor speed adaptive
# Disable watchdog
monitor long 0xfffffd44 0x00008000

# Configure master clock
echo Configuring the master clock...\n
# Enable main oscillator
set *0xFFFFFC20 = 0x00004001
monitor sleep 100
# Switch to main oscillator
set *0xFFFFFC30 = 0x00000001

# Set PLLA to 100MHz
set *0xFFFFFC28 = 0x2048BF07
monitor sleep 200

# Select prescaler
set *0xFFFFFC30 = 0x00000101
monitor sleep 10

# Select master clock based on PLLA
set *0xFFFFFC30 = 0x00000102
monitor sleep 100
echo Master clock ok.\n

echo Configuring the SDRAM controller...\n
# Enable EBI chip select for the SDRAM
set *0xFFFFED20 = 0x1000A

# Configure PIOD
set *0xFFFFF870 = 0xFFFF0000
set *0xFFFFF874 = 0x00000000
set *0xFFFFF804 = 0xFFFF0000

# SDRAM configuration
set *0xFFFFE208 = 0x85227259
monitor sleep 100

set *0xFFFFE200 = 0x2
set *0x20000000 = 0

set *0xFFFFE200 = 0x4
set *0x20000000 = 0x1
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0
set *0xFFFFE200 = 0x4
set *0x20000000 = 0

set *0xFFFFE200 = 0x3
set *0x20000020 = 0xCAFEDEDE

set *0xFFFFE204 = 0x65B

set *0xFFFFE200 = 0
set *0x20000000 = 0

echo SDRAM configuration ok.\n

# Write an assembly instruction to SRAM0 (which will
# be put at 0x0, the reset vector) to do a load
# address jump
set *(unsigned int)0x200000 = 0xe59ff018
# The address to jump to - the beginning of SDRAM
set *(unsigned int)0x200020 = 0x20000000
# Now remap SRAM0 to 0.
set *(unsigned int)0xFFFFED00 = 0x3
set remote memory-write-packet-size 1025
set remote memory-write-packet-size fixed
set remote memory-read-packet-size 1025
set remote memory-read-packet-size fixed
load <YOUR ELF FILE>.elf
#break main
continue


The "break main" statement is commented out so that you can select
any other break point you wish via the Debug perspective in Eclipse. I hope this helps anyone interested using this platform and development environment.

Regards


Top
 Profile  
 
 Post subject: debugging with eclipse/j-link/sam-ice
PostPosted: Thu Aug 14, 2008 9:51 pm 
Offline

Joined: Mon Jul 14, 2008 9:52 pm
Posts: 6
Location: Seattle
Thanks for posting this.
It is very encouraging to hear you have debugging working.

I have a at91SAM9260-EK and am trying to find or write the init_sdram.gdb script.

Is this script what you use for init_sdram.gdb? Or do you type it into the debug command configuration tab of eclipse?

I seems that I'm able to load the "getting started" app, and it says it is executing, but there is no evidence that it is.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 14, 2008 11:24 pm 
Offline

Joined: Wed Jun 25, 2008 3:27 am
Posts: 10
Location: Seattle, WA, USA
Hello,

Check out this link for how to initialize the AT91SAM9260-EK hardware:

http://www.at91.com/phpbb/viewtopic.php?p=12164&sid=7ae37d536e250698bd039483f880ff05

To set up the debugger I went to the Debug Configurations menue in Eclipse. The "target remote localhost:2331" line is placed in the 'Initialize Commands' window while the rest of the script is placed in the 'Run Commands' window.

Good luck!


Top
 Profile  
 
 Post subject: Re: SAM-ICE/Eclipse/Yagarto Tools AT91SAM9263-EK Debugging Issue
PostPosted: Thu Jun 04, 2009 9:54 am 
Offline

Joined: Thu May 21, 2009 3:29 pm
Posts: 9
a bit late but for others looking for these kind of stuff:
and I have a question at the end..

I am using AT91SAM9260-EK + Eclipse + Yagarto + JLink

and the commands that I've used in Eclipse:
'Initialize' commands:
Code:
target remote localhost:2331


'Run' commands:
Code:
# Change to default reset behavior
monitor long 0xFFFFFD08 0x401
# Reset peripherals
monitor long 0xFFFFFd00 0x4
# Unremap
monitor long 0xFFFFEF00 0x0
# Zero out registers
monitor reset 6
# Disable and clear AIC interrupt sources (important!)
monitor long 0xFFFFF124 0xFFFFFFFF
monitor long 0xFFFFF128 0xFFFFFFFF

monitor reset
monitor speed 30
monitor speed adaptive
# Disable watchdog
monitor long 0xfffffd44 0x30008000

echo Configuring the SDRAM controller...\n

# Enable EBI chip select for the SDRAM
set *0xFFFFEF1C = 0x2

# SDRAM configuration
set *0xFFFFEA08 = 0x852272D9

set *0xFFFFEA00 = 0x1
set *0x20000000 = 0

set *0xFFFFEA00 = 0x2
set *0x20000000 = 0

set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0
set *0xFFFFEA00 = 0x4
set *0x20000000 = 0

set *0xFFFFEA00 = 0x3
set *0x20000000 = 0

set *0xFFFFEA00 = 0x0
set *0x20000000 = 0

set *0xFFFFEA04 = 0x2B7

echo SDRAM configuration ok.\n

# Write an assembly instruction to SRAM0 (which will
# be put at 0x0, the reset vector) to do a load
# address jump
set *(unsigned int)0x200000 = 0xe59ff018
# The address to jump to - the beginning of SDRAM
set *(unsigned int)0x200020 = 0x20000000
# Now remap SRAM0 to 0.
set *(unsigned int)0xFFFFEF00 = 0x3
set remote memory-write-packet-size 1025
set remote memory-write-packet-size fixed
set remote memory-read-packet-size 1025
set remote memory-read-packet-size fixed
load at91sam9260_getting_started_sdram.elf
thbreak main
echo \nThe following value should be 0x30008000\n
p/x *0xFFFFFD44
continue


I had to erase the part about master clock cuz I couldn't make it work..I don't know why, I couldn't find something working..

And my question is: I was having "mi_cmd_break_watch: Missing <expression>" error too. Then I found the answer here. I didn't uninstall Eclipse but I've just Removed All Breakpoints in the Run tab.

And it's working..why ?

Can someone explain me that please ??


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: