ARM newbie. SAM7S, loading code in RAM.

Hi, A few months ago I purchased the olimex SAM7S256 board, and I am just getting around to playing with it. Device: AT91SAM7S256

http://www.olimex.com/dev/sam7-p256.html

I am not exactly new to this, I have been writing C code for AVR’s for a while using winAVR, so I’m somewhat aware of makefiles n such.

However, I am out of my depth here. I have read J Lynch’s tutorials (very helpful) and I have eclipse, yogarto tools, and openOCD.

The only form of ‘hardware interface’ I have is a JTAG wiggler (but my computer doesn’t have an LPT port), an Altera USB blaster (not supported by OpenOCD) or…using SAM-BA and a USB interface.

The furthest I have got is flashing the board with an example ‘LED blink’ *.bin file using SAM-PROG and SAM-BA (sending file to the flash area). I intend to do alot of tinkering to learn how to use these devices, so I would like to start off writing code, loading it into RAM, and testing it from there.

In-circuit debugging is nice…but I have got away with not using it for other devices…I just do ‘poor mans debugging’…using hyperterminal for USART’s, and LEDs lol

So, quesitons are:

  1. How exactly does one make sure code is downloaded, and run from the RAM area? I have used SAM-BA to send the *.bin file to RAM (0x200000) and using the ‘go’ command to run it, but its not happening.

  2. Is the above down to the startup files? configuration? or can one just put any *.bin file into ram, and run it from there? (I am assuming it must be compiled for its intended location, so I would have two ‘flavours’ of the same project, one to run in RAM, and one to run in FLASH.

  3. Possibly should be in the OpenOCD sub forum, but does anyone know if the altera byteblaster is support? I have prototyped my own FT2232 dongle, but I don’t really want to dedicate it to a JTAG adapter.

Ultimately, I’m not after everything, just using the tools available to write small, begginer, code for testing the various peripherals on the ARM, and using a relatively simple method to get this into the chip for testing. Hopefully I will learn more as I go.

Thanks :slight_smile:

BuriedCode.

In the tutorial “Using Open Source Tools for AT91SAM7 Cross Development - Revision C”, there is a section devoted to this. Page 167 shows how to place the code (.text), the variables (.data and .bss) into flash at address 0x0000. Then the MC Memory Remap register is used to place the RAM memory at address 0x0000. When you download with this configuration, it all goes into RAM. It executes faster, you get many more breakpoints, but you are limited to a 64k image.

Another approach is to just place a few functions in RAM. I demonstrated in this forum last December how to do this. Here is a link to that entry.

viewtopic.php?t=18620

I’m working on rewriting that tutorial for the ARM-Cortex, but it’s taking a long time to complete.

Cheers,

Jim Lynch

Jim,

Thanks for the reply! I must say I didn’t expect the man himself to respond… your tutorial has been by far the biggest source of information on setting up a cheap dev system, and as much as it sounds like I’m brown nosing, I truely appreciate it :slight_smile:

Yep, page 167. That’ll teach me for just reading up until the ‘flash version’ bit. Apologies if the post seemed like a waste of your time (as its alll in the tutorial). Also, a big thank you for the explanation between the differences between the ‘flash’ and ‘ram’ versions…I was over complicating it I think, expecting many differences in many files. The headers, linker scripts, and makefiles are now permanent templates for future projects, heavily annotated, which was exactly what I needed.

I’m still trying to get my ‘ghetto FT2232 programmer’ to work with openOCD, but I think that is more my own shoddy prototyping method rather than software.

Can’t wait for atmels ARM cortex to become available (can’t find parts anywhere as I think its still sampling), as well as your tutorial. I’ve heard the memory structure is somewhat easier to use, and if I can get a pin-to-pin compatable to the SAM7S256, I’ll be laughing :slight_smile:

Good luck, and thanks once again.

Scott.