Library files for SAM7X512

skpgebo wrote on Tuesday, November 13, 2012:


I have made a project based on the demo uIP_Demo_IAR_ARM7 and it’s working fine. I am using a SAM7X512, but with the AT91SAM7X256.h and lib_AT91SAM7X256.h files. However, my code is now above 256 Kbytes and and I have tried to find library files for the SAM7X512, but can’t find any. I have modified the AT91C_IFLASH_SIZE and AT91C_ISRAM_SIZE to 512Kbytes and 128 Kbytes and the code above 256 Kbytes runs ok in IAR debug mode, but won’t start after power up. Do anybody know where I can find library files for SAM7X512 (AT91SAM7X512.h and lib_AT91SAM7X512.h) or suggestion why the code won’t start up if code size is larger than 256 Kbytes.


rtel wrote on Tuesday, November 13, 2012:

I just tried opening an example that ships with the IAR tools from the \Embedded Workbench 6.0\arm\examples\Atmel\at91sam7x-ek\basic-serialflash-project directory, and it appears to have configurations for the 128, 256 and 512K parts.


skpgebo wrote on Tuesday, November 13, 2012:

Thank you Richard.
I replaced the AT91SAM7X256.h file with the AT91SAM7X512.h from this demo, but I got a bunch of warnings and errors. The file lib_AT91SAM7X256.h seems to have a lot of definition which has been changed. I mangage to clean up this file by renaming definitions and just keeping the definition which is in use in my project (the lib_AT91SAM7X256.h file was not used here). Finally, I got a running code, but unfortunately with same behaviour. The code runs ok in IAR debug mode, but won’t start after power up.


davedoors wrote on Tuesday, November 13, 2012:

When the IAR debugger connects to a target it can run a script that peeks and pokes a some registers to do any set up that is needed. Look at the debug options in the IDE to see if it is running a script, and if it is look at the script in a text editor to see what it is doing. It might be that the script is configuring a register that your start up code needs to configure, but isn’t, causing it to only run when connected to IAR.

skpgebo wrote on Wednesday, November 14, 2012:

I found my missing initialising of the flash for SAM7X in AT91F_LowLevelInit():


Changed to:

Now, it works just fine.
Thank you for support.