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.

TMS570 Flashing OTP area fails with Uniflash v2.2

Other Parts Discussed in Thread: UNIFLASH, TMS570LS3137, NOWECC

I am trying to flash the OTP area and its ECC with Uniflash and there is an error during the process even when I am setting the OTP flag "FlashEnableOTP" to "true".

The following tools/devices are used:

1. XDS100v2

2. TMS570LS3137

3. CCS UniFlash  Version: 2.2.0.00016

All the rest of the Flash area is flashed without problems.

Could you please let me know if it is possible to Flash the area:

Customer OTP TCM Flash Bank 1 0xF000_2000 or

Customer OTP EEPROM Bank 7 0xF000_E000

With the referenced Uniflash Version?

When I use the option -viewOptions the referenced sections are not listed:

*******************************************************************

Boolean Option:
    id: FlashBank0Sector0
    name: Sector 0 (0x00000000 - 0x00007FFF)
    value: true
...
Boolean Option:
    id: FlashBank0Sector14
    name: Sector 14 (0x00160000 - 0x0017FFFF
    value: true
Boolean Option:
    id: FlashBank1Sector0
    name: Sector 0 (0x00180000 - 0x0019FFFF)
    value: true
...
    id: FlashBank1Sector11
    name: Sector 11 (0x002E0000 - 0x002FFFFF
    value: true
Boolean Option:
    id: FlashBank7Sector0
    name: Sector 0 (0xF0200000 - 0xF0203FFF)
    value: true
...
Boolean Option:
    id: FlashBank7Sector3
    name: Sector 3 (0xF020C000 - 0xF020FFFF)
    value: true

*******************************************************************

Thanks

  • Hello Henry,

    I've forwarded your question to one of flash programming experts. They should get back with you shortly.

  • Hello Henry,

    I have reproduced your issue and submitted a defect ticket to CCS to get this fixed. 

    The only workaround I know of at this moment would be to have your code program the OTP.

  • Hi John,

    Thanks for your feedback.

    Do you have any idea when could we expect to have the issue fixed?

    Is there any release planned for the Uniflash Tool?

    BR,

    Henry

  • Hi Henry,

    As I just submitted the ticket, I need the CCS team to evaluate it first before they can give me a timeframe.  I believe, but not sure, that they are planning for a UniFlash release in September.  Not sure if a fix for this issue would make it into that release.  I will have to confer with the CCS team on this.

  • Henry,

    We have identified a problem with programming OTP memory on Hercules devices. We have implemented a fix and it will be included in the next release of UniFlash in September.

    I have also included an early version of the patch for your interest, which has not be tested thoroughly yet, but does allow you to evaluate the solution before it is release in the next UniFlash build.

    If you want to try it:

    1. download the attachment

    2. copy and replace the file at <installDir>\uniflashv2\ccs_base\DebugServer\bin\ (backup the original version if you want to keep it)

    3. Provide any feedback you have on the patch.

    Thanks,

    Ricky

    FlashHercules.dll
  • Hi Ricky,

    I have tested the patch you sent me and I have found the following:

    ------------------------------------------------------------------------------------------------------

    1. The OTP area is written and verified correctly, 64 bytes in OTP address:

    CortexR4: Writing Flash @ Address 0xF0002280 of Length 0x00000040

    CortexR4: Verifying Flash @ Address 0xF0002280 of length 0x00000040

    CortexR4: Finish Writing Flash @ Address 0xF0002280 of Length 0x00000040

    ------------------------------------------------------------------------------------------------------

    2.  The OTP ECC area is being written (I have checked it with the Lauterbach) but its verifications fails:

    CortexR4: Writing Flash @ Address 0xF0040450 of Length 0x00000008

    CortexR4: Verifying Flash @ Address 0xF0040450 of length 0x00000008

    SEVERE: CortexR4: Error during Flash verification (Flash algorithm timed out). Operation cancelled.

    SEVERE: CortexR4: Flash verification returned error condition. Operation cancelled.

    SEVERE: CortexR4: Error Writing Flash @ Address 0xF0040450 of Length 0x00000008

    SEVERE: CortexR4: GEL: File: D:\flashing\full_ecc.hex: Load failed.

    SEVERE: File: D:\flashing\full_ecc.hex: Load failed.
    SEVERE: Error loading "full_ecc.hex": File: D:\flashing\full_ecc.hex: Load failed.
    > Command suspended due to errors in loading the program.

    > Disconnecting from target.

    SEVERE: CortexR4: Unable to terminate memory download: (Error -1003 @ 0x2BC5) Internal error: Invalid parameter passed to function. Restart the application. If
    error persists, please report the error. (Emulation package 5.1.73.0)

    Here are the options I am providing to the UNIFLASH tool:

    call "%UNIFLASH_PATH%\uniflash.bat" -log Log.xml -ccxml TargetConfiguration.ccxml ^
    -setOptions ^
    FlashCrystalFreq="16.0" ^
    FlashEnableOTP=true ^
    FlashAutoECCSetting=false ^
    FlashVerifySetting="Verify" ^
    FlashRangeToggle=false ^
    FlashBlankCheckToggle=false ^
    FlashEraseSelection="Entire Flash" ^
    -program full.hex full_ecc.hex

    full.hex: Contains all the Flash, EEPROM and OTP dafa

    full_ecc.hex: Contains all the ECC for the full.hex file, it is generated with the nowECC

    Error Correcting Code Tool - nowECC
    Version 2.21 [Build: 12-June-2013]

    ------------------------------------------------------------------------------------------------------

    I have tried some other options but they are also not working:

    Option a:

    FlashAutoECCSetting=true

    -program full.hex <--- Without providing the ECC file

    Result:

    No OTP ECC was generated/written into the device.

    Option b:

    FlashAutoECCSetting=true

    -program full.hex full_ecc.hex <--- Providing the ECC file

    Result:

    > Loading Program: full_ecc.hex
    WARNING: CortexR4: Loader: One or more sections of your program falls into a memory region that is not writable.  These regions will not actually be written tothe target.  Check your linker configuration and/or memory map.

    Q1.

    Could you please try to reproduce the issue mentioned in 2. and give me your feedback?

    Q2.

    If there is still an issue with the tool, do you think you could provide us a second patch in a short term (e.g. 1 or 2 weeks)?

    Q3.

    When configuring the option FlashAutoECCSetting=true, should the tool generate automatically the ECC for the OTP area too?

    Thank you and BR,

  • Hello Henry,

    On question 3, I know that works correctly as when I was working with Ricky on the OTP issue yesterday, I forgot to turn Auto ECC generation off and if programmed the ECC for the data in my OTP.

    Would you look in <UniFlash Install Dir>/ccs_base/hercules/flash/configs for the file nowFlashLibraries.xml.  Open this file up and tell me what version is listed in this entry:

        <Library Name="f021_R4_be.nfl" Version="x.xx" Technology="F021"/>

  • Hi John,

    This is the information present on the referenced file:

    <?xml version="1.0" encoding="UTF-8"?>
    <Libraries>
        <Library Name="pf035a.nfl" Version="1.04" Technology="Platform F035"/>
        <Library Name="pf035a_cortexm3.nfl" Version="1.04" Technology="Platform F035"/>
        <Library Name="f021_R4_be.nfl" Version="1.60" Technology="F021"/>
        <Library Name="f021_R4_le.nfl" Version="1.60" Technology="F021"/>
    </Libraries>

    BR,

  • Hi Henry,

    The v1.60 of the f021_R4_be.nfl was built with a version of the F021 Flash API with a known errata on verification in the ECC memory regions. 

    Place the attached file in <UniFlash Install Dir>/ccs_base/hercules/flash/libraries renaming it to f021_R4_be.nfl (for some reason the forums keep changing the file name) and change the version number in the nowFlashLibraries.xml file to 2.03.

    http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/312/5126.f021_5F00_R4_5F00_be.nfl

    With the dll Ricky supplied earlier, this should correct all the issues you are having with programming and verifying OTP and OTP ECC.

    Please let me know how it works.

  • Hi John,

    I have tested the solution and now the OTP and ECC OTP areas are being programmed correctly.

    Thank you and BR,

    Henry

  • Hi Henry,

    Thank you for letting me know it worked.