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.

TMS320F28035 device locked

Other Parts Discussed in Thread: TMS320F28035, UNIFLASH

Hello,

I m using a TMS320F28035 on Code Composer Version: 4.2.2  using aTexas Instruments XDS100v2 USB Emulator_0/C28xx

One target board has device locked problem and the debugger reports:

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

C28xx: GEL Output:
Device Calibration not complete, check if device is unlocked and recalibrate.C28xx: GEL Output:
Device Calibration not complete, check if device is unlocked and recalibrate.C28xx: Flash Programmer: Error erasing

flash memory. Device is locked or not connected. Operation cancelled
C28xx: Flash Programmer: Error erasing Flash memory.
C28xx: Flash Programmer: Device is locked or not connected. Operation cancelled.
C28xx: Trouble Writing Memory Block at 0x3e8be2 on Page 0 of Length 0x5a
Cannot write to target
C28xx: Depletion Recovery started.
C28xx: Flash Programmer: Error when performing depletion recovery. Device is locked or not connected. Operation

cancelled.
C28xx: Depletion Recovery started.
C28xx: Flash Programmer: Error when performing depletion recovery. Device is locked or not connected. Operation

cancelled.

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

comparing not working board with a working board I can see that after a cpu reset by a step debugging when the code jumps from 0x3ff4fb to 0x3d7c80(Calibration Data) on working board there is a code but on not working board all code is at value 0x0000.

What has happened?

how can reset the device to default configuration?

Regards

Sandro

  • looking TMS320x2803x Piccolo Boot ROM  SPRUGO0A.pdf datasheet

    2.10 Device_Cal
    The Device_cal() routine is programmed into TI reserved memory by the factory. The boot ROM
    automatically calls the Device_cal() routine to calibrate the internal oscillators and ADC with device
    specific calibration data. During normal operation, this process occurs automatically and no action is
    required by the user.

    Can I program this memory area again?

  • Sandro,

    Based on the CCS4v error messages, it looks like the device is locked. When the device is locked, the CPU reads of secure memory will read back as 0x0000's. On F2803x,

    TI OTP is also a secure memory. That is reason why you read 0x0000's when you read device cal which is actually stored in TI OTP. If the device is not in depletion and if you know

    the flash password, you should be able to unlock the device and proceed with flash programming.

    Regards,

    Manoj

  • Tanks Manoj for your replay,

    when I load program to target the debugger log is:

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

    C28xx: GEL Output:
    Device Calibration not complete, check if device is unlocked and recalibrate.C28xx: GEL Output:
    Device Calibration not complete, check if device is unlocked and recalibrate.C28xx: Flash Programmer: Error erasing flash memory. Device is locked or not connected. Operation cancelled
    C28xx: Flash Programmer: Error erasing Flash memory.
    C28xx: Flash Programmer: Device is locked or not connected. Operation cancelled.
    C28xx: Trouble Writing Memory Block at 0x3e9b44 on Page 0 of Length 0x1c1
    Cannot write to target

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

    and a box Displays "Error Lauching Debug Session"and I forced to continue lauching

    I forced to continue lauching and I tried  by Tools->On-Chip Flash to execute the commands:

    -Erase Flash

    -Program Password

    -Unlock

    -Depletion Recovery

    with no results, the debugger log is:

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

    C28xx: Erasing Flash memory...
    C28xx: Flash Programmer: Error erasing flash memory. Device is locked or not connected. Operation cancelled
    C28xx: Starting device unlocking...
    C28xx: Flash Programmer: Error unlocking flash memory. Device is still locked
    C28xx: Starting program password operation...
    C28xx: Flash Programmer: Error programming password. Device is locked or not connected. Operation cancelled.
    C28xx: Depletion Recovery started.
    C28xx: Flash Programmer: Error when performing depletion recovery. Device is locked or not connected. Operation cancelled.
    -------------------------------------------------------------------------------------------------------------------------------

    How can I do to erase the Flash or unlock the device?

    Regards

    Sandro

  • Sandro,

    Based on your message, it looks like you don't know the flash password. You can't perform any operation on secure memory (No writes, no reads) when the device is locked. So , unless you unlock the device you won't be able to perform depletion recovery (or) flash erase / programming. It is unfortunate but you might have to replace the part to proceed further.

    Regards,

    Manoj

  • Thanks Manoj,

    Regards

    Sandro

  • Manoj, 

    I have the same problem on my TMS320F28035, except that I had chosen all the passwords as FFFF.

    I used the following code:

    volatile Uint16 temp;

    // Load the key registers with the current password
    // These are defined in Example_Flash2803x_CsmKeys.asm

    EALLOW;
    CsmRegs.KEY0 = PRG_key0;
    CsmRegs.KEY1 = PRG_key1;
    CsmRegs.KEY2 = PRG_key2;
    CsmRegs.KEY3 = PRG_key3;
    CsmRegs.KEY4 = PRG_key4;
    CsmRegs.KEY5 = PRG_key5;
    CsmRegs.KEY6 = PRG_key6;
    CsmRegs.KEY7 = PRG_key7;
    EDIS;

    // Perform a dummy read of the password locations
    // if they match the key values, the CSM will unlock

    temp = CsmPwl.PSWD0;
    temp = CsmPwl.PSWD1;
    temp = CsmPwl.PSWD2;
    temp = CsmPwl.PSWD3;
    temp = CsmPwl.PSWD4;
    temp = CsmPwl.PSWD5;
    temp = CsmPwl.PSWD6;
    temp = CsmPwl.PSWD7;

    The key were all set at 0xFFFF in an .asm file. Since then I have this error:

    C28xx: Flash Programmer: Error erasing Flash memory.
    C28xx: Flash Programmer: Error encountered when writing to flash memory
    C28xx: Trouble Writing Memory Block at 0x3f7ff6 on Page 1 of Length 0x2
    C28xx: GEL: File: C:\Documents and Settings\s.brethous\Bureau\BrightLoop\softTestViveris\CompiledFiles_Release\leds.out: Load failed.

    It seems to me that my Flash memory has been locked but i can't understand why. Also, is there really no way to reset the memory or the whole device?

  • Did you check whether the device is actually locked? If not, I would recommend you to do so.

    Once you are connected to CCS, open memory window and read the flash password locations (0x3F7FF8 - 0x3F7FFF). If they return 0x0000 then the device is locked.

    Regards,

    Manoj

  • Hello Manoj,

    I operate on a limited version of CCS Edit and can only connect to the target on a debug session. The problem is that when I tried to erase the Flash memory at the beginning at the session I received an error message (the one I showed before) and the debug session end without allowing me to see the memory.

    On the other and, when I ran my code the first time I saw the whole memory bits set to 0, so I guess my device really is locked. I have already ordered another device, in case I couldn't unlock this one, but even in this case I would like to know what went wrong so I won't repeat the mistake.

    I tried to unlock the device using Code Composer Uniflash but without success...

  • Based on your message, I don't see how your unit would have got locked accidentally. However, as mentioned in many of our F05 flash documentations, user should never halt flash erase / program operation which would put the device in depletion (or) may even lock the device.

    It is very difficult for me to speculate what could have gone wrong without knowing the complete details. 

    Regards,

    Manoj

  • Well the problem is that I don't understand me either...

    For the details, I ran an example code from the TI Control Suite. The Flash API for the piccolo F2803x.The main is in the Example_Flash28035_API.c

    In debug mode, CCS stop before the main, and I had access to all the memory. The thing is that I forgot to comment the function call "Example_CallFlashAPI()" at the end of the main, and it ran all the examples functions. It is after that that all my memory went to 0 and i couldn't reprogram the Flash.

    At this point I don't think I can recover my device but at least I would like to try not to do it again.

  • Simon,

    When you ran the Example_CallFlashAPI() function in Example_Flash2803x_API.c did the execution stop in Example_Done() function shown below? (or) did you interrupt the execution of Example_CallFlashAPI() function in the middle of the code?

    void Example_Done(void)
    {

    asm(" ESTOP0");
    asm(" SB 0, UNC");
    }

    Regards,

    Manoj

  • Well I'm not really sure. At the moment I pressed F8 to continue to the main, I realized that I had forgotten to comment this line so I went to do it before compiling again, BUT I'm sure that I saw the memory before I did anything (when it all went to 0), meaning it stopped. So i'm not sure where the code stopped, but at least it stopped whithout my doing. I know it isn't really helpful but I didn"t see the problem before trying to program again.