Hi together,
I want to implement a custom bootloader based on my application UART on MSP430F5438A but I'm very new to that. I'm using IAR as IDE. I already looked through the AppNotes SLAU319, SLAA450 and SLAA600 and also was reading a lot of different posts concerning this topic. But somehow, I'm not sure how to start properly.
My app is comunicating with the connected master via UART A1. This is also the only connection to the 'outer world' and therefore has to be used to update the appcode. I learned so far, that in 5438A the BSL code can be changed, where my first question comes along: If I'm changing the code in the BSL memory section and this code is faulty, will I destroy my device or can I change/debug this part of code?
The TI based BSL is activated with a certain bit pattern, but I want my bootloader to automatically run at start up and wait for an update commando or, after a time out, jump to the start of the app. In this case, the reset vector has to point to the first bootloader address (0x1000). Is that right?
Preferable I would write the bootloader code in C, but I figured out, if using C there is some initial code which can lead to some troubles. In that case I don't hesitate to write that code in assembly.
That's how I would start:
- Creating a new project and not placing the bootloader code in the app project
- State that the code should be placed in the BSL section of the controller
- Initialize the device and program the protocol
- If an update should be done, performing a mass erase
- Copy the received code into the code memory
- Check code (e.g CRC)
- Copy interrupt table to RAM (If so, do I have to make some changes in my app code?)
- Jump to the start of the app
Do you think this can work? Maybe someone can provide more informations concerning this topic?
Any help appreciated!