Other Parts Discussed in Thread: MSP430F5529,
Greetings,
I'm currently working on a Main Memory Bootloader that can be used to perform firmware upgrade. I am taking reference from MSPBOOT (slaa600d) and its relevant MSP430F5529 Examples.
The project is using the MSP-TS430PZ5X100 development board that supports MSP430F5438A MCU. The final deliverables will allow the MCU to store the Bootloader, and 2 Applications (APP1 & BACKUP). The BACKUP application will be untouched by the Bootloader, and it will act as default fallback, in case APP1 is corrupted.
For the start, I've managed to place the Bootloader and the 2 Applications in the lower FLASH (Below 0xFF80). However, I'm only using 'blinkies' as replacements for the actual applications (for now), without any interrupts.
The actual application will be much larger, so the upper FLASH (above 0xFFFF) will definitely be used. This leads to the 2 problems I'm facing at the moment.
- RESET VECTOR only takes in 2 bytes (or 16-bits) addresses.
- The address of the ENTRY POINT is not fixed, and it seems to be decided by the compiler
For the Bootloader to Jump to APP1, I've used a pointer to an address, specified in the linker command file.
E.g. ((void (*)()) _APP1_RESET_VECTOR) ();
I've tried to change the pointer to ENTRY POINT, instead of RESET VECTOR, but this leads to my problem 2.
As the Bootloader is meant for firmware upgrade, I can't afford varying address for my ENTRY POINT with each new firmware image.
Moreover, my intention is to have the bootloader in the lower FLASH, and the Applications take the upper FLASH.
So, splitting the Application to both lower and upper FLASH is not a possibility.
E.g. .text : {} >> FLASH | FLASH2
The current properties for my project on CCS (ver 8.3.1) are:
1) --code_model = large
2) --near_data = none
3) --rom_model
Furthermore, the erase option for my Bootloader is "Main memory Only" and both the applications are using "Differential Download".
So I FLASH my bootloader first, followed by the applications.
While it seems to be working fine now, I'm not sure if there are any problem arises with such download options at a later stage.
This is especially so when I'll be using interrupts later, with the implementation of vector redirection to RAM (with proxy table for each app on FLASH and each application load its own vectors to RAM when the respective app starts)
Therefore, I will like to know how I could proceed to use the upper FLASH memory (above 0xFFFF).
Also, I'm not sure if my problem requires the customization of _system_pre_init( ).
In fact, I'm having difficulty understanding on the customization of _system_pre_init() and boot.c of MSPBOOT.
So, i will gladly appreciate kind explanations and examples, if it is required.
Thank you.
Best regards,
Tan Zhi Wei