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.

MSPM0L1117: Flash Memory Reading, Control Reset Issue

Part Number: MSPM0L1117
Other Parts Discussed in Thread: UNIFLASH,

Tool/software:

HI,

When I read program memory data from my reserved locations, microcontroller resets if data is 0X00000000. For non zero, it reads correctly but when data is zero, it resets immediately.

I am using (*((volatile uint32_t *)(memoryAddress))) to read data as given below from the reserved memory 0X1F000 to 0X1FFFF. I am reading 32 bit data at a time.

*readData = (*((volatile uint32_t *)(memoryAddress)))

Please let us know how to read memory data.

This is urgent and I kindly request you to provide solution as early as possible.

Regards,

Harshal Pawar

  • Hi Harshal,

    Can you elaborate on how you reserved the memory location? Do you have hardware ECC enabled?

    Also, when you read a zero, are you able to debug what is causing the reset? I suspect there are some ECC errors at hand; it is recommended to write 64bits at a time so the 8bit ECC is generated simultaneously and completely; depending on how you are writing the flash words, when you read 32bits, I think it might be checking against the full 8bit ECC and causing issue. You can read more about these nuances on Page 497 of the TRM.

    Can you try DL_FlashCTL_readVerify32() on the address where 0 is stored?

    Best,

    Sam

  • Hi Sam,

    Its working now. I was using flash write without ECC generation which was triggering the ECC error resetting it. Now I am

    using DL_FlashCTL_programMemory64WithECCGenerated to write and this resolved my issue.

    Need one more input. I am using below code to erase the sector 1KB, could you please confirm it is ok or not? nvmAdr is sector aligned memory address in below code.

    // Clear any previous flash error flags
    DL_FlashCTL_executeClearStatus(FLASHCTL);

    // Unprotect the sector/page before erase
    DL_FlashCTL_unprotectSector(
    FLASHCTL,
    nvmAdr,
    DL_FLASHCTL_REGION_SELECT_MAIN
    );

    // Call the low-level erase function
    DL_FlashCTL_eraseMemory(
    FLASHCTL,
    nvmAdr,
    DL_FLASHCTL_COMMAND_SIZE_SECTOR // 1KB erase
    );

    Thank you for your support. Appreciate your help.

    Harshal Pawar

  • Glad to hear you got it working! And yes, that erasing looks good. Let us know if you have any other questions.

    Best,

    Sam

  • I am not creating another ticket for this but continuing this discussion.

    I want to protect code from reading it using programmer and I want to use the PASSWORD protection for this where I can use 16 byte as a password to access the memory.

    I could do it but the issue is J-LINK can't be used further once I program the board. Can you please let us know if there is any support for this or not?

    Later I used XDS110 debugger, LAUNCHPAD part to connect my port using SWD. It didnt pop-up password window where I can enter the password to read write the device. Used UniFlash utility for this. I could erase the device MAIN and NON Main memory to use it normally so that I can use J-Link.

    Another mismatch is when I connected XDS110 to UniFlash, it forces us to upgrade the firmware inside Launchpad. Due to this I couldnt use it on IAR WORKBENCH as IAR might have old driver for XDS. 

    This created dead lock condition. Good luck is erased part could be used again with J-Link with IAR.

    So I kindly request you to suggest the proper way of using tools and achieving PASSWORD protection for the device MSPM0L1117.

    Thank you  in advance.

    Harshal Pawar