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.

Permanent storage of some data

Other Parts Discussed in Thread: UNIFLASH, HALCOGEN

Hi,

I'm actually using TMS570/RM48HDK and need to store some small data permanently. Avoiding the use of SDcard (non practical for my application) how can this be done?

In particular my application should read MAC address somewhere on startup before setting up the network but, being the ethernet the only communication channel on the final setup, I need to set this up with some other way.

Modify and recompile the code for every item running my application is obviously not a practical way.

I think something like a permanent memory location that can be written using JTAG or serial/USB communication (that's only a suggestion but perhaps this is a common problem with a common solution).

Thank you

  • Matteo,

    The TMS570 and RM48 devices have for each flash bank and OTP sector that can be used by the end user.
    The size is 4Kb.

    On your device, you have 2 Flash Bank so 2 OTP sector.
    These OTP sector are flash based, BUT CANNOT BE ERASE.
    By default the content is 0xFFFF_FFFF and only 0s can be programmed. These OTP sector are also ECC protected.

    The good point for your application, these OTP sector can be programmed using UNIFLASH via JTAG.
    So your application (out file) can be programmed in all the part, and a specific one programmed in the OTP sector to handle the MAC address.

    Please have a look to the documentation and let me know if you need more details. (Flash Module Controller in TRM)

     

     

  • I don't understand what do you mean with "CANNOT BE ERASE" and "only 0s can be programmed".

    I've read the TRM section but some practical doubt remain:

    - how can I write the OTP section using Uniflash (I've see the "enable programming OTP memory", and then...?)

    - how can I read the OTP saved values from inside my hercules program?

    Thank you

  • Matteo,

    The erase state for a flash cell is "1".
    The OTP sector is flash based. The difference with regular Flash sector is, you can only program it once. Once a bit in the OTP sector is programmed to "0" it cannot be erase anymore (One Time Programing)

    The Customer_OTP can be accessed as regular flash. The memory mapping is available in the datasheet on page 72 for RM48.

    To program this OTP sector, you have to define a memory region at these address in your linker command file and a section to be mapped to this region.

    When you program the part (Regular flash and otp) it is necessary to check the "Enable programming OTP memory". It is a protection to ensure that you are not programming the OTP by mistake.

    NOTE: The Custom OTP sector is used to hold the unlock key used by AJSM (Advance JTAG Security Module)
    This module can be used to lock a part and disable JTAG access.
    On a new part, the AJSM is unlock by default.
    Once the default key is changed, to be able to re-access the part, standalone utility has to be used to provide the unlock key to re-enable JTAG access. This has to be done on every power on reset once the default AJSM key is changed. Please have a look to section 4.21.6 in RM48 datasheet.
    Be careful when using the Custom_OTP sector. If the default AJSM key is changed my mistake and you don't know what was programmed, the part CANNOT BE ACCESSED ANYMORE.

    Please let me know if this clarify your question.

  • Jean Marc,

    So the frames labeled "TI OTP" can be written only one time in the life of a chip while the "Customers OTP" can be freely used as permanent data storage?

    Which is the difference between Flash banks and EEPROM banks?

    For what I've understood the unlock key of the AJSM is in the 0xF000_0000 so at the beginning of the "Customer OTP, TCM Flash Bank  0". If I use only the "Customer OTP–ECC" banks or the "Customer OTP, TCM Flash Bank  1" the problem of locking the board will be avoided. Right?

    Can you give me a practical example of how to "define a memory region at these address in your linker command file and a section to be mapped to this region" ?

    To access the data from inside my hercules program I've simply to read/write the corresponding address or there's some other settings to do?

    Thank you


  • Matteo,

    TI_OTP as well as CUSTOM_OTP can only be programmed 1 time.
    The TI_OTP cannot be modified by the user. It is reserved for TI.

    Both TI_OTP and CUSTOM_OTP have ECC support. When you decide to use ECC on flash (for your application code and data) all read access to flash (Normal sectors, TI_OTP and CUSTOM_OTP) will be ECC protected.

    In your case, if you have some data like MAC address that have to be programmed only one time, the CUSTOM_OTP seems to be the best place.
    Each Flash Bank has it's own TI/CUSTOM_OTP sector (with their corresponding ECC area)
    It is correct that AJSM key is located at the beginning of the CUSTOM_OTP for Bank0.
    You can use Bank1 CUSTOM_OTP for your application.

    I've attached 2 files, 6646.example.asm and http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/312/4214.linker_5F00_command.cmd  to demonstrate how to define a memory region at a specific address and a section mapped to this region.
    This has to be added to your original linker command file from your application project. 

  • Both OTP can only be programmed 1 time means there's no place to store some permanent data that can be changed by the program? I mean: I can manage to assign my target a MAC once far all but I cannot do the same for IP address. This must be changed by the application (when receives a specific TCP command) but need to be stored throught a power cycle. No way to do this? Can't I simply access a section of the flash memory not used by the program?

    Moreover this affait of "single shot programming" thrill me a bit. There's no space for errors! There's somewhere a step-by-step guide of this process? I certainly do not want to ruin the hardware at my disposal!


  • Matteo,

    In your original question you were asking about permanent data. That is the reason why I was directing you to the custom OTP sectors.
    Now if I understand, these data are not really (or for some of them) permanent.

    Why not dedicating a flash sector for this kind of data or using the EEPROM (Bank 7)

    Normal flash sector have to be erased before being reprogrammed and make them not easy to use if your application code is suppose to change their content.
    The EEPROM bank (software emulation) can be used via a set of API as a real EEPROM.
    Data like MAC or IP address can be stored in this sector. They are non volatile (keep their content during power down)

    Halcogen provides support for EEPROM emulation on TMS570LS and RM48 parts. 

  • Jean-Marc,

    yes, I need both of them. I'm going to use OTP for real permanent storage (probably only MAC and machine ID code) and EPROM for other non volatile data (IP and some settings).

    About EPROM I cannot find nothing inside HalCoGen. Where is that set of API?

    Thank you

  • There's no "FEE" panel in my HalCogen (v03.06.00):

  • Which device do you have selected?  Not every device includes the FEE driver as of yet.  I have the TMS570LS3137ZWT selected.

  • You're right, I was using the TMS570HDK but actually has passed to the RM48HDK. The screenshot is from the RM48HDK.

    So the RM48HDK has no EPROM support?

  • It will have support, they just have not released it as of yet.  I will ping the FEE designer to see when the RM48 devices will get the FEE.

  • The FEE driver for RM48 is scheduled for release this month.

  • So shouldI expect net HalCoGen release?

    Meamtime there's some other way to use the EPROM?

  • The next release of HALCoGen will be sometime this month (aroung December 13th).

    Until that release, I know of no way currently to do Flash EERPOM emulation on the RM48 other than writing your own.