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

Making relocatable binaries for firmware updates

We have a multi-app bootloader. The application starts with bootloader.uvprojx and then switches to one of the two applications namely: fw2000 and fw3000. So we have 3 binaries/executables on our controller at following addresses of the flash program/code memory space: bootloader at 0x0, fw2000 at 0x2000 and fw3000 at 0x3000 .
fw2000 and fw3000 are the same code but these two app firmwares here are compiled using absolute ROM addresses to create fw2000.bin and fw3000.bin. This is done in Keil by setting the address in "Options for target"->"Target"->"IROM1:" -> "Start" address to respective start address .

We have this architecture to update firmware. For that creating bin/hex specific to absolute address is not desirable.

Is there a way to compile a fwXXXX which can be relocatable at both the addresses? Such that, fwXXXX is compiled and the .bin ot .hex can be written at any address (in this case 0x2000 or 0x3000).

Parents
  • Hi Pier,
    I tried shifted the vector table to the RAM in the firmware. The ISR funtion pointers are copied in the vector table in RAM. The program runs through the init and then stops working. I'm not able to debug this code.

    The reason could be that when the fw2000 is running, it is provided with fw3000.bin . The fw2000 copies the .bin file in the internal flash @ 0x3000. After fw2000 is done writing and veryfying the firmware, the MCU restarts and the bootloader will now boot only fw3000. fw3000 runs though init, I get a few led blinks as expected and then I can't tell what's happening. Is there a way to debug the fw3000 using Keil?

Reply
  • Hi Pier,
    I tried shifted the vector table to the RAM in the firmware. The ISR funtion pointers are copied in the vector table in RAM. The program runs through the init and then stops working. I'm not able to debug this code.

    The reason could be that when the fw2000 is running, it is provided with fw3000.bin . The fw2000 copies the .bin file in the internal flash @ 0x3000. After fw2000 is done writing and veryfying the firmware, the MCU restarts and the bootloader will now boot only fw3000. fw3000 runs though init, I get a few led blinks as expected and then I can't tell what's happening. Is there a way to debug the fw3000 using Keil?

Children
No data