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.

How to create unerasable data in the flash page in Tiva C?

Hi, I used the following code to create write/erase protected data in flash page with adress 0x60000.

But after reprogramming chip this data has been erased. How to create erase/write protect for flash page in Tiva C?

static uint8_t hwRevWrCmd (char* cmdBuffer)
{
uint8_t hwRev[HW_REV_MSG_LEN] = "1.0.0"; // Write your HW revision
uint32_t tmp;

FlashErase(HW_REV_FLASH_ADRESS);

FlashProgram((uint32_t*)hwRev, HW_REV_FLASH_ADRESS, HW_REV_MSG_LEN);

FlashProtectSet(HW_REV_FLASH_ADRESS, FlashReadOnly);

FlashUserSave();

return CONSOLEPROCESS_STATE_INPUTCMD;
}

  • Hello Timofey,

    Judging by your other post (e2e.ti.com/.../1872441, it would appear as though you have figured out how to protect the flash from being erased? Let me know if you still need help on this aspect of the protection. We will continue to work on the other post until we can resolve the issue noted there.

    On a side note, please note that the flash memory protection registers rely on the content being updated during the reset process. i.e., there is a small amount of time during reset where the flash will not be protected until the HW can load the values that have been committed for the Flash Memory Protection Registers. In regular use, this should not cause any issues but in case this mechanism is used for key storage in a secure application, this small time where they are unprotected should be considered/evaluated in regard to overall system security.