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.

MSPM0L1228: How to erase flash 8 bytes at a time?

Part Number: MSPM0L1228


Tool/software:

Hi,

I try to erase 8 bytes of flash at a time, but the result is that one sector (1024 bytes) is erased.

Is there anything wrong with the code?

bool FLS_EraseOneWord(const uint32_t addr)
{
    bool flashStat;

    DL_FlashCTL_executeClearStatus(FLASHCTL);

    DL_FlashCTL_unprotectSector(FLASHCTL, addr, DL_FLASHCTL_REGION_SELECT_MAIN);

    DL_FlashCTL_eraseMemory(FLASHCTL, addr, DL_FLASHCTL_COMMAND_SIZE_ONE_WORD);

    flashStat = DL_FlashCTL_waitForCmdDone(FLASHCTL);

    return flashStat;
}
Best Regards!