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.

[FAQ] F05 Flash: Can interrupts be serviced while programming or erasing flash?

Other Parts Discussed in Thread: C2000WARE

Q: Can interrupts be serviced while programming or erasing flash?

What happens if the device receives a data word via a communications interface, for example SPI? Will the data word be fetched in the SPIRXBUF? What about the Interrupt? Will the interrupt flag bit set and the ISR called after the Flash_Erase function?

  • A:

    This answer refers to C2000 devices which have F05 flash technology (Which devices include F05 Flash?)

    • More details are available in the documentation provided with the Flash API for the specific device being used. 
    • Look in the C2000Ware_<version>\libraries\flash_api\<device>\docs directory.

    The flash API disables all interrupts during time critical portions of the programming sequence. The longest of these is during an erase pulse, which is on the order of 3-4ms. Interrupts will not be taken during this time. The CPU code is dedicated to the API during this time. The functionality of the peripherals will remain unchanged. There is nothing fancy, the device will act as it normally would when CPU interrupts are disabled. The interrupt flag will be set and the interrupt taken after the API returns from the erase pulse and re-enables interrupts.

    At safe times, interrupts are enabled. During the time that interrupts are enabled, the flash and OTP are in a safe state such that an interrupt service routine (ISR) can take as much time as required to service the interrupt. Flash and OTP are not available for execution of code or reading of data during this time.

    A second method that can be used is the callback function. The function is called in between flash API operations on the flash every 3 to 4mS. Any code can be run during this time.

    For more F05 related FAQs refer to [FAQ] F05 Flash: Frequently Asked Questions