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.

Erase has FAIL_PRECOMPACT error, but program and read work

Other Parts Discussed in Thread: CONTROLSUITE

The below info is for a TMS320F28027PT/DA with FlashAPI v2.00 and silicon revision A.

I'm getting the STATUS_FAIL_PRECOMPACT error (FlashAPI error 24) when calling Flash_Erase.  The FT.FirstFailAddr is at 0x003F7000.

I've run the Flash_DepRecover() function multiple times and it always returns with STATUS_SUCCESS within 4ms.  However, Flash_Erase still produces an error after running DepRecover.

I've tried Flash_Erase(0x000F, &FT), Flash_Erase(0x0001, &FT), Flash_Erase(0x0002, &FT), Flash_Erase(0x0004, &FT), and Flash_Erase(0x0008, &FT).  All have the same error, even though that address isn't in the sector I am trying to erase for 3 of them.

I can program and read data at this address though.  Admittedly, I've only tried 0x37F000 - 0x37F004.  Maybe the error is elsewhere in this sector, but why would Flash_Erase return this fail address then?  The start of that sector is 0x376000 on this device, so it's not just returning the start of the sector as the FirstFailAddr.

Anyway, does anybody know what could be wrong here?  I'm guessing it's not depleted because Flash_DepRecover() returns so quickly.

  • So I've tried this with another chip and I get the exact same error.

    Erase Error Code: 24
    Erase Fail Address: 0x003F7000

    I can read from the whole device just fine.  I can't test programming the whole device until I can erase it (unless I program the exact same data).  But areas that were blank, I could also program just fine.

    Any help would be greatly appreciated.

  • I've now wired up a brand new MCU on a seperate board with ONLY the power, boot pins, and SCI lines connected.

    I still get this same error, with the same fail address.  I can only conclude I am somehow doing something wrong, but the problem certainly can't be that the device is depleted, especially on the first run.

    I'm getting 10kHz when I do a toggle test.  Is there anything else I can check to see if the setup is wrong?

  • Hello Daniel,

    Using the lastest API lib will fix your problem : 

    controlSUITE\libs\utilities\flash_api\2802x\v201\lib

    Regards,

    Calin

  • It surely does.  Thanks for the help Calin.

  • Hi,

    Same problem on:

    TMS320F28035PNT

    G4A - 37AZEYW

    G4

    Chip erases when boot ROM version of Flash_Erase is called; however, when library is compiled-in (runs from L3 DPSARAM) I get status 24 (STATUS_FAIL_PRECOMPACT) and FLASH_ST.FirstFailAddr is 0x3F7000 (despite the fact that the address has nothing to do with erased sector(s)).

    Unfortunately for 28035 there is no updated library. Looked through controlSUITE3.3.8:

    TI/controlSUITE/libs/utilities/flash_api/2803x/v100a/lib/Flash2803x_API_V100.lib                                              CRC: 3b12b412
    TI/controlSUITE/device_support/f2803x/v129/DSP2803x_common/lib/Flash2803x_API_V100.lib                  CRC: 3b12b412
    TI/controlSUITE/device_support/f2803x/v128/DSP2803x_common/lib/Flash2803x_API_V100.lib                  CRC: 3b12b412
    TI/controlSUITE/device_support/f2803x/v127/DSP2803x_common/lib/Flash2803x_API_V100.lib                  CRC: 3b12b412
    TI/controlSUITE/device_support/f2803x/v130/DSP2803x_common/lib/Flash2803x_API_V100.lib                  CRC: 3b12b412

    Is there a recommended compatible library I can use that runs same routines? I need to run flash programming from RAM as CSM will be turned-on and I don't want to unlock the chip.

    Thanks!

  • Oops,

    My mistake.

    Didn't copy .econst section into RAM.


    This works:

       .QuickRAMFunc       : LOAD = FLASHA | FLASHB, PAGE = 0
                             RUN >> RAML0 | RAML1 | RAML2 | RAML3, PAGE = 1
                             table(_QuickRAMFuncTbl)
                             {  rts2800_ml.lib<prolog.obj>(.text)
                                rts2800_ml.lib<_lock.obj>(.text)
                                rts2800_ml.lib<epilog.obj>(.text)
                                -l"../../shared/lib/Flash2803x_API_V100.lib"(.text)
                                -l"../../shared/lib/Flash2803x_API_V100.lib"(.econst) }

    And then somewhere in the code:

    copy_in(&QuickRAMFuncTbl);

    Sorry about that.

  • HI Konstantin,

    Good to hear that you figured out the problem. If you need any additional help with a new/unrelated question, I recommend creating a new thread. That would allow it to receive better support. There's a better chance of your question getting answered there, instead of posting in an older thread.

    Thanks,
    Ozino