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.

LP-MSPM0G3507: failed to upload the secondary bootloader, non-main contents error

Part Number: LP-MSPM0G3507
Other Parts Discussed in Thread: MSPM0G3507, UNIFLASH,

Tool/software:

Hi

We have experienced an issue with loading the secondary bootloader on the DSP(M0G3507) via Launchpad debugger. The secondary bootloader project was imported from mspm0_sdk_2_02_00_0X.(secondary_bsl_uart_LP_MSPM0G3507_nortos_ticlang).  it seems like the secondary bootloader intended to get access to and modify non-MAIN memory section for BCR and BSL data configuration. Please find the attached.

We failed to load secondary bootloader due to error says 'non-main contents corrupted.'  When we tried to use Uniflash software program to upload the secondary bootloader (.hex file), the chip will be permanently locked. I believed that something weird happened in the non-main memory area.

  • Hi, 

    A nonmain erase must follow a nonmain wirte.

    Maybe some of your operations caused M0 to lock.

    Try unlock MSPM0 using the file in this threads:

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1332187/mspm0g3507-the-mcu-flash-is-locked-how-can-i-unlock-it/5073874?tisearch=e2e-sitesearch&keymatch=unlock%252525252520MSPM0#5073874

    If this can not solve your problem,

    please try to change a MSPM0 that on your LaunchPad.

    Regards,

    Helic

  • I did unlock the device by doing factory reset. But I still could not load the secondary bsl into the device (M0G3507) after that. It is a demo example, and it should have a proper non-main write. I kept getting errors like "non-main contents corrupted" or "(Error -1001 @ 0x0) Requested operation is not supported on this device. (Emulation package 20.0.0.3178)"

    Are there any modifications required in the secondary_bsl _uart demo example in order to load it on the device? 

    Or some changes must be made in the secondary_bsl.syscfg (nonmain configuration module ) 

  • Hi, 

    After import the project, please also change this setting:

    Regards,

    Helic

  • I am pretty sure I made this change, and the error code message I received was nothing to do with.

  • Hi, 

    If Factory reset can not recovery MSPM0, and error shows that NON-main has already been erased. This MSPM0 will never be programmed.

    Regards,

    Helic

  • Please see the attached, A specific error was generated when I tried to use debugger to load the secondary bootloader into the LP-MSPM0G3507 device 

    I have no problem with loading other apps into the device. Non-main section has not been erased. 

  • Hi, 

    I have no problem with loading other apps into the device.

    Thank you for adding this information.

    Also, factory reset is working at your side. And MSPM0 is not permanently locked.

    CORTEX_M0P: GEL Output: Memory Map Initialization Complete
    CORTEX_M0P: File Loader: Memory write failed: Flash loader exited with flash error.
    CORTEX_M0P: GEL: File: C:\Users\a0508911\workspace_v12_2020000\secondary_bsl_uart_LP_MSPM0G3507_nortos_ticlang\Debug\secondary_bsl_uart_LP_MSPM0G3507_nortos_ticlang.out: Load failed.
    CORTEX_M0P: NONMAIN contents corrupted, restoring to default
    CORTEX_M0P: NON-MAIN contents restored correctly but MAIN flash was erased. Fix NON-MAIN contents before re-programming.

    I got this error message from my side.

    Don't warry, this is normal.

    I have confirm that although error is printed in CCS, but secondary BSL has already load into MSPM0's Flash. (First load after a factory reset).

    I am using Uniflash to read the MSPM0 Flash 0x1041.

    Sorry for the previous mistake.

    You can confirm this by yourself.

    -------------------

    Also, for the previous SWD error is normal when load secondary bsl code to MSPM0:

    CORTEX_M0P: Error: (Error -614 @ 0x0) The target indicates there is an error condition from a previous SWD  request. Clear the error the condition, and try the SWD request again. (Emulation package 20.0.0.3178) 
    CORTEX_M0P: Trouble Halting Target CPU: (Error -2064 @ 0x0) Unable to read device status. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 20.0.0.3178) 
    CORTEX_M0P: Unable to determine target status after 20 attempts
    CORTEX_M0P: Failed to remove the debug state from the target before disconnecting.  There may still be breakpoint op-codes embedded in program memory.  It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

    This is caused by SWD interface. It's normal that after Flash secondary BSL.

    If you want to update the BSL, it's better to run a factory reset before download the secondary BSL.

    Regards,

    Helic

**Attention** This is a public forum