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
  • edit:
    I just tried adding the startup code to the application, but the application still fails to run.
    When the bootloader exits it call to addr. 0x110000 which is the beginning of the ROM section 2 where the startup code is placed now:

    Memory Map of the image

    Image Entry point : 0x00110144

    Load Region LR_IROM2 (Base: 0x00110000, Size: 0x00020f34, Max: 0x00030000, ABSOLUTE, COMPRESSED[0x00020dc4])

    Execution Region ER_IROM2 (Base: 0x00110000, Size: 0x00020d4c, Max: 0x00030000, ABSOLUTE)

    Base Addr Size Type Attr Idx E Section Name Object

    0x00110000 0x00000144 Code RO 3 RESET sam7.o 0x00110144 0x0000000c Code RO 249 * $$startup$$ entry.o(mc_t.l) 0x00110150 0x00000002 Code RO 266 .emb_text init.o(mc_t.l) 0x00110152 0x00000002 PAD 0x00110154 0x0000020c Code RO 9 .text adc.o

    How do I run the application from the bootloader?

    best, Chris

Reply
  • edit:
    I just tried adding the startup code to the application, but the application still fails to run.
    When the bootloader exits it call to addr. 0x110000 which is the beginning of the ROM section 2 where the startup code is placed now:

    Memory Map of the image

    Image Entry point : 0x00110144

    Load Region LR_IROM2 (Base: 0x00110000, Size: 0x00020f34, Max: 0x00030000, ABSOLUTE, COMPRESSED[0x00020dc4])

    Execution Region ER_IROM2 (Base: 0x00110000, Size: 0x00020d4c, Max: 0x00030000, ABSOLUTE)

    Base Addr Size Type Attr Idx E Section Name Object

    0x00110000 0x00000144 Code RO 3 RESET sam7.o 0x00110144 0x0000000c Code RO 249 * $$startup$$ entry.o(mc_t.l) 0x00110150 0x00000002 Code RO 266 .emb_text init.o(mc_t.l) 0x00110152 0x00000002 PAD 0x00110154 0x0000020c Code RO 9 .text adc.o

    How do I run the application from the bootloader?

    best, Chris

Children
No data