MSPM0G3519: Uniflash showing : multiple files load fail

Part Number: MSPM0G3519
Other Parts Discussed in Thread: UNIFLASH, , SYSCONFIG

Hi TI

Screenshot 2026-05-20 225329.png

Console showing Error as:  [ERROR] CORTEX_M0P: File Loader: Memory write failed: Flash Programmer: Invalid sector erase address! 

But after i click on the cross mask of the Error box, the code flashes properly, but shows the above error. What may be the cause?

I am trying to upload bootloader at address 0x00000000 and the application at 0x00018000 .

 

  • Hello Prajesh,

    I'm unsure, but there are a few things to check.   First, please make sure the images do not over lap. Second, Check the settings tab in Uniflash. Scroll down a little and there should be an erase settings menu there.  Check it's configuration will work for what you are trying to load.  

    Finally, in the edge of your image I see 2 Binarys are one that is not listed as a binary and set to Auto for starting address.  I've never tried mixing image types, so unsure if Uniflash likes this or not.  

    Thanks,

    JD 

  • Thanks JD

    I am facing one more issue. i.e 

    i am using the factory_reset.bat file script to factory reset the board mspm0g3519

    But when i flash secure firmware, this script is not working, and when i flash normal firmware without secure, this script works, and the board is getting a factory reset.

    Also, if i use the Uniflash GUI tool and do a Factory reset auto, it works for secure firmware and non-secure firmware, able to factory reset properly 

    What changes i have to do in the script so it works for secure firmware?

    i am getting this after running .bat file


    DSLite version 20.4.0.3924
    Configuring Debugger (may take a few minutes on first launch)...
    Initializing Register Database...
    Initializing: CS_DAP_0
    Executing Startup Scripts: CS_DAP_0
    Initializing: CORTEX_M0P
    Executing Startup Scripts: CORTEX_M0P
    Initializing: SEC_AP
    Executing Startup Scripts: SEC_AP
    Connecting...
    error: CORTEX_M0P: 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.
    Failed: Operation was aborted on 'CORTEX_M0P'

    =========================================================================
    Factory Reset FAILED! (exit code: 1)
    =========================================================================

    An error occurred during the factory reset. See output above for details.

    Press any key to continue . . .

    @echo off
    setlocal
    
    REM =========================================================================
    REM Factory Reset Script for MSPM0G3519
    REM =========================================================================
    REM This script performs a factory reset on the MSPM0G3519 device using
    REM TI UniFlash DSLite command line tool.
    REM
    REM Usage: factory_reset_MSPM0G3519.bat [-y]
    REM   -y  Skip user confirmation prompts (for automated test systems)
    REM =========================================================================
    
    REM Parse arguments
    set AUTO_YES=0
    if /i "%~1"=="-y" set AUTO_YES=1
    
    echo =========================================================================
    echo MSPM0G3519 Factory Reset Script
    echo =========================================================================
    echo.
    echo This script will perform a factory reset on your MSPM0G3519 device.
    echo.
    echo WARNING: This will erase all flash memory and restore factory settings!
    echo          All application code and data will be permanently lost!
    echo.
    
    if "%AUTO_YES%"=="0" (
        echo Press Ctrl+C to cancel, or
        pause
    )
    
    REM Path to this batch script
    set SCRIPT_PATH=%~dp0
    
    REM Path to DSLite executable
    set DSLITE_EXE=%SCRIPT_PATH%ccs_base\DebugServer\bin\DSLite.exe
    
    REM Path to configuration file
    set CCXML_CONFIG=%SCRIPT_PATH%user_files\configs\MSPM0G3519.ccxml
    
    REM Check if DSLite executable exists
    if not exist "%DSLITE_EXE%" (
        echo ERROR: DSLite executable not found at:
        echo %DSLITE_EXE%
        echo.
        echo Please ensure UniFlash is properly installed.
        if "%AUTO_YES%"=="0" pause
        exit /b 1
    )
    
    REM Check if configuration file exists
    if not exist "%CCXML_CONFIG%" (
        echo ERROR: Configuration file not found at:
        echo %CCXML_CONFIG%
        echo.
        echo Please ensure the MSPM0G3519.ccxml file exists.
        if "%AUTO_YES%"=="0" pause
        exit /b 1
    )
    
    echo.
    echo Step 1: Connecting to device...
    echo.
    
    REM Perform Automatic Factory Reset
    echo Executing Automatic Factory Reset...
    echo Command: "%DSLITE_EXE%" flash --config="%CCXML_CONFIG%" --post-flash-device-cmd=AutomaticFactoryReset -e
    echo.
    
    "%DSLITE_EXE%" flash --config="%CCXML_CONFIG%" --post-flash-device-cmd=AutomaticFactoryReset -e
    set DSLITE_EXIT=%ERRORLEVEL%
    
    echo.
    if %DSLITE_EXIT% neq 0 (
        echo =========================================================================
        echo Factory Reset FAILED! ^(exit code: %DSLITE_EXIT%^)
        echo =========================================================================
        echo.
        echo An error occurred during the factory reset. See output above for details.
        echo.
        if "%AUTO_YES%"=="0" pause
        exit /b %DSLITE_EXIT%
    ) else (
        echo =========================================================================
        echo Factory Reset Completed Successfully!
        echo =========================================================================
        echo.
        echo The MSPM0G3519 device has been reset to factory defaults.
        echo All flash memory has been erased.
        echo.
        if "%AUTO_YES%"=="0" pause
        exit /b 0
    )

  • Hey Prajesh,

    For secure firmware, what kind of security settings are you applying?  Are you disabling Debug?  Are you Disabling Factory Resets?  

    Are you sure factory reset from Uniflash is actually working?  Have you tried re-programming or connecting to a secure device that you then factory reset?  

    I'm only asking because in CCS/Uniflash, Factory reset commands don't actually give failure messages.  Factory reset is a DSSM command, so what happens is the programmer writes the DSSM command into the JTAG mailbox and resets the device.  The device then reads this command, and either factory resets or not.  There is no hand shaking back to the programmer, so in Uniflash it usually says "factory reset complete" because it issued the command and reset, but it doesn't actually know if it worked or not.  That doesn't happen until you try and re-connect.  

    The script looks to be trying to connect after the factory reset command and it seems like it's not working and that is why it's giving you a "Factory reset failed" command.  

    Thanks,

    JD

  • Hi,

    Thanks for the explanation — that makes sense regarding DSSM-based factory reset behavior.

    To answer your questions:

    • Yes, the secure firmware configuration is enabling security features, but debug is not fully disabled.
    • Factory reset is enabled in the security settings (as per SysConfig / NONMAIN configuration).
    • I am using UniFlash CLI (DSLite) with AutomaticFactoryReset command.

    From my testing:

    • When the device is already in a non-secure / factory state, the factory reset flow completes successfully.
    • After programming secure firmware, the CLI fails during Cortex_M0P connection stage before the factory reset command is actually executed.
    • GUI UniFlash is able to perform factory reset successfully in the same state.

    I understand your point that DSSM command has no direct handshake and UniFlash only reports command submission success. However, in my case, the CLI is failing even before reaching the DSSM execution stage (it fails at Cortex attach).

    So the issue seems to be:

    • CLI flow failing during debug connection initialization (Cortex_M0P stage)
    • while GUI is able to use an alternate SEC_AP-based flow to trigger factory reset

    Please let me know if there is any recommended CLI-only method for forcing SEC_AP-based factory reset flow.

  • Hi JD, any Suggestions base on my above replay.

  • HI TI, any update on the above conversation?

  • Hey Prajesh, 

    Very sorry for the delay here.  Thanks for the additional information.  

    It sounds like Uniflash GUI is following the correct flow, where as somehow the CLI is not?  If device is locked like in your case, then Cortex_M0P is always going to fail until we issue the factory reset and toggle the reset line. 

    The correct process is generally to pull the device into reset state, Connecting to just the SEC-AP, issuing the Factory reset command into the DSSM mailbox, and finally release the reset so the DSSM command is processed.  I assume this is the exact flow that Uniflash GUI is doing.  

    Can you point me to the batch file you are using?  Is there a Uniflash version number?  

    It's a bit different, but it helps show the flow:  Here are some JLink Factory reset scripts at the bottom of this E2E:  MSPM0L1305: DSSM commands to Factory reset without XDS110 

    Thanks,

    JD

  • Thank you for the explanation.

    Please find below the command used by our batch file:

    "%DSLITE_EXE%" flash --config="%CCXML_CONFIG%" --post-flash-device-cmd=AutomaticFactoryReset -e
    

    The attached batch file simply invokes DSLite with the AutomaticFactoryReset post-flash command and relies on DSLite to perform the factory reset sequence.

    The UniFlash version being used is . Version: 9.4.0.5534

    The bat file:

    factory_reset_MSPM0G3519.zip