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

Executing code from RAM (without LX51)

Hi All,

Working with a uPSD33xx.

I am writing a bootloader which performs IAP. Once I have downloaded an app, each time I reset the device I need to be able to 1) determine that an application is actually present before trying to execute it and 2) verify the integrity of said application.

To do this I want to use a block of boot flash to act as NV storage for details about the image, i.e. start address, length, checksum, etc.

My bootloader executes out of boot flash and so to have RW access to the NV 'image table' I guess I will need to execute my flash erase/programming routines out of RAM.

Alternatively I could waste a whole block of main flash on storing only a few 10's of bytes of data.

Has anyone acheive such a thing without the use of LX51 and friends?

Any help appreciated.

Andy

Parents
  • The app header doesn't need an entire sector of flash to itself. Why not just put your header at the start (or end) of the app flash area? Your boot loader is copying the code from flash to RAM anyway, so the app code doesn't have to start at any particular place in flash; that's up to your boot loader. The app will be located for its final address in RAM; its address in flash is irrelevant.

Reply
  • The app header doesn't need an entire sector of flash to itself. Why not just put your header at the start (or end) of the app flash area? Your boot loader is copying the code from flash to RAM anyway, so the app code doesn't have to start at any particular place in flash; that's up to your boot loader. The app will be located for its final address in RAM; its address in flash is irrelevant.

Children
  • the best bootloader schemes of mice and men do make sure that ANY power glitch at ANY time during upload will not leave a dead device.

    The more you include in the boot procedure, the greater the risk / the more careful you have to code - your choice.

    Erik

  • Hi Drew,

    Your reply didn't really make sense to me. Why do you think I am copying code from flash to RAM?

    The way I am intending to acheive IAP is to run the bootloader from boot flash, use it to download an application into main flash, validate the app and then switch the VM register and 'reset' to begin execution from main flash thereby running the main app. I have read about this technique being used by a number of people - some of which are regulars this forum.

    It sounds to me like you have an alternative and perhaps more flexible solution. What is your design and how does it cope with IAP? Are you saying that you copy your enire main application into RAM and execute from there?

    Cheers

    Andy

  • Andy,

    The title of your original post was "Executing code from RAM (without LX51)." This might have led to Drew's suspicions. :)

    -Jay D.