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.

MSPM0G3519: MSPM0G3519 Flash and Debug fails with Segger JLink in CCS Theia

Part Number: MSPM0G3519

I'm working on a LaunchPad for the MSPM0G3519 and am trying to migrate away from the on board XDS110 to a Jlink so that I can eventually lower the voltage to 1.8V.

BUT I cannot get CCS to flash the the MSPM0G3519 and get the error:


Trouble Writing Memory Block at 0x7ff0 on Page 0 of Length 0x918: Flash download failed! ...
File Loader: Verification failed: Target failed to write 0x00007FF0

I'm guessing it has to do with the protected memory or something but can't put my finger on it.

I can go back to the onboard XDS110 and  it has no issue flashing and debugging

 

Ryan

  • Hi Ryan,

    Which J-Flash version are you using for programming? I recommend to update to the latest version which will support the full MSPM0 released devices.

    And could you also check whether a correct device (MSPM0G3519) is selected in J-Flash? 

  • J-Flash, I'm using J-Link Commander 8.44 as an alternative but I'm not sure how I know if that is what CCS Theia is using?  

    I can erase and load the image in commander without errors but it cannot do it in CCS Theia without getting the error and failing out. 

    I've tried adjusting the linker .cmd file to protect the boundaries and/or align the flash better?

    here is my current linker:

    -uinterruptVectors
    --stack_size=256

    /* Note: SRAM is partitioned into two separate sections SRAM_BANK0 and SRAM_BANK1
     * to account for SRAM_BANK1 being wiped out upon the device entering any low-power
     * mode stronger than SLEEP. Thus, it is up to the end-user to enable SRAM_BANK1 for
     * applications where the memory is considered lost outside of RUN and SLEEP Modes.
     */

    MEMORY
    {
        FLASH           (RX)  : origin = 0x00000000, length = 0x00080000
        SRAM_BANK0      (RWX) : origin = 0x20200000, length = 0x00010000
        SRAM_BANK1      (RWX) : origin = 0x20210000, length = 0x00010000
        BCR_CONFIG      (R)   : origin = 0x41C00000, length = 0x000000FF
        BSL_CONFIG      (R)   : origin = 0x41C00100, length = 0x00000080
        DATA            (R)   : origin = 0x41D00000, length = 0x00004000
    }

    // SECTIONS
    // {
    //     .intvecs:   > 0x00000000

    //     .text   : { . = align(1024); } > FLASH
    //     .const  : palign(16) {} > FLASH
    //     .const  : palign(16) {} > FLASH
    //     .cinit  : palign(8) {} > FLASH
    //     .pinit  : palign(8) {} > FLASH
    //     .rodata : palign(8) {} > FLASH
    //     .ARM.exidx    : palign(8) {} > FLASH
    //     .init_array   : palign(8) {} > FLASH
    //     .binit        : palign(8) {} > FLASH
    //     .TI.ramfunc   : load = FLASH, palign(8), run=SRAM_BANK0, table(BINIT)

    //     .vtable :   > SRAM_BANK0
    //     // .args   :   > SRAM_BANK0
    //     .data   :   > SRAM_BANK0
    //     .bss    :   > SRAM_BANK0
    //     .sysmem :   > SRAM_BANK0
    //     .TrimTable :  > SRAM_BANK0
    //     .stack  :   > SRAM_BANK0 (HIGH)

    //     // .BCRConfig  : {} > BCR_CONFIG
    //     // .BSLConfig  : {} > BSL_CONFIG
    //     // .DataBank   : {} > DATA
    // }

    SECTIONS
    {
        .intvecs:   > 0x00000000
       
        /* Alignment for J-Link stability */
        .text   : align(1024) {} > FLASH
        .const  : align(1024) {} > FLASH
        .cinit  : align(1024) {} > FLASH
        .rodata : align(1024) {} > FLASH
       
        /* THE MISSING SECTIONS - Add these back! */
        .vtable :   > SRAM_BANK0
        .data   :   > SRAM_BANK0
        .bss    :   > SRAM_BANK0
        .sysmem :   > SRAM_BANK0
        .stack  :   > SRAM_BANK0 (HIGH)
       
        /* Keep these for internal functions */
        .pinit        : palign(8) {} > FLASH
        .init_array   : palign(8) {} > FLASH
        .TI.ramfunc   : load = FLASH, palign(8), run=SRAM_BANK0, table(BINIT)
    }




    and here is my launch.json config file

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "cust_proj_mcu",
                "type": "ccs-debug",
                "request": "launch",
                "targetConfig": "${targetConfigFolder}//MSPM0G3519.ccxml",
                "projectInfo": {
                    "name": "cust_proj_mcu",
                    "resourceId": "/cust_proj_mcu"
                },
                "connections": [
                    {
                        "name": "SEGGER J-Link Emulator",
                        "device": "MSPM0G3519",
                        "interface": "swd",
                        "speed": 1000, // Reduced for 1.8V stability
                        "resetType": "normal",
                        "FlashEraseMode": "Necessary Pages Only",
                        "cores": [
                            {
                                "name": "CORTEX_M0P",
                                "debuggerSettings": {
                                    "data": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n<PropertyValues>\n  <property id=\"FlashEraseMode\">\n    <curValue>Necessary Pages Only</curValue>\n  </property>\n  <property id=\"FlashDownloadDefaultSpeed\">\n    <curValue>500</curValue>\n  </property>\n</PropertyValues>\n"
                                }
                            }
                        ]
                    }
                ]
            },
            {
                "name": "MSPM0G3519.ccxml",
                "type": "ccs-debug",
                "request": "launch",
                "targetConfig": "${targetConfigFolder}\\MSPM0G3519.ccxml",
                "connections": [
                    {
                        "name": "SEGGER J-Link Emulator",
                        "cores": [
                            {
                                "name": "CORTEX_M0P",
                                "debuggerSettings": {
                                    "data": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n<PropertyValues>\n\n  <property id=\"ResetOnRestart\">\n    <curValue>1</curValue>\n  </property>\n\n</PropertyValues>\n"
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    }
  • Hi Ryan,

    I also tried with CCS20.1.1 version for J-Link debugging with MSPM0G3519, and it works fine from my side.

    I think the only modification you need to make for a SDK example is to change the Connection setting as below, and the linker file does not need modification.