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.

MSP432P401R: Use FLASH as EEPROM for user settings - Is there a dedicated user segment - similar to msp30?

Part Number: MSP432P401R


Hi,

I need to store user setting data on the msp432 flash during run time instead of an EEPROM.

The msp430 platform flash has dedicated segments (A through D) where user data can be stored without running the risk of corrupting main memory.

But going throught the msp432 datasheets as well as the example codes and ti forums could not find any safe bank / segment, which would not risk corrupting main program/code memory.

The examples use main flash area to store user data. Not sure how to decide i should position my data.

Regards & thanks in advance

sohrab

  • The information memory in bank1 is the TI BSL.  If this is not needed, then you could erase the BSL and use this memory for the storage of user setting data.  You could also get creative and reuse the Flash boot-override mailbox ( Information memory Bank 0, Sector 0) but you need to make sure that the first couple of bytes indicate that there is no pending message in the mailbox, so that the boot code does not try to access and/or apply the information in the mailbox location.

    Regards,

    Chris

  • Hi Chris,
    Thanks for the prompt reply.
    Am afraid may need the BSL later and would like to avoid messing with the mailbox.
    Is there a way to dynamically find out the code/program memory sector end or alternatively an unused sector within the main memory?
    Or
    Is there a way to block a segment for user data memory at design time?
    Regards
    sohrab
  • You can use the linker command file to define/allocate memory so that the application code is not placed in that region.

    Chris
  • Along with the definition in the linker command file you then can also defined certain functions or constants to be placed in that location.
    www.ti.com/.../spnu151r.pdf

    Chris
  • hi Chris,

    Thanks for the revert. Shall look at your suggestions.

    For now am using the flash_size from TLV and subtracting 4K sector sizes from the end.

    Am assuming the compiler / linker stores code sequentially from the start. My code size is less than half of the main flash.

    Is it a safe bet?

    regards

    Chris Sterzik said:
    Along with the definition in the linker command file you then can also defined certain functions or constants to be placed in that location.
    www.ti.com/.../spnu151r.pdf

  • I think that placing the values in the last last sectors with that much space in between is safe.

    I do not quite follow the references to the TLV. The Flash size is stored in the system control register SYS_FLASH_SIZE. The Flash information found in the TLV is related to the programming of Flash. Since you mentioned that you are only using ½ of the Flash space that reminded me that the over-the-air update (OAD) example does something similar in that the application code resides in bank 0 while the new image for updating is kept in bank1. The linker command file is a great example of how to place pieces of code in specific places.

    dev.ti.com/.../

    You can similarly customize the linker command file to the portions of flash you reference and then use the pragam in your code to place the relevant information (functions or variables).

    dev.ti.com/.../

    Regards,
    Chris

**Attention** This is a public forum