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.

C28x Flash API interrupt



Hi,

I'm facing some problems when I use the Flash API program instructions on my F28035. All my interrupts are enable so I guess some code is running from flash when it happens and I get the ITRAP instructions. In the documentation, there's a section about disabling instructions but it's written as optional. What does it mean? How can I enable this to make sure my interrupts are not called. I could add disable interrupts/enable interrupts around the flash API calls but if it's a feature that can be enabled in the library, I'd rather use it.

Thanks!

  • The flash API for the F28035 only disables interrupts during time critical code in the program and erase. Outside of time critical code interrupts are enabled but any interrupt taken must be executed from RAM. If an interrupt resides within Flash or OTP the processor will take an ITRAP because flash and OTP are not available during execution of program/erase. There is more information on this in section 14 of the Quickstart guide.
  • Hi,

    I thought that if it was disabling interrupts during time critical code, I didn't need to disable them earlier if some of my interrupts resides in FLASH. My understanding was that since it's executing one instructions at a time, if interrupts are disabled before critical instructions, this means that no interrupt is currently being executed, the instruction pointer is pointing to the FLASH API, so one they are disabled it shouldn't cause any problem.

    Which part am I misunderstanding...

    Thanks
  • mosin said:
    I thought that if it was disabling interrupts during time critical code, I didn't need to disable them earlier if some of my interrupts resides in FLASH.

    The time critical code is only a portion of the API function.  During this time, if an interrupt comes in it will be held off until time critical portion is done.  This time critical portion happens many times during any call to the flash API.  Outside of the time critical portion you may take interrupts but the service routine (ISR) must reside in RAM.

    This allows some applications to continue to service interrupts while flash is being updated.  If your application requires this then the ISRs must be executing from RAM.   If your application does not require this, then the interrupts can be globally disabled before calling the flash API.

    Only once the API completely exits will the flash memory once again be available.  

  • Ah great, I understand completly. I didn't think it was enabling/disabling several times but the timing between start and end is critical. I'll add some functions to adapt my code.

    Thanks for your answer!