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.
We have a small USB sensor that uses the MSP430F5526. We rely on the bootloader to program new boards as well as to update firmware should the need arise. Our program uses the python source code (with a few modifications to fix a few timing issues) given in the bootloader example code. We have had these in production for approximately 3 years without any problems. Lately, the application is not being successfully written to flash memory. Initializing the factory BSL works, writing the RAM BSL works, re-enumerating to the RAM BSL works, and the RAM BSL appears to accept the commands sent to it with no problems. If I send an unsupported command like TX_DATA_BLOCK, it responds with the correct error code 7 for unknown command.But for whatever reason, the flash memory is not being written. Has anyone seen this before or knows how to fix it?
It may be helpful to know that the MSP430 USB Firmware Upgrade Example v1.3.1 output is:
Sending RAM BSL v00.07.08.38
Done RAM BSL v00.07.08.38
USB device was unplugged!
Unsuccessful in starting the BSL. Restarting.
USB device was unplugged!
However our custom script seems to have no problem starting the RAM BSL. I believe this is because we allot additional time for re-enumeration after the ram bsl has been written. I have also tried the newer version of RAM BSL v00.08.08.38 with the same results.
Hello Jason,
Have you actually verified that the FLASH is not being written to by reading back the content after it has been updated? You can use the MSP430Flasher tool to read back memory content.
Just for my clarification, was the MSP430 USB Firmware Upgrade Example v1.3.1 tool customized or the python based tool? The MSP430 USB Firmware Upgrade Example v1.3.1 downloaded from TI website is not python based...so I am a little confused here.
Also is it possible to send the entire output listed in the MSP430 USB Firmware Upgrade Example v1.3.1 tool? It should have something like this:
Starting
Mass erase occurred!
Password sent Successfully
Sending RAM BSL v00.07.08.38
Done RAM BSL v00.07.08.38
Sending Blink LED code
Firmware Sent
Memory successfully verified
Total programming time is 93ms
If you are not seeing the FLASH written to, you can check a couple of things:
1) Are you sending the correct password?
2) Are you writing up to byte boundary? This might not cause the issue you are indicating but it might be worth checking.
Regards,
Arthi
Thank you for the reply Arthi
Arthi Bhat1 said:Just for my clarification, was the MSP430 USB Firmware Upgrade Example v1.3.1 tool customized or the python based tool?
It's a customization of the python based tool, which I found in MSPWare_3_20_00_37\usblib430\Host_USB_Software\Python_Firmware_Upgrader\python-msp430-tools
Arthi Bhat1 said:Have you actually verified that the FLASH is not being written to by reading back the content after it has been updated?
Yes, I've used the Lite FET-Pro430 tool to read back the memory and it is all 0xFF, except for a few bytes in the info memory segments and the bootloader area starting at 0x1000.
\Arthi Bhat1 said:Also is it possible to send the entire output listed in the MSP430 USB Firmware Upgrade Example v1.3.1 tool?
Here is the entire output.
Starting
Password Sent Successfully
Sending RAM BSL v00.07.08.38
Done RAM BSL v00.07.08.38
USB device was unplugged!
Unsuccessful in starting the BSL. Restarting.
USB device was unplugged!
It does this for the Blinky example code as well.
Arthi Bhat1 said:1) Are you sending the correct password?
The password is initially sent incorrect as 30 bytes of 0xff and 2 bytes of 0x00 to trigger a mass erase of the flash memory. After that, the password of 32 bytes of 0xff is sent and is accepted without error.
Arthi Bhat1 said:2) Are you writing up to byte boundary?
I don't know what you mean by writing up to the byte boundary. But the starting address I'm writing to is 0x4400 and there are 19898 bytes of application code. I'm also writing 46 bytes of data to address 0xffd2 which I think it the reset vector.
Something else to add. The problem we are having is not ALL the time / every board. In fact last week we built up 25 of them and none of them had any issues. This week we built up 25 more and every single one of them has the problem. Same manufacturing employee, work station, procedure, batch of boards, even USB port was used. And it's been off and on like this for about a month though it's not always one batch is good one batch is bad. Sometimes it's 10-15 bad in the group. In other words, the problem is intermixed but only started showing up in the last month or so out of 3 years of manufacturing.
It appears to have worked...? Here is the output of the log file. My board doesn't have an LED to blink with the Blinky program but it no longer responds to the BSL-Scriptor so I would assume that it is running the correct code. And reading the memory back with FET Pro430 tool there is indeed new code written to flash.
BSL Scripter 3.3.0
PC software for BSL programming
2018-Apr-12 13:16:19
---------------------------------------------------------
Input file script is : C:/ti/msp430/MSPBSL_Scripter_win/Example/5xx_usb/script_5xx_usb.txt
////////////////////////////////////
//Write RAM USB BSL to the device
////////////////////////////////////
MODE 5xx USB
//gives wrong password to do
//mass erase in the memory
RX_PASSWORD pass32_wrong.txt
Read Txt File : C:\ti\msp430\MSPBSL_Scripter_win\Example\5xx_usb\pass32_wrong.txt
[ERROR_MESSAGE]BSL Password is error!
RX_PASSWORD pass32_default.txt
Read Txt File : C:\ti\msp430\MSPBSL_Scripter_win\Example\5xx_usb\pass32_default.txt
BSL Password is correct!
RX_DATA_BLOCK_FAST RAM_BSL_USB.txt
Read Txt File : C:\ti\msp430\MSPBSL_Scripter_win\Example\5xx_usb\RAM_BSL_USB.txt
Time elapsed of writing 3328 bytes : 0.109 seconds
Speed of writing data :29.81(kB/s)
SET_PC 0x2504
DELAY 3000
Delay 3000 ms
////////////////////////////////////
//Start the RAM USB BSL application
//to download the blink application
////////////////////////////////////
MODE 5xx USB
RX_PASSWORD .\pass32_default.txt
Read Txt File : C:\ti\msp430\MSPBSL_Scripter_win\Example\5xx_usb\pass32_default.txt
BSL Password is correct!
RX_DATA_BLOCK .\blinkLED_f5529.txt
Read Txt File : C:\ti\msp430\MSPBSL_Scripter_win\Example\5xx_usb\blinkLED_f5529.txt
Time elapsed of writing 230 bytes : 0.023 seconds
Speed of writing data :9.765(kB/s)
SET_PC 0x4400
Hi Jason,
Can you replace the entire code in your function jumpToBSL() with the following and see if it works for you:
USB_disconnect (); //Sets PUR pin to high-impedance (clear PUR_EN in USBCNF), disables
//the VBUS "going OFF" interrupt (clear BVOFFIE in USBPWRCTL)
USB_disable(); //Disables USB module (clear USB_EN in USBCNF) and disable PLL (clear
//UPLLEN in USBPLLCTL).
//__delay_cycles(2); //If need delay.
((void (*)())0x1000)(); //jump to BSL
Regards,
Arthi
No luck. It always starts up in application code instead of the bsl. And it doesn't matter how long the delay is before I call the BSL. I've tried 1 cycle up to 5 seconds and still starts up in application code. In section 3.8.1 of Using_the_BSL.pdf there it says:
"TI recommends clearing the configuration of any module registers that are used in the BSL application,
because the configuration for the external application can interrupt the BSL application and cause
unexpected behavior. One example is that in the USB BSL, the Timer_B module is used in clock
initialization. If Timer_B is also used in the external application, this might cause a failure in BSL
initialization. "
We are using Timer A and Timer B (which I was clearing in the original jumpToBSL function) and UCB0 for SPI communications. We are using a 4 MHz crystal on XT2 and clocks are initialized at 8 MHz.
There's also a mention of:
"Memory location 0x1002 contains a jump to the "BSL Action" function. To invoke the action function, three
parameters are needed. The first parameter is a number describing which function, the second two are
simply known values to indicate that the function was called intentionally.
R12: The function number
R13: 0xDEAD
R14: 0xBEEF"
I don't think this applies in my case, but I tried loading R13 and R14 anyway and still no luck.
**Attention** This is a public forum