This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Ti team,
We need to implement FW upgrade for our device which using MSP430F5328 MCU. From previous study I found BSL has 2KB size limitation, once I added FW upgrade logic and SPI external flash read/write logic into BSL the size should be more than 2KB I think. So I am thinking if I can do the FW upgrade functions in MSPboot? however there is no MSPboot project for MSP430F5328 release by TI, so I think I need to customize it by myself.
May I know which example code should I use which is the most similar with MSP430F5328?
Actually I found one MSPBoot example online and try to understand it. But after read example of App2_MSPBoot_F5529_UART seems there are many things need to do if want to do customizing for MSP430F5328.
First, there is a function named TI_MSPBoot_JumpToBoot(void) which used to jump from MSPboot to BSL I think, In this function PassWd and StatCtrl are used directly here, I can not found the definition for them, May I know where is the definition for these two variables? another, I cannot find any related code can do jumping from MSPboot to BSL in this function. May I know how did it do the jump?
Next, there is a ProxyVectorTable[], the comment for it mentioned this is a BRA instruction, what is BRA instruction? should I change this value to corresponding value for MSP430F5328,May I know what is the correct value for MSP430F5328?
Finally, I have a question about BSL,MSPboot and main APP jumping. If I can do directly jump from main APP to MSPBoot by using (void(*)())address_of_mspboot)() once I want to do firmware upgrade in MSPBoot after received some command during main App running? or I must jump to BSL first then jump to MSPboot from BSL ? If I want to jump back to main App after firmware upgrade finished should I need jump to BSL first or I can directly jump to MSPBoot by using (void(*)())address_of_mainApp)() ? Thanks you very much.
kathy
Hi Kathy,
I found BSL has 2KB size limitation,
I haven't found any documentation related to a 2KB limitation. Can you clarify what you mean?
Regards,
Evan
Hi Evan,
Thanks for you reply. I found it on "Creating a Custom Flash-Based Bootloader (BSL) (Rev. G)" document which TI released on page 3 segment 1.1 BSL Memory Layout. As below.it said This BSL memory is a 2KB section of flash. Thank you.
Hi Kathy,
The BSL code itself takes 2KB of flash on the device, but it can load the entire main code region of flash (128KB on MSP430F5328). If you can't fit into the main memory, writing a new bootloader is likely not going to help.
Does this answer your question? Let me know if there is something I am not understanding about your application.
Regards,
Evan
Hi Evan,
Thanks for your reply, I get what you mean. But based on MSP430 Flash programmer tools memory configuration options as below, we can see the BSL size has limitation, am I right?
Another, I have few other questions as below.
first I want to ask what is the relation ship between BSL and MSPBoot. Is MSPBoot just used by the MCU which do not have BSL? Can I say MSPBoot is also an application?
Another, I have a question about BSL,MSPboot and main APP jumping.
May I know if I can do directly jump from main APP to MSPBoot by using (void(*)())address_of_mspboot)()?
If I want to jump from MSPBoot back to main APP, should I jump to BSL first then jump to main App from BSL ? or I can directly jump to main App by using (void(*)())address_of_mainApp)() from MSPBoot? Thank you very much.
BSL size has limitation, am I right?
Yes, but it's still unclear to me why this is a limitation for you. This is just the size of the BSL code region on the device.
what is the relation ship between BSL and MSPBoot. Is MSPBoot just used by the MCU which do not have BSL?
The introduction to the MSPBoot document has a good description:
May I know if I can do directly jump from main APP to MSPBoot by using (void(*)())address_of_mspboot)()?
I think you may need to do a little bit more than that. Here is a snippet from an example using MSPBoot (you can find it in the main MSPBoot download).
int main_boot( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; /* * Important Note: * MSPBoot assumes that proper conditions are met when executing after reset. * It’s important to remark that DCO must not be changed until VCC>=VCC(min), * and a minimum of 2.2V is required for Flash Program/Erase operations. * An optional software delay can be added for applications having a slow * voltage ramp-up or an external voltage supervisor is suggested * */ // __delay_cycles(10000); // Uncomment this line and adjust number of delay // cycles according to the application voltage ramp // Initialize MCU HW_init(); Clock_init(); // Validate the application and jump if needed if (TI_MSPBoot_AppMgr_ValidateApp() == true) TI_MSPBoot_APPMGR_JUMPTOAPP(); TI_MSPBoot_CI_Init(); // Initialize the Communication Interface #ifndef NDEBUG P1DIR |= BIT0; // Used for debugging purposes to show entry to MSPBoot P4DIR |= BIT7; P1OUT |= BIT0; P4OUT |= BIT7; #endif while(1) { // Poll PHY and Data Link interface for new packets TI_MSPBoot_CI_PHYDL_Poll(); // If a new packet is detected, process it if (TI_MSPBoot_CI_Process() == RET_JUMP_TO_APP) { // If Packet indicates a jump to App TI_MSPBoot_AppMgr_JumpToApp(); } #ifdef NDEBUG // Feed the dog every (interval depends on MCLK freq) WATCHDOG_FEED(); #endif }
Hi Evan,
Thanks for your reply.
I want to implement firmware upgrade in BSL, and planed to backup my main Application image to external SPI flash,So I need add new PI of SPI in BSL, But that will increase BSL's size to 3KB. that's no allowed.
Now I am trying to customize MSPBoot and want to implement my firmware upgrade logic in the MSPBoot. But seems I need to know the Boot sequence for the MSP430F5328 device. If I have MSPBoot and main App in my internal flash. Once the devices booted up, it will jump to MSPBoot first or main App? another, if I want to jump from main App to MSPBoot, should I just set a BOR in register and let the device reboot? Once the device rebooted how do I know it will jump to MSPBoot or not?
So where can define the boot up sequence? should I need BSL to be as a bootstrap for the device's every boot up? Thank you very much.
Hi Kathy,
The examples in the MSPBoot download show the device first performing the boot checks (i.e. should the MSPBoot take control of the device?) and then otherwise calling the application().
I think it is always easiest trying to adapt an example to your application.
Evan
Hi Evan,
Thanks for your reply.
May I know if the device do not have BSL then how can I make the MSPBoot executed first? Thank you.
Kathy,
Almost all MSP devices have some sort of BSL, including the F5328. BSL is only invoke if certain conditions exist, generally:
If neither of these things happen then BSL will not be invoked and the CPU will begin executing the application code.
Regards,
Evan
**Attention** This is a public forum