This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

IAP Firmware Update

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

Parents
  • You're right Per, application and bootloader should be independent. Right now the app. doesn't use IRQs, and RAM is uninitialized, but it might require IRQs in the future, and having to update the bootloader because of the IRQs doesn't make sense (or isn't even possible).
    But I still don't know how to activate the application. I linked the startup code (region called RESET in the map file) to the beginning of the ROM region 2 (addr. 0x110000) and call it via a function pointer pointing to this address (like I did in some AVR bootloader project). Or do I have to branch to this address instead?

Reply
  • You're right Per, application and bootloader should be independent. Right now the app. doesn't use IRQs, and RAM is uninitialized, but it might require IRQs in the future, and having to update the bootloader because of the IRQs doesn't make sense (or isn't even possible).
    But I still don't know how to activate the application. I linked the startup code (region called RESET in the map file) to the beginning of the ROM region 2 (addr. 0x110000) and call it via a function pointer pointing to this address (like I did in some AVR bootloader project). Or do I have to branch to this address instead?

Children
No data