User`s manual
RX600 & RX200 Series Simple Flash API for RX
R01AN0544EU0250 Rev.2.50 Page 11 of 33
March 4, 2014
2.14 Using Non-Blocking Background Operations
When background operations (BGO) for ROM or data flash are enabled, API function calls will not block and will
return before the flash operation has finished. The user should take care in these instances that they do not try to access
the flash area that is being operated on until the operation has finished. If the area is accessed during an operation then
the FCU will go into an error state and the operation will fail.
The user will be alerted when a background flash operation has finished through a callback function. There are 3
callback functions that the Simple Flash API uses when an operation completes. The user should write these functions
in their application code. The 3 callback functions are:
• void FlashEraseDone(void)
o This function is called when a data flash or ROM erase has completed
• void FlashWriteDone(void)
o This function is called when a data flash or ROM write has completed
• void FlashBlankCheckDone(uint8_t result)
o This function is called when a data flash blank check has completed. The ‘result’ parameter will be
‘FLASH_BLANK’ in the event that the block was blank and ‘FLASH_NOT_BLANK’ in the event
that the block was not blank.
There is also a callback function in the event that a flash error has occurred.
• void FlashError(void)
The Flash API will reset the FCU when an error is detected but this callback is included to alert the user that the flash
operation did not complete successfully.