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

Sharing information between bootloader and Application

I am in the process of writing a boot loader for my current application and I need to share information between the 2 programs. I am using an STM32F103.

For an example if my boot loader will be located at:
IROM1: 0x08000000 to 0x08000FFF
IRAM1: 0x20000000 to 0x200001FF

and my application is at:

IROM1: 0x08001000 to 0x08019000
IRAM1: 0x20000200 to 0x20004D00

So if I want to share/update/store the boot loader state used by both programs how do I define an area accessible for both application in so both can read/write to the same ROM and RAM memory locations. I am also assuming the NVIC vector is required to be stored at 0x08000000 for the boot loader and 0x08001000 for the application.

I am assuming if I define variables out side the memory location defined above to read/write from ROM or Read/Write from RAM I would get an error since I will be outside the defined memory area, but maybe I am wrong. Or maybe I am completely wrong.

I just don't want to go to far down this path if this wont work. Or maybe there is a better solution.

thanks for any help.

Parents
  • IRAM1: 0x20000000 to 0x200001FF
    
    IRAM1: 0x20000200 to 0x20004D00
    


    There is not usually any need to keep the RAM allocations of boot loader and application separate like that. After all, only one of the two will actually be executing code at all, at any given time, so the other one won't be needing its RAM.

    As to communication, you'll have to figure out how to allocate variables to an address fixed at compile/link time. Then all you have to do is use the same fixed address (and data type) in both programs, and you should be all set.

Reply
  • IRAM1: 0x20000000 to 0x200001FF
    
    IRAM1: 0x20000200 to 0x20004D00
    


    There is not usually any need to keep the RAM allocations of boot loader and application separate like that. After all, only one of the two will actually be executing code at all, at any given time, so the other one won't be needing its RAM.

    As to communication, you'll have to figure out how to allocate variables to an address fixed at compile/link time. Then all you have to do is use the same fixed address (and data type) in both programs, and you should be all set.

Children
No data