MSPM0G5187: J-Link Programming Questions

Part Number: MSPM0G5187
Other Parts Discussed in Thread: UNIFLASH, MSPM0G3507, SEGGER

Hi Team,

Our customer is using the LP-MSPM0G5187 and programming it via J-Link. When using the UniFlash tool (with the SDK GPIO toggle example), the programming completes and the hardware works fine. However, there are some errors in the log. Could you help check if these errors will affect the device's functionality?

Below is the logs.

(2025/12/19 EF6:26:30] [INFO| CORTEX_MOP: GEL Output: Memory Map Initialization Complete (2025/12/19 F6:26:31] [INFO] Executing Reset: Board Reset
(2025/12/19 L 6:26:31] [INFO] CORTEX MOP: GEL Output: Memory Map Initialization Complete [2025/12/19 |47:01:56] [INFO] CORTEX_MOP: GEL Output: Memory Map Initialization Complete
/2025/12/19 77:02:06] (ERROR) CORTEX_MOP: Trouble Writing Register PC: Verification of RAMCode failed @ address 0x20200000. Write: 0xA801BE00 F0009900 Read: 0x0A310A2F 0A2COA29 Failed to prepare for programming Filed te download
RAMCode Timeout while calculating CRC, RAMCode did not respond in time (PC = 0x0000040C, XPSR = 0x1000000, SP = 0x20208000)!
[2025/12/19 - 4-7:02:06] [SUCCESS] Program Load completed successfully.

  • Sorry Team, Let me correct that the customer is use MSPM0G3507

    B.R.

    Eason

  • Hi Eason,

    Can you try performing a mass erase on the MCU using UNIFLASH and rebuilding the image to see if that fixes the error?

    Best Regards,
    Brian

  • Hi Brain,

    It is confirmed that after I first use XDS to perform a mass erase on the 3507, and then use J-Link to program the device, the ERROR no longer occurs.


    However, when I use the J-Link programmer, I noticed that on the “Settings & Utilities” page in UniFlash, no functions are available.


    Does this mean that when using J-Link, it is not possible to perform reset or erase operations through UniFlash, and that only programming and verification are supported?

    Best regards,

    Mike

  • Hi Mike,

    Does this mean that when using J-Link, it is not possible to perform reset or erase operations through UniFlash, and that only programming and verification are supported?

    This is correct for Uniflash. However, it is possible to write scripts with the J-Link that perform the same functions.

    Best Regards,
    Brian

  • Hi Brian,

    I would like to ask how to use a J-Link script to perform erase and reset operations. Thank you.

    Best regards,

    Mike

  • Hi Mike,

    The following includes how to perform a factory reset: [FAQ] MSPM0C1104: How to do factory reset with J-Link.

    I will reach out to another team member for more information regarding a script for mass erase.

    Best Regards,
    Brian

  • Hi Mike,

    You can use Segger's J-Flash software to perform a mass erase on the device. The J-Flash User guide has more information on how to perform this erase, and other capabilities of the software.

    Best Regards,
    Brian

  • Hi Brian,

    I am currently using J-Link Commander V8.96 to perform an erase operation, but I encounter the following error:

    "Failed to erase sectors 0 @ address 0x41C00000 ((sector is locked)) Failed to erase sectors."

    Please refer to the logs for more detailed information.

    SEGGER J-Link Commander V8.96 (Compiled Dec 18 2025 16:52:18)
    DLL version V8.96, compiled Dec 18 2025 16:51:21
    
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V9 compiled Dec  8 2023 20:16:22
    Hardware version: V9.70
    J-Link uptime (since boot): N/A (Not supported by this model)
    S/N: 602718599
    License(s): GDB, RDI, FlashBP, FlashDL, JFlash
    VTref=3.275V
    
    
    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. <Default>: MSPM0G3507
    Type '?' for selection dialog
    Device>
    Please specify target interface:
      J) JTAG (Default)
      S) SWD
      T) cJTAG
    TIF>S
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>
    Device "MSPM0G3507" selected.
    
    
    Connecting to target via SWD
    InitTarget() start
    DAP initialized successfully.
    Setting up LPM debug bits
    PWR_AP_DPREC0v: 0x0079002F
    InitTarget() end - Took 2.51ms
    Found SW-DP with ID 0x6BA02477
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[0]: Stopped AP scan as end of AP map seems to be reached
    Iterating through AP map to find AHB-AP to use
    Attach to CPU failed. Executing connect under reset.
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[0]: Stopped AP scan as end of AP map has been reached
    Iterating through AP map to find AHB-AP to use
    Could not find core in Coresight setup
    InitTarget() start
    DAP initialized successfully.
    Setting up LPM debug bits
    PWR_AP_DPREC0v: 0x0079002F
    InitTarget() end - Took 3.25ms
    Found SW-DP with ID 0x6BA02477
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[5]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x84770001, ADDR: 0x00000000)
    AP[1]: MEM-AP (IDR: 0x002E0001, ADDR: 0x01000000)
    AP[2]: JTAG-AP (IDR: 0x002E0000, ADDR: 0x02000000)
    AP[3]: MEM-AP (IDR: 0x002E0003, ADDR: 0x03000000)
    AP[4]: MEM-AP (IDR: 0x002E0002, ADDR: 0x04000000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xF0000000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ F0000000
    [0][0]: E00FF000 CID B105100D PID 000BB4C0 ROM Table
    ROMTbl[1] @ E00FF000
    [1][0]: E000E000 CID B105E00D PID 000BB008 SCS
    [1][1]: E0001000 CID B105E00D PID 000BB00A DWT
    [1][2]: E0002000 CID B105E00D PID 000BB00B FPB
    [0][2]: 40402000 CID B105900D PID 001BB932 MTB-M0+
    Memory zones:
      Zone: "Default" Description: Default access mode
    Cortex-M0 identified.
    J-Link>Reset
    Reset delay: 0 ms
    ResetTarget() start
    DAP initialized successfully.
    ResetTarget() end - Took 4.16ms
    Device specific reset executed.
    J-Link>erase
    No address range specified, 'Erase Chip' will be executed
    'erase': Performing implicit reset & halt of MCU.
    ResetTarget() start
    DAP initialized successfully.
    ResetTarget() end - Took 3.95ms
    Device specific reset executed.
    Erasing device...
    J-Link: Flash download: Total time needed: 0.108s (Prepare: 0.055s, Compare: 0.000s, Erase: 0.026s, Program: 0.000s, Verify: 0.000s, Restore: 0.026s)
    
    ****** Error: Failed to erase sectors 0 @ address 0x41C00000 ((sector is locked))
    Failed to erase sectors.
    
    J-Link: Flash download: Total time needed: 0.068s (Prepare: 0.038s, Compare: 0.000s, Erase: 0.014s, Program: 0.000s, Verify: 0.000s, Restore: 0.015s)
    Erasing done.
    J-Link>
    

    Could you give me some advice?

    Thank you.

    Best regards,

    Mike

  • Hi Mike,

    This sector is where nonmain memory is located and should not be erased without being programmed before a reset. Erasing nonmain without reprogramming before a reset will result in the device becoming permanently locked.

    From what I can find in the J-Link Commander documentation, the "Exec" command with "map reset" command string should restore access to all memory locations.

    Best Regards,
    Brian

  • Hi Brian,

    I think I can now successfully use J-Link to program and erase the LP-MSPM03507.

    C:\Users\user\Desktop\Mike\3507_flash>flasher.bat C:\Users\user\Desktop\Mike\gpio_toggle_output_LP_MSPM0G3507_nortos_ticlang.out
    SEGGER J-Link Commander V8.96 (Compiled Dec 18 2025 16:52:18)
    DLL version V8.96, compiled Dec 18 2025 16:51:21
    
    
    J-Link Command File read successfully.
    Processing script file...
    J-Link>Erase 0x0 0x1FFF8
    J-Link connection not established yet but required for command.
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V9 compiled Dec  8 2023 20:16:22
    Hardware version: V9.70
    J-Link uptime (since boot): N/A (Not supported by this model)
    S/N: 602718599
    License(s): GDB, RDI, FlashBP, FlashDL, JFlash
    VTref=3.261V
    Target connection not established yet but required for command.
    Device "MSPM0G3507" selected.
    
    
    Connecting to target via SWD
    InitTarget() start
    DAP initialized successfully.
    Setting up LPM debug bits
    PWR_AP_DPREC0v: 0x0019002F
    InitTarget() end - Took 3.71ms
    Found SW-DP with ID 0x6BA02477
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[5]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x84770001, ADDR: 0x00000000)
    AP[1]: MEM-AP (IDR: 0x002E0001, ADDR: 0x01000000)
    AP[2]: JTAG-AP (IDR: 0x002E0000, ADDR: 0x02000000)
    AP[3]: MEM-AP (IDR: 0x002E0003, ADDR: 0x03000000)
    AP[4]: MEM-AP (IDR: 0x002E0002, ADDR: 0x04000000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xF0000000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ F0000000
    [0][0]: E00FF000 CID B105100D PID 000BB4C0 ROM Table
    ROMTbl[1] @ E00FF000
    [1][0]: E000E000 CID B105E00D PID 000BB008 SCS
    [1][1]: E0001000 CID B105E00D PID 000BB00A DWT
    [1][2]: E0002000 CID B105E00D PID 000BB00B FPB
    [0][2]: 40402000 CID B105900D PID 001BB932 MTB-M0+
    Memory zones:
      Zone: "Default" Description: Default access mode
    Cortex-M0 identified.
    'erase': Performing implicit reset & halt of MCU.
    ResetTarget() start
    DAP initialized successfully.
    ResetTarget() end - Took 2.86ms
    Device specific reset executed.
    Erasing selected range...
    J-Link: Flash download: Total time needed: 0.144s (Prepare: 0.053s, Compare: 0.000s, Erase: 0.065s, Program: 0.000s, Verify: 0.000s, Restore: 0.025s)
    J-Link: Flash download:
    Flash sectors within Range [0x00000000 - 0x0001FFF8] deleted.
    Erasing done.
    J-Link>LoadFile "C:\Users\user\Desktop\Mike\gpio_toggle_output_LP_MSPM0G3507_nortos_ticlang.out"
    'loadfile': Performing implicit reset & halt of MCU.
    ResetTarget() start
    DAP initialized successfully.
    ResetTarget() end - Took 4.27ms
    Device specific reset executed.
    Downloading file [C:\Users\user\Desktop\Mike\gpio_toggle_output_LP_MSPM0G3507_nortos_ticlang.out]...
    J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (1024 bytes)
    J-Link: Flash download: Total: 0.168s (Prepare: 0.072s, Compare: 0.041s, Erase: 0.000s, Program & Verify: 0.012s, Restore: 0.042s)
    J-Link: Flash download: Program & Verify speed: 83 KB/s
    O.K.
    J-Link>r
    Reset delay: 0 ms
    ResetTarget() start
    DAP initialized successfully.
    ResetTarget() end - Took 3.42ms
    Device specific reset executed.
    J-Link>g
    Memory map 'after startup completion point' is active
    J-Link>exit
    
    Script processing completed.
    
    OnDisconnectTarget() start
    OnDisconnectTarget() end - Took 615us
    C:\Users\user\Desktop\Mike\3507_flash>

    Thank you very much for your help.

    Mike