Hi all!
I'm trying to write a bootloader application for SAM7X which receives a new (encrypted) firmware via the debug port, stores it in external flash, and after successfully downloading/storing it copies/decrypts the firmware to internal flash of the SAM7X. So far the bootloader and firmware(application) have been contained in a single µVision project and it seemed I can update the firmware. Bootloader and application have been put in two different ROM regions and when I wanted to download a new firmware I just skipped the bootloader part in the HEX file. But when I added the encryption stuff which also uses some library code I ran into troubles (code shared by bootloader and application) so I split the bootloader and application in two different projects. The project for the bootloader should be straight forward: include the ASM startup code, link code to ROM section 1, put all variables in RAM section 1. After running the bootloader call the firmware's 'main' function which is to be placed on a known address (beginning of the ROM section 2) via a function pointer.
What I'm not sure about is how to set-up the project for the application? I configured µVision to put code in ROM section 2, and variables in RAM section 2. But I did NOT add the ASM startup code since this was already included in the bootloader. When I compile the application I get a linker Warning: .\V4R0.sct: Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multiple choices.) Not sure if this is a problem since the build process completes. However when I want to execute the firmware it seems that calling the application's 'main' (name is different since there can only be one main()), BUT then enters the ABORT mode at some point. I doubt it's got something to do with the application since this has been already running (without the bootloader).
Anybody got any idea? I'd really appreciate! regards, Chris