SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By gibbon1
#83976
I'm trying to sort out a tool chain and debugger for the AT91SAM7S256 on a SAM7-256 from Olimex.

Using the Using Open Source Tools - Guide by Jim Lynch as a guide I've been able to install and configure eclipse, yargarto, and the SAM ICE, Atmel branded SEGGER ICE. And I can now compile a slightly modified LED blink program to run on the SAM7-256. I download it using the wiggler that I got with the SAM7-256 and it seems to work.

However trying to use the SAM ICE I came up with the problem that it won't download the code into the AT91SAM7S256, complaining that my license is missing. Segger says they'll happily sell me a license for $560. They also sent me a thirty day license but it doesn't work. So I'm kind of stuck. If the ICE won't allow me to download my code, obviously I can't debug it.

So I'm thinking about getting either an Olimex ARM-USB-OCD or ARM-JTAG-EW instead. Has anyone have any luck using either of these for source level debugging under eclipse?
By theatrus
#84070
Are you using the Segger GDB server? Are you writing to flash or RAM?

Note that OpenOCD can also talk to the JLink based pods, and ignores licensing information.
By gibbon1
#84107
theatrus wrote:Are you using the Segger GDB server? Are you writing to flash or RAM?

Note that OpenOCD can also talk to the JLink based pods, and ignores licensing information.
I'm using the Segger GDB Server V4.08h

Writing to flash.

I can download my program via the 'wiggler' I got with the SAM7-256 and it appears to run okay. (LED's flash)

Seggers tech Support says I need a license to download to flash. Atmels tech claims I do not need a license.
By carrierwave
#84122
I've had good results with the ARM-USB-OCD debugging in Eclipse on my SAM7S256 board. I wrote up a full series of tutorials on the topic at carrierwave.wordpress.com, the one you're looking for is near the bottom.
By theatrus
#84129
I was under the impression that the Atmel version can download to flash. You might want to get Atmel to provide an example. What commands are you using to load flash? Have you tried openocd instead of the gdbserver?
By gibbon1
#84159
theatrus wrote:I was under the impression that the Atmel version can download to flash. You might want to get Atmel to provide an example. What commands are you using to load flash? Have you tried openocd instead of the gdbserver?
I'm using the following commands.

# connect to the J-Link gdb server
target remote localhost:2331
# Select flash device
monitor flash device = AT91SAM7S256
# Enable flash download and flash programming
monitor flash download = 1
monitor flash breakpoints = 1
# Set JTAG speed to 30 kHz
monitor endian little
monitor speed 30
# Reset the target
monitor reset 8
monitor sleep 10
# Perform peripheral reset
monitor long 0xFFFFFD00 = 0xA5000004
monitor sleep 10
# Disable watchdog
monitor long 0xFFFFFD44 = 0x00008000
monitor sleep 10
# Initialize PLL
monitor long 0xFFFFFC20 = 0x00000601
monitor sleep 10
monitor long 0xFFFFFC2C = 0x00480a0e
monitor sleep 10
monitor long 0xFFFFFC30 = 0x00000007
monitor sleep 10
monitor long 0xFFFFFF60 = 0x00480100
monitor sleep 100
# Setup GDB for faster downloads
#set remote memory-write-packet-size 1024
set remote memory-write-packet-size 4096
set remote memory-write-packet-size fixed
monitor speed 12000
load
break main
continue

Everything works untill the load command executes and then a window pops up asking for a license

"Sorry, no valid license for flash download found.
J-Link S/N is 28002112."

In this document Segger says about the J Link GDB Server that

http://www.segger.com/pub/manuals/UM080 ... Server.pdf

J-Link GDB Server can be used free of charge without limitation of program size with SAM-ICE.
By RolfSegger
#87067
Flash download works (does not need an extra license) with the SEGGER J-Link software on all supported devices. Supported devices are
most popular ARM-based microcontrollers, so all popular
ATMEL AT91 devices (and many other of course) are supported.
Again, there is no extra license required; the only thing you need is a
half-way recent version of the software.
In case of doubt, donwload it from http://www.segger.com/cms/jlink-software.html
Flash download is free (not requiring a license) for J-Links and OEM versions of J-Link, such as SAM-ICE. An other option with J-Link and SAM-ICE is always to use OpenOCD with it.