$REVOLUTION_SDK_ROOT/build/demos/nanddemo
This shows an example of error handling with the NANDSimpleSafeCancel function when using NANDSimpleSafe-type functions.
The NANDSimpleSafeOpen[Async] and NANDSimpleSafeClose[Async] functions open and close files while guaranteeing atomic file updates. However, these functions internally make multiple requests of various types (open, close, read, write, create, delete, seek, and so on) in order to implement this operation. If these requests could not be processed properly, NANDSimpleSafe-type functions will immediately return the corresponding error code to the caller. However, resources that were in use (temporary files, file descriptors, and so on) will not be deallocated. Therefore, if a NAND_RESULT_AUTHENTICATION or NAND_RESULT_ECC_CRIT error code is encountered when using NANDSimpleSafe-type functions, attempt to deallocate resources by calling the NANDSimpleSafeCancel[Async] function from the application, as appropriate.
The basic process flow of this sample program is as follows.
NANDSimpleSafeOpen function.
NANDWrite function.
NANDSimpleSafeClose function.
For steps 2 and 3 in the process above, this sample program contains code that calls the NANDSimpleSafeCancel function to recover from the error state when NAND_RESULT_AUTHENTICATION or NAND_RESULT_ECC_CRIT is returned. Please also refer to Processing Sequence.
NANDSimpleSafeCancel, NANDSimpleSafeCancelAsync, NANDSimpleSafeOpen, NANDSimpleSafeOpenAsync, NANDSimpleSafeClose, NANDSimpleSafeCloseAsync, Processing Sequence
2007/05/09 Initial version.
CONFIDENTIAL