Other Parts Discussed in Thread: Z-STACK
I am working on creating a custom bootloader for a device that uses a CC2530 microcontroller, and modifying an existing firmware build to work with the bootloader. Eventually this will be the means to achieve OTA update capability.
I’ve based a fair amount of the code on examples from Z-Stack 3.0.1, but I’ve hit a roadblock with configurations and linker files. As my version of IAR (v7.51) is ancient I cannot open the example project to see how the compiler is configured for both the bootloader and main application. This is what I need help with; choosing the correct code model, data model, calling convention, location for constants, etc. for each part and setting up the linker files. Using the linker files from Z-Stack for OTA boot and main is not working.
At this point, a bootloader configured exactly like the existing application can do everything short of reprogramming the internal flash. The code works for doing so, but without everything stashed in the correct internal memory locations I don’t think the main application will program correctly.
Just as verification, I stripped down the bootloader to just start the clock and jump to main application (proof of concept type stuff). This seemed to work, though I think the interrupt vector mapping is a bit jury-rigged. I just included in my project (can’t remember if it was bootloader or main application) the interrupt_stubs.r51 file from Z-stack. Looking at the hex file showed the lowest addresses essentially remapping elsewhere. If there’s a better way to do this, please let me know.
Any help with this last major hurdle of configuring the two builds (bootloader and main app) to play well with each other, and anything about interrupt vectors, would be greatly appreciated. If you need more information, please ask and I will provide what I can.
Thanks,
Sean

