EmbDev.net

Forum: ARM programming with GCC/GNU tools olimex AT91sams256 + ARM-USB-TINY Unable to debug from RAM


von Rohit C. (rohit123)


Rate this post
useful
not useful
Hi,

I am using Olimex ARM-USB-TINY for debugging. I installed the yogarto 
toolchain with the help of the .exe supplied with the ARM-USB-TINY cd. I 
am able to run the flash version of the example project given for my 
board with AT91sam7s256. But there is no project to run from RAM. So I 
followed James P. Lynch's tutorial and downloaded the example projects 
for olimex AT91sams64 and modified as mentioned by the author for 
sam256. Although the project builds with few quirks but I am unable to 
debug it.

Modifications to build-

- I use sam7flash.script instead of script.ocd as supplied with tutorial 
since I got a build error which asked for this file. I do not know how 
to specify script.ocd instead of sam7flash.script.

- I Added armusbocd_tiny.cfg and armusbocd.cfg which must be present in 
the project directory for the toolcain to work

Following Peter's tutorial I created debug launch configuration for 
debugging from RAM as:

Initialize command:
1
target remote localhost:3333

Run command:
1
monitor soft_reset_halt 
2
monitor armv4_5 core_state arm 
3
monitor mww 0xffffff60 0x00320100 
4
monitor mww 0xfffffd44 0xa0008000 
5
monitor mww 0xfffffc20 0xa0000601 
6
monitor wait 100 
7
monitor mww 0xfffffc2c 0x00480a0e 
8
monitor wait 200 
9
monitor mww 0xfffffc30 0x7 
10
monitor wait 100 
11
monitor mww 0xfffffd08 0xa5000401 
12
set remote memory-write-packet-size 1024 
13
set remote memory-write-packet-size fixed 
14
set remote memory-read-packet-size 1024 
15
set remote memory-read-packet-size fixed 
16
monitor mww 0xfffffd00 0xa5000004 
17
monitor mww 0xffffff00 0x01 
18
monitor reg pc 0x00000000 
19
monitor arm7_9 sw_bkpts enable 
20
load 
21
continue

Now when I launch debug configuration it gives following output in 
console:
1
target remote localhost:3333 
2
0x0000080c in ?? () 
3
Warning: /cygdrive/C/gccfd/projects/demo_at91sam7_p64_blink_ram: No such file or directory. 
4
monitor soft_reset_halt 
5
requesting target halt and executing a soft reset 
6
monitor armv4_5 core_state arm 
7
core state: ARM 
8
monitor mww 0xffffff60 0x00320100 
9
memory write caused data abort (address: 0xffffff60, size: 0x4, count: 0x1) 
10
monitor mww 0xfffffd44 0xa0008000 
11
monitor mww 0xfffffc20 0xa0000601 
12
monitor wait 100 
13
monitor mww 0xfffffc2c 0x00480a0e 
14
monitor wait 200 
15
monitor mww 0xfffffc30 0x7 
16
monitor wait 100 
17
monitor mww 0xfffffd08 0xa5000401 
18
set remote memory-write-packet-size 1024 
19
set remote memory-write-packet-size fixed 
20
set remote memory-read-packet-size 1024 
21
set remote memory-read-packet-size fixed 
22
monitor mww 0xfffffd00 0xa5000004 
23
monitor mww 0xffffff00 0x01 
24
monitor reg pc 0x00000000 
25
pc (/32): 0x00000000 
26
monitor arm7_9 sw_bkpts enable 
27
software breakpoints enabled 
28
load 
29
Loading section .text, size 0xf48 lma 0x200000 
30
Loading section .data, size 0x44c lma 0x200f48 
31
Start address 0x200000, load size 5012 
32
Transfer rate: 10 KB/sec, 835 bytes/write. 
33
continue
It hangs after that and shows "launching<projectname> 27% progress

Can anybody suggest me how to make it work.

Regards
Rohit

von Michael F. (mifi)


Rate this post
useful
not useful
Hello Rohit,

it looks that you use a compiler which is based on Cygwin,
is this possible?

The YAGARTO toolchain do not need Cygwin. You can find a SAM7S256
example on the YAGARTO page too which comes with a example to
debug in RAM.

>Warning: /cygdrive/C/gccfd/projects/demo_at91sam7_p64_blink_ram:
Do you have YAGARTO or GCCFD?

Best regards,

Michael

von Rohit C. (rohit123)


Rate this post
useful
not useful
Hi Michael,

First of all thanks for replying to the post.
1
it looks that you use a compiler which is based on Cygwin,
2
is this possible?

I really do not have idea. I had no success with installing the 
toolchain given in Peter Lynch's tutorial because of various reasons -
1. on page-19 of the tutorial open on chip debugger has changed on 
yagarto website because of some licensing issues. I do not have much 
idea as to how to use the changed one.
2. All the versions of the other Yagarto downloads have also changed.
3. There is no mention for setup for of ARM-USB-TINY in the tutorial, 
but that one is meant for hobbyists.

The exe which came along the olimex jtag has installed in following 
directory structure:
1
C:\gccfd\|
2
         |-ARM-USB-OCD-DRIVER
3
         |-codesourcery-arm-2008q1
4
         |-eclipse
5
         |-openocd
6
         |-utils
7
         |-yagarto

since yagarto is listed there I think its yagarto toolchain.

openocd directory also differs from your tutorial.

I would love to do follow the tutorial since it does not add any extra 
complexity to the environment in the form of extra lines in make file, 
in different linker scripts etc. in order to support more than one 
target.

Please guide me how to build the toolchain explained in Peter Lynch's 
tutorial with current changes of Yogarto most importantly for 
ARM-USB-TINY.

Please ask me if you need any more info to understand the problem.

Thanks and Regards
Rohit

von Michael F. (mifi)


Rate this post
useful
not useful
Hello Rohit,

it looks that you have two compilers:

1. CodeSourcery
2. YAGARTO

A new CodeSourcery Lite compiler can be found here:
http://www.codesourcery.com/sgpp/lite/arm

And the YAGARTO version can be found here:
http://www.yagarto.de/

First of all you should decide which compiler you want to use.

Regards,

Michael

von Rohit C. (rohit123)


Rate this post
useful
not useful
Hi Michael,

Ok, if I can follow the Peter's tutorial by having YAGARTO compiler than 
I"ll go for it. I"ll uninstall everything and follow tutorial from 
start.

But could you please answer my other doubts:
1
1. on page-19 of the tutorial open on chip debugger has changed on
2
yagarto website because of some licensing issues. I do not have much
3
idea as to how to use the changed one.
4
2. All the versions of the other Yagarto downloads have also changed.
5
3. There is no mention for setup for of ARM-USB-TINY in the tutorial,
6
but that one is meant for hobbyists.

Regards
Rohit

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.