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 Custom Bootloader

Part Number: MSPM0G3519

Hi,

I am developing a custom bootloader on the MSPM0G3519. I created two separate projects:

  1. Bootloader Project
  2. Application Project

To separate bootloader and application memory, I modified the flash regions in device_linker.cmd (.cmd) for both projects.

After changing the flash size/origin, the projects are no longer working in debug mode, and I am unable to flash/program the device.

Below are my linker memory configurations.

//Boot memory section

MEMORY
{
    FLASH           (RX)  : origin = 0x00000000, length = 0x0008000
    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   : palign(8) {} > FLASH
    .const  : palign(8) {} > 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
}
//App memory section

MEMORY
{
    FLASH           (RX)  : origin = 0x00008000, length = 0x00078000
    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:   > 0x000008000
    .text   : palign(8) {} > FLASH
    .const  : palign(8) {} > 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
}

  • Hi,

    After changing the flash size/origin, the projects are no longer working in debug mode, and I am unable to flash/program the device.

    Are you setting proper flash erase property for each project? I suggest below for these two projects:

    Or you can assign the erase address for each projects. If this is not set properly, when you load app project, it will erase boot project and then it happens with issues.

    After changing the flash size/origin, the projects are no longer working in debug mode, and I am unable to flash/program the device.

    Additionally, if you program boot project only, and when it runs and jumps to app project, and then non-exist app address will result MCU into hardfault state and might not connect anymore.

    To quickly recover, you can refer to below two methods:

    1. Force MCU to Enter BSL Mode

    2. Factory Reset

    You can refer to the documents:https://www.ti.com/jp/lit/ug/slaaeo4/slaaeo4.pdf 

    B.R.

    Sal

**Attention** This is a public forum