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.

Flashing to the ucontroller

Other Parts Discussed in Thread: HALCOGEN, UNIFLASH

Are there any limits to how many times new code can be flashed to a Hercules Launchpad?

  • Hi Dan,

    The maximum write/erase cycles for the flash is 100k. Please check the time spec for data flash in the datasheet.

    Regards,
    QJ
  • What happens after 100k? What are the signs of flash failure? Just a flash-failure error message or is it more insidious?
  • Hi Dan,

    The flash will wear out after being programmed and erased about 100K times. The part is not guaranteed to work.

    Regards,
    QJ
  • Hi Dan,

    I am sorry for my confused answer. 100K cycles is only for flash Bank7 (FEE). For other regular flash bank (0, 1), the maximum write/erase cycles is 1000.

    Regards,
    QJ
  • QJ

    Could you explain the difference between these flash banks. It looks like your are telling 1000 flashes only. I would really like to have some idea what happens when failure occurs. That is, how do I know when it has failed?

    Daniel

  • Hi Daniel,

    After Erasing and Reflashing for >> 1000 times, you will start to see bit errors occurring in the flash. This means that the margins of the flash cells are getting worse and worse, the flash weared out as QJ wrote.

    I would expect that you will first see single bit errors, which can be corrected by the ECC logic. Usually there is some profiling done for these errors and these exceeded a certain limit in your applications (you have to specify) the appliance should signal that it has to be replaced. You could also think about "boosting" certain flash cells when you start to see single bit errors to increase the margin.

    But please note, this will happen only if you reprogram the device very often, or after a long period in time. Usually you don't have to reprogram the device very often, once the firmware is set it will most likely not change and every appliance has a certain lifetime after which it should be replaced anyways. We usually specify 15 years (flash) data retention for these devices.

    Best Regards,
    Christian

  • In my case I may need to reprogram the ucon daily.
  • Hi QJ

    In which datasheet can I find this information and specs? I did not see it in the manual.

    Daniel
  • Hi Daniel,

    The Write/Erase cycles are specified in the datasheet of the respective device, e.g.: www.ti.com/.../tms570ls1227.pdf
    Which part of the microcontroller's flash do you have to reprogram each day, is it the firmware or are you talking about some sort of data logging?

    Best Regards,
    Christian
  • Hi Christian

    For my application I am presently changing (often multiple times daily) the firmware by assigning new values to variables (stored in an array) and then recompiling the code and flashing it to the ucon. I would like to avoid this and instead have the ucon read the data for the array assignment from a PC. I guess this could be done using the UART but I have not done that sort of thing yet. Any other suggestions?

    Dan
  • Hi Dan,

    For this kind of applications you should definitely use some kind of wear leveling algorithm to be ease on the flash memory.

    On microcontrollers this is often done with EEPROM Emulation techniques, there is an EEPROM Emulation driver integrated in HALCoGen. The data would then come via a communication interface other than JTAG and all flash operations are done in system.

    Or you could just use a specific amount of Flash Sectors and flash and erase these in a round robin scheme. Of cause you than have to implement an algorithm which detects which sector is currently in use. In this case you can decide if you want to flash the sectors via JTAG or in system.

    Best Regards,
    Christian

  • Hi Christian

    Wear leveling (Thanks for introducing me to the term.) seems like a lot of work to extend the life of the flash memory. I think what I need instead is a way to transfer the control data I need to the ucontroller at startup so that I don't have to do frequent flashes. Any suggestions?
  • Hi Dan,

    What I meant is to use the four EEPROM sectors in Flash Bank 7 in a round robin scheme to extend the life of the flash cells.

    So at the...

    • first day you would flash the data to Sector 0
    • second day you would flash the data to Sector 1 and erase 0
    • third day, flash Sector 2 and erase 1
    • fourth day, flash Sector 3 and erase 2
    • fifth day, flash Sector 0 and erase 3
    • ...

    This would then of cause require that your firmware can detect which sector contains valid data, e.g. use a key or a CRC.
    You can realize the program and erase cycles either with CCS/UniFlash or with In-System programming using the F021 Flash API.

    Best Regards,
    Christian

  • Hi Christian

    Do you have a link to more information and code related to doing this?

    Daniel
  • Hi Daniel,

    As said before, there are many ways to achieve this. If you want to implement In-System programing you should look at the EEPROM driver in HALCoGen and you will defnietly need the F021 Flash API: www.ti.com/.../HERCULES-F021FLASHAPI

    Best Regards,
    Christian