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.

MSPM0G3507: MSPM0G3507 Bootloader Problem of Flash write

Part Number: MSPM0G3507

Tool/software:

"I'm developing a bootloader that receives data from a host PC via UART. This data is a binary file that I'm writing to the microcontroller's flash memory, starting at address 0xD00. Once the write operation is complete, the bootloader should jump to this address to execute the program.

However, I'm encountering an issue where the microcontroller enters a default handler with exception 10 after the entire binary file is written. Upon inspecting the memory at address 0xD00, I've noticed some bits are corrupted.

Interestingly, when I program the same binary file using CCS and instruct it to erase only the 0xD00 address, the program executes correctly.

I'm seeking assistance to identify and resolve the root cause of this flash corruption issue."

  • Hi,

    I am not clear about your issue. Is your boot code starts at 0xD00 or your application code start at 0xD00. And this flash corruption issue is happens on the boot code or the application code?

    There is BSL demo code in the SDK. Have you followed that example first?

    Best regards,

    Cash Hao

  • My boot code starts with 0x000 and another application code starts from 0xD00. I have refered to the bsl code but in out hardware we are exposing UART only. Earlier we have used tm4C129 boards and the same way we are trying to flash the bin file from 0xD00 address we are using the following to flash.

    DL_FlashCTL_unprotectSector(
    FLASHCTL, write_start_addr, DL_FLASHCTL_REGION_SELECT_MAIN);

    DL_FlashCTL_programMemoryFromRAM(FLASHCTL,write_start_addr,(uint32_t *) src,2,DL_FLASHCTL_REGION_SELECT_MAIN);

    Are you suggesting to put bsl bsl_host_mcu_to_mspm0g1x0x_g3x0x_target_uart code.

    Our requirement is a bootloader code that is polling for uart for 30 seconds if on uart it is receiving the data then flash the bin file from 0xD00 and after 30 second it reads the address 0x00D and again if data is valid on 0x00D then boot from that location. 

  • Hi,

    I am referring to secondary_bsl_uart this kind of example code. The MSPM0 device is served as BSL slave. 

    DL_FlashCTL_programMemoryFromRAM

    You need to call the API with ECC generated. 

    Best regards,

    Cash Hao

  • Issue resolved when I use DL_FlashCTL_programMemoryFromRAM64WithECCGenerated.

    Should I disable the cache also or it is not required?

  • Hi,

    I do not think disable is required here. 

    Best regards,

    Cash Hao