...overlay parts of my application to run in RAM?


1 comment

  • Avatar
    Marco Jakobs

    Hi Paul,

    thanks for this tip ... but i have an other problem related to this and i have no idea how to solve this.

    I have really no RAM left on my AT91SAM7X512, so can't define dedicated sections in RAM for my bootloader i have to write. I need to write a function which reads the program file out of my SPI data flash and put this into the flash of the controller. As this must completely run in RAM, i need to do following:

    - When the device starts up, i'll check if there is a new firmware is waiting for being programmed. This must be done before the RTOS and interrupts are started

    - In case there is a new version, i have to copy my "flash-functions" into the RAM, but *not* into a dedicated section which can not be used in normal operation for the variables and buffers. It should "share" the RAM with the variables which are used in normal operation.

    - After flashing, i'll do a hardware restart - so i don't have to care about leaving the RAM function to normal operation.

    My question is: How can i write a couple of small routines stored "normal" in the flash (this routines may only use relative branches as they have to be copied into the RAM), this routines should be copied somewhere into the RAM and then i have to call the copied "main function"?

    Thanks for helping me with this problem ;-)

    Comment actions Permalink

Please sign in to leave a comment.