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.

Flash API issue

Other Parts Discussed in Thread: TMS320F28026

I'm having a problem with Flash28335_API_V210.lib. Occasionally the call to Flash_Erase does not return. The toggle test shows the API is configured for 9.998KHZ, I'm trying to erase sectors A-F (0x3f), interrupts are turned off, watch dog is turned off, Flash_CPUScaleFactor is initialized to SCALE_FACTOR, Flash_CallbackPtr is NULL and CPU_RATE is defined as 6.667L for 150MHz clock in Flash2833x_API_Config.h. I have copied all the flash API functions to ram as shown in the example. I have searched the web but have not found anything that explains this. I have not tried debugging in to the API yet. Code snippet is below wSectors is 0x3f.

               // disable interupts
               unsigned int local = _disable_interrupts();

               // status registers
               FLASH_ST FlashStatus;
               wError = Flash_Erase(wSectors,&FlashStatus);

               // re-enable interupts
               _restore_interrupts(local);

Any suggestions would be greatly appreciated.

  • RichS said:

    I'm having a problem with Flash28335_API_V210.lib. Occasionally the call to Flash_Erase does not return. The toggle test shows the API is configured for 9.998KHZ, I'm trying to erase sectors A-F (0x3f), interrupts are turned off, watch dog is turned off, Flash_CPUScaleFactor is initialized to SCALE_FACTOR, Flash_CallbackPtr is NULL and CPU_RATE is defined as 6.667L for 150MHz clock in Flash2833x_API_Config.h. I have copied all the flash API functions to ram as shown in the example. I have searched the web but have not found anything that explains this. I have not tried debugging in to the API yet. Code snippet is below wSectors is 0x3f.

                   // disable interupts
                   unsigned int local = _disable_interrupts();

                   // status registers
                   FLASH_ST FlashStatus;
                   wError = Flash_Erase(wSectors,&FlashStatus);

                   // re-enable interupts
                   _restore_interrupts(local);

    Any suggestions would be greatly appreciated.

    Rich,

    Sorry for the late reply.  If you haven't already resolved this, I would try starting with just a simple program - like the one that comes with the flash API itself.  Then try adding back to it.  I don't know why it would only have the problem occasionally.

    -Lori

     

  • Lori -

    Thanks for getting back to me. I found the issue. The erase function was not returning because when the interrupts were turned back on there was an analog interrupt pending and the code at the vector had just been erased.

    Rich

  • I'm having the same problem with TMS320f28026 but the first step of my flashing application is to disable interrupts:

        // Disable CPU interrupts
          DINT;

        // Disable CPU interrupts and clear all CPU interrupt flags:
        IER = 0x0000;
        IFR = 0x0000;

    Are there other possible issues?

    Thanks in advance

  • Samuele,

    You need to make sure that ALL code is running from ram. My code is in C++ and the VPTR in each class instance is in flash even when I load that class into ram. I had to make sure the .econst section was also in ram. I also turned off all timers, adc, spi and serial ports before starting erase.

     

    Rich