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.

TMDSDOCK28035: Simple Flash Help

Part Number: TMDSDOCK28035
Other Parts Discussed in Thread: CONTROLSUITE

Simply, how can I program the OTP_KEY and OTP_BMODE values??? I need a clear cut example or code as I have poured thru numerous documents and examples and to date cannot set those values. I would also like a troubleshooting tip in which I can use the emulator to see the memory locations are correct.

PS - I have been able to update the EMU_KEY and EMU_BMODE and see these values with the Memory Browser in Code Composer Studio.

  • Hi Jeff,

    You can set the EMU boot mode within the scripts tab while connected to the device in CCS.

    On F2803x you can use the Flash API to program the OTP or configure it as part of your image.

    See this prior E2E and #37 and #41 of the subsequent FAQ: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1010693/tms320f28035-production-high-speed-programming---otp-and-flash

    Best,

    Kevin

  • Thanks for the information but my OTP writes still fail. (Code Composer is 10.3)

    I am using the C:\ti\controlSUITE\development_kits\TemplateProjects\FlashingLeds-F28035_v1.0 and have made the following modifications - based on #41 of recommended FAQ link above:

    In F28035_FLASH_FlashingLeds.CMD in Page 0, I added the following:
    OTP      : origin = 0x3D7800, length = 0x0003FD /* on-chip OTP */
    OTPKEY   : origin = 0x3D7BFE, length = 0x000001 /* Bootloader GetMode key 0x55AA */
    OTPBMODE : origin = 0x3D7BFF, length = 0x000001 /* Bootloader BMode key - Set to CAN - 0x0007*/

    In the SECTIONS section, I added:
    /* Reset OTP Bootloader */
    OtpKey_Section   : > OTPKEY,   PAGE = 0
    OtpBMode_Section : > OTPBMODE, PAGE = 0

    In DSP2803x_GlobalVariableDefs.c, I added:

    #pragma DATA_SECTION(OtpKey,"OtpKey_Section");
    Uint16 OtpKey = 0x55AA;

    #pragma DATA_SECTION(OtpBMode,"OtpBMode_Section");
    Uint16 OtpBMode = 0x1234; // Invalid value - Flash

    In DSP2803x_BootVars.h, I added:
    extern Uint16 OtpKey;
    extern Uint16 OtpBMode;

    This builds and loads however when I peak at the OTP memory I still am not seeing any evidence that the OTP memory locations have changed.

    Any additional thoughts? Can I share more information?

    Silly question but the fact that OTP locations 0x3D7BFE and 0x3D7BFF are all 0s, can the values be re-written to become 0x55AA and 0x000x?

    map file data may help???

    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    PAGE 0:
    OTP 003d7800 000003fd 00000000 000003fd RWIX
    OTPKEY 003d7bfe 00000001 00000001 00000000 RWIX
    OTPBMODE 003d7bff 00000001 00000001 00000000 RWIX


    SECTION ALLOCATION MAP

    output attributes/
    section page origin length input sections
    -------- ---- ---------- ---------- ----------------
    OtpKey_Section
    * 0 003d7bfe 00000001 UNINITIALIZED
    003d7bfe 00000001 DSP2803x_GlobalVariableDefs.obj (OtpKey_Section)

    OtpBMode_Section
    * 0 003d7bff 00000001 UNINITIALIZED
    003d7bff 00000001 DSP2803x_GlobalVariableDefs.obj (OtpBMode_Section)

    GLOBAL DATA SYMBOLS
    address data page name
    -------- ---------------- ----

    003d7bfe f5ef (003d7bc0) _OtpKey
    003d7bff f5ef (003d7bc0) _OtpBMode

    GLOBAL SYMBOLS
    page address name

    ---- ------- ----  
    0 003d7bff _OtpBMode
    0 003d7bfe _OtpKey  

  • Hi Jeff,

    Flash and OTP are 0xFFFF when erased. When programming it sets the bits to 0's, it looks like your OTP_KEY location has already been programmed (Note OTP can't be erased).

    Can you check if your device is locked (CSM passwords)? That's the other thing that can lead to 0's being read.

    Best,

    Kevin

  • Curious - should I be able to modify the memory location of the OTP key values thru the Memory Browser window of Code Composer - because I can't?

    Also, I tried via a gel update. I added the following to the f28035.gel: (I know it doesn't matter when emulator is attached, just trying to write the values.)

    menuitem "OTP Boot Mode Select"
    hotmenu OTP_BOOT_eCAN()
    {
    *0x3D7BFE = 0x55AA; /* OTP_KEY = 0x 55AA */
    *0x3D7BFF = 0x0007; /* Boot to eCan */
    }
    hotmenu OTP_BOOT_FLASH()
    {
    *0x3D7BFE = 0x55AA; /* OTP_KEY = 0x 55AA */
    *0x3D7BFF = 0x0003; /* Boot to FLASH */
    }

  • Jeffrey,

    For both the Flash and OTP, you won't be able to write to those locations with either the memory browser or the GEL.  This is because for both the Flash API has to be called.

    The simplest way to do this from CCS is to declare a section in your linker and then map a pragma to that section in your C code, and then use CCS to load the .out file.  When CCS loads the .out to a flash or memory space it will call the needed flash API to program all the needed locations.

    This post give details on the above: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/83592/otp-programming

    The other method would be to call the Flash API in your code and then let the C28x write the OTP as part of your program.  Since you have the CCS connection this isn't necessary(but would be the method used if you were writing data via a bootloader).

    Best,

    Matthew

  • So based on yours and Wally's reply, it appears you have only 1 chance to program the OTP area correctly. If you did it incorrectly, you need to throw away the F28035 and get another one. Or is there another way to change the OTP_Key and OTP_BMode locations for the bootloader to recognize?

  • Jeffrey,

    Yes, the OTP is one time programmable.  The only caveat here is that any erased bit can always be programmed in the future, but a programmed bit can never be erased.  So there may be a one time out, depending on the boot mode you are coming/going to.

    What you are describing is the reason we have the EMU_Key and EMU_BMode to let those modes be debugged/tested before finally programming the OTP, but I appreciate your point if you do need to change this down the road(and that you have to have the debugger active in this case). 

    We can work around this by always booting  to flash(default) and place a small amount of code to re-direct/call the bootloader of choice until you are 100% sure your standalone development is complete.  You would have to reprogram that small kernel if you wanted to change bootloaders, but it would prevent the device from becoming obsolete.

    FWIW we addressed this issue in later devices by allocating several words of OTP along with a changeable pointer(link pointer) in case the need arose for what you are talking about. In terms of a comparable device with that feature we'd be talking about a F28004x or F28002x C2000.

    Best,

    Matthew