Other Parts Discussed in Thread: UNIFLASH
Tool/software:
I'm working on a carrier board with a TI AM62-based SoM and a MSPM0G3507 MCU. Using the example project bsl_host_mcu_to_mspm0g1x0x_g3x0x_target_i2c (SDK 2.04.00.06) as a guide, I developed a "BSL host" program to run on the SoM that updates the application firmware on the MCU via I2C BSL. Accordingly, two GPIO lines from the SoM are connected to NRST and PA18 (default BSL_INVOKE) on the MCU respectively, and an I2C bus on the SoM is connected to the MCU's I2C0. The desired MCU firmware image was built in Code Composer Studio v20.1.1 using the TI Clang v4.0.2.LTS toolchain; the Arm hex utility was configured to generate an object file in TI-TXT format, and I used the MSPM0_BSL_GUI utility to convert the latter to a header file for inclusion in the host program.
The host program does the following:
- Invokes BSL via GPIO
- Opens the I2C interface and sends the 'Connection' command
- Sends the 'Unlock Bootloader' command with default password to allow execution of protected commands
- Sends the 'Mass Erase' command to erase the MCU's MAIN flash memory
- Writes the new application to the MCU using multiple 'Program Data' commands
- Sends the 'Start Application' command
When executed, the program runs to completion without errors. However, the MCU does not appear to be executing the updated image: its power consumption is lower than expected, and it does not respond to unrelated (non-BSL) commands sent from the SoM over a separate UART channel.
I'm confident that the program is sending commands and handling responses properly. While debugging, I received "BSL locked" errors upon sending a protected command if it had been too long since 'Unlock Bootloader' had been sent, and "invalid address or length alignment" errors when attempting to write the firmware application before realizing that the target address and data length had to be 8-byte aligned.
Subsequently, when I connected an XDS110 debug probe to the MCU and attempted to load the firmware application using the CCS debugger, I received the following error:
Error connecting to the target: Connection to MSPM0 core failed. Possible root causes: 1) Debug access within NONMAIN was disabled or enabled with password. 2) Peripheral mis-configuration (e.g improper watchdog or clock). To see a more detailed diagnostic of the issue, please press the 'Read boot diagnostic' button.
After investigating what to do, I launched the MSPM0_Factory_Reset_Tool and executed a Mass Erase operation; I was then able to successfully load and execute the firmware application. Note that the file loaded by the debugger had been used to generate the corresponding .txt file which in turn was converted to the header file included in the host program.
Any thoughts about what might be wrong? Thanks.