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 can one write data into internal FLASH on TM4C129 and then protect that data from inadvertent modification?

Hello ALL,

Is there a method to write data into a memory block in internal flash on TM4C129, change the block protection to READ_ONLY, have that protection last through a reset, and then still be able to change the data in that flash block at a later time?

I am familiar with (at least know about) the FlashProgram(), FlashProtectSet() API's.  The API's descriptions seem quite clear that the only way for a block of Flash to retain a READ_ONLY memory access setting through a RESET is to use a FlashProtectSave().  And I understand that the result of this call is that the block of FLASH can NEVER be changed.  I need to modify the block of FLASH with new data at a later time.

Is there a method to accomplish this ?

Even a "NO WAY" will be greatly appreciated,

Randy

  • Randy Bulloch said:
    I need to modify the block of FLASH with new data at a later time.

    While your question provides "necessary" data - it falls short of providing, "sufficient" data.

    Describing your, "When, where, how" (at a later time) you intend to "modify" that Flash block may add that sufficiency...

     

  • Hello Randy

    The first thing to note is how does the micro distinguish between inadvertent and intended modification? That shall set the course for the discussion.

    Regards
    Amit
  • Presumably by unprotecting. Typically in EE or FRAM non-volatile storage there is a sequence to enable writing and another to write protect the contents. In addition there is often an external write protect pin that effectively disables the write enable sequence.

    My question would be what is the range of inadvertent writes you want to protect against, rogue program, noise events, power down while write, unauthorized access etc...

    Robert
  • Hi Amit,

    Pardon my attempt to be brief resulting in too  little info.


    The idea was for an operator to indicate to the program (a physical switch or software command) the only time to change the critical data and to provide some manner of additional protection from "bad" software corrupting the data by making the critical data READ_ONLY, i.e. using FlashProtectSet() API.

    The idea was to protect this "critical" data from corruption from software with bugs overwriting the data.  The realization now is that this data, no matter how critical, is no more important and no more vulnerable than the program itself, both are in flash memory.  Thus the initial idea that making this block of data READ_ONLY using the FlashProtectSet() API to "protect" the data is a trivial improvement (if any) in protecting this data and is not going to be used.  It is considered sufficient that the data is in Flash memory and requires a very specific and unlikely Flash write sequence to corrupt it.

    Thanks for your time,

    Randy

  • Hello Randy

    Exactly. Some level of security needs to be established. One of the ways we have been thinking is to have the flash boot loader at customer installation validate the application image authenticity. Thus the first place of snooping the bus would reveal only encrypted data. The task here would be to keep the decryption key protected in the TM4C.

    Regards
    Amit
  • Hi Robert,
    Thanks for your comments. See my followup posts.
    The discussion here was usually was limited to protection from a "rogue program". It seems they have somewhat changed the requirements and the issue is now easily resolved by just writing into flash from my software program which I can do.
    Randy