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.

TMS320F2802x, Flash API erase error 24 - STATUS_FAIL_PRECOMPACT



Hi,

I have problem with erasing TMS320F2802x device. I am using Flash_API erase function and I'm getting the error message 24 - Status Fail Precompact after Error function is calling. All other Flash_API functions works fine(verify or program), also toggle test is working...so I don't understand why erase function not. I am using the Flash API library "Flash2802x_API_V201.lib".

I found that debugging the erase function through CCS5v5 works fine. But after downloading code direct to RAM and run it from this location I get the error message 24 - Status Fail Precompact.

What is the reason of this error message?

Why erase function works during debugging but not in real application? Any ideas?

Thank you for your help!

Best regards,

Tomas

  • In addition to my question - I'm using TMS320F2802x Rev 0 devices thus the mentioned Flash2802x_API_V201.lib are used. if I use the TMS320F2802x Rev A (and newer devices) with 2802x_FlashAPI_BootROMSymbols_v2.01.lib there is everything OK. May be erase fault caused by the error in Flash2802x_API_V201.lib ?
  • Hi again,

    No one can help me? I'm really in dark...

    I have tried many code modifications but erase function always return error code 24 for TMS320F2802x rev. 0 devices. I am attaching the complete project file - can you please look in it and check if is everything OK?

    Erase_problem.zip

    As you can see the whole program is load direct to M0 SARAM and L0 SARAM.and run from this location. I am using the complete software Flash API. As I wrote before, when I debug the project via JTAG from CCS, the erase works, but after loading code to RAM via parallel boot mode, the erase function return mentioned error... The problem is only with erase function and error is present for any TMS320F2802x rev. 0 devices..

    Please help me!

    Thank you!

    Tomas

  • Hi
    just a quick shot, for rev0 you need to use the Software API, the Hardware Boot rom contains a coding error.
  • Hi Johannes,


    thank you for your answer - I was read about it. The document called sprz92X.pdf('X' means the document revision) take an information about coding error problem in boot ROM. So I think that Software API means that I need to link a file Flash2802x_API_V100a.lib and NOT the Flash2802x_API_BootROMSymbols_V100.lib. Am I right?

    In my project I have tried to link the Flash2802x_API_V100a.lib or updated Flash2802x_API_V201.lib but error code is still present...

    Is it possible to erase the TMS320F2802x rev. 0 devices using Flash API or not? Maybe some TI tech support member should take an answer to this issue...

    Thank you!

    Best regards,

    Tomas

    Tomas

  • Hi

    it is definitely possible to erase the TMS320F2802x Rev0.

    We are using the Flash282x_API_V201.lib.

    Our init code:

    void init_FlashAPI (void)
    {
    	// Copy the Flash API functions to SARAM
    	MemCopy(&Flash28_API_LoadStart, &Flash28_API_LoadEnd, &Flash28_API_RunStart);
    
    	// We must also copy required user interface functions to RAM.
    	//MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);			// done in main
    
    	EALLOW;
    	Flash_CPUScaleFactor = SCALE_FACTOR;										// Initalize Flash_CPUScaleFactor
    	Flash_CallbackPtr = NULL;													// Initalize Flash_CallbackPtr
    	EDIS;
    }


    The erase code:{

    #pragma CODE_SECTION(erase,"ramfuncs");
    void erase (void) {
    	DINT;	// Disable Interrupts
    	uint16_t i = 10;
    	for (i = 10; i ; i--);
    	uint16_t Status_Buffer = Flash_Erase(Erase_Flash_Sector, &Flash_Status);
    	EINT;	// Enable Interrupts
    }

    And you also have to check the Link order, delete a include entry and some other things I can't remember :-)

    When erasing  the flash failed it can happen that is is in depleted mode and you have to do a depeletion recovery, befor you can use the normal erase again.

  • Hi,


    sorry for later answer. I'm using very similar code like you - you can see it in attached project file I have posted earlier. I also try to run the depletion

    function(pass OK, without error) and it has no effect to consequent erase procedure, which again fail with STATUS_FAIL_PRECOMPACT error. As I said, 

    when I debug my project from CCSv5.5 everything works, but after loading code to RAM, error fails... I really don't know how to continue..

    Is there someone who can see my project and identify the source of mentioned error?

    Thank you!

    Tomas

  • Hi,
    we always have the Program in Flash Memory and only load it to RAM in runtime, so i can't help you there.
    Just some brainstorming what could go wrong:
    - locked by CSM
    - missing entrys in CMD file