Part Number: MSP430F5659
Other Parts Discussed in Thread: UNIFLASH
I am using the BSL-Scripter with the provided example scripts to write a new firmware in the MSP430F5659 via USB.
I have firmwares that work without any issue, and other ones that don't. For the ones that don't, the program simply does not start after the flash. After some digging, I noticed that the reset vector (address 0xFFFE) gets corrupted with value 0x0200 instead of the expected 0x0283. I was able to confirm it using Uniflash and exporting the whole memory. See image above showing the difference between the input file and the export from Uniflash.

Every other bytes of the export is an exact match with the input file - only that one 0x00 byte is wrong.
I can flash that exact same program with CCS, as well as MSPFlasher, without any issue (via JTAG though, not USB).
I've provided a zip file containing: (fyi these files do not contain any proprietary information)
- Input_GOOD.txt
- A firmware example (TI-TXT format) that works perfectly fine with BSL-Scripter and the provided example scripts.
- Input_BAD.txt
- A firmware example (TI-TXT format) that causes the issue while using the exact same BSL-Scripter scripts. As mentionned, if flashed via JTAG (CCS or MSPFlasher), it works correctly.
- EXPORT_Input_GOOD.txt
- The exported memory I get from Uniflash directly after flashing Input_GOOD.txt using BSL-Scripter
- EXPORT_Input_BAD.txt
- The exported memory I get from Uniflash directly after flashing Input_BAD.txt using BSL-Scripter
- EXPORT_Input_BAD_Flashed_From_JTAG.txt
- The exported memory I get from Uniflash directly after flashing Input_BAD.txt using JTAG. It is an exact match with the Input_BAD.txt file. The program runs fine after flashing.
- Folder BSL-Scripter
- All the files used by BSL-Scripter (pretty much just the stock 5xx_USB example provided by TI)
Note: Both Input_GOOD and Input_BAD are from the same codebase, just with slighly different parts of code. The difference is not related to flash memory or anything. The codebase do not ever play with flash. Anyway from my understanding the code never runs anyway because the reset vector is wrong.
I tried modifying the Input_BAD firmware file to be one continuous block starting at @8000 up to 'q' (end of firmware) instead of having different sections @8000, @ffc6, etc. It did not solve the issue.
I also tried adding a @10000 section in order to force a new section just after the corrupted reset vector (@fffe), it did not solve the issue either.
Am I missing something obvious? Thanks in advance.
ZIP File:
debug_BSL_Scripter.zip