I am developing a project based on the LPC5526 CPU.
I am using the flash to write setup values that are written only once and read only at power on using the routines in the iap_flash.c file.
I use the FLASH_VerifyErase routine to check that the flash has been written, but sometimes the routine returns a state=105 that is not included in the list of possible states.
Has anyone else had a similar problem? If so, how was it resolved?
Thank you very much for your help and collaboration
Best regards
Solved! Go to Solution.
Thank you very much for your message.
Just for reference this is the list of possible flash state errors:
kStatus_FLASH_Success ............................. 0
kStatus_FLASH_InvalidArgument ..................... 4
kStatus_FLASH_SizeError ........................... 100
kStatus_FLASH_AlignmentError ...................... 101
kStatus_FLASH_AddressError ........................ 102
kStatus_FLASH_AccessError ......................... 103
kStatus_FLASH_ProtectionViolation ................. 104
kStatus_FLASH_CommandFailure ...................... 105
kStatus_FLASH_UnknownProperty ..................... 106
kStatus_FLASH_EraseKeyError ....................... 107
kStatus_FLASH_RegionExecuteOnly ................... 108
kStatus_FLASH_ExecuteInRamFunctionNotReady ........ 109
kStatus_FLASH_CommandNotSupported ................. 111
kStatus_FLASH_ReadOnlyProperty .................... 112
kStatus_FLASH_InvalidPropertyValue ................ 113
kStatus_FLASH_InvalidSpeculationOption ............ 114
kStatus_FLASH_EccError ............................ 116
kStatus_FLASH_CompareError ........................ 117
kStatus_FLASH_RegulationLoss ...................... 118
kStatus_FLASH_InvalidWaitStateCycles .............. 119
kStatus_FLASH_OutOfDateCfpaPage ................... 132
kStatus_FLASH_BlankIfrPageData .................... 133
kStatus_FLASH_EncryptedRegionsEraseNotDoneAtOnce .. 134
kStatus_FLASH_ProgramVerificationNotAllowed ....... 135
kStatus_FLASH_HashCheckError ...................... 136
kStatus_FLASH_SealedFfrRegion ..................... 137
kStatus_FLASH_FfrRegionWriteBroken ................ 138
kStatus_FLASH_NmpaAccessNotAllowed ................ 139
kStatus_FLASH_CmpaCfgDirectEraseNotAllowed ........ 140
kStatus_FLASH_FfrBankIsLocked ..................... 141
regards
hi,_Ferrari_
FLASH_VerifyErase is used to check whether erase is successful, and FLASH_VerifyProgram is used to check whether write is successful. You can refer to lpcxpresso55s28_flashiap1 to try.
BR
Xu Zhang
Thank you very much for your message.
Just for reference this is the list of possible flash state errors:
kStatus_FLASH_Success ............................. 0
kStatus_FLASH_InvalidArgument ..................... 4
kStatus_FLASH_SizeError ........................... 100
kStatus_FLASH_AlignmentError ...................... 101
kStatus_FLASH_AddressError ........................ 102
kStatus_FLASH_AccessError ......................... 103
kStatus_FLASH_ProtectionViolation ................. 104
kStatus_FLASH_CommandFailure ...................... 105
kStatus_FLASH_UnknownProperty ..................... 106
kStatus_FLASH_EraseKeyError ....................... 107
kStatus_FLASH_RegionExecuteOnly ................... 108
kStatus_FLASH_ExecuteInRamFunctionNotReady ........ 109
kStatus_FLASH_CommandNotSupported ................. 111
kStatus_FLASH_ReadOnlyProperty .................... 112
kStatus_FLASH_InvalidPropertyValue ................ 113
kStatus_FLASH_InvalidSpeculationOption ............ 114
kStatus_FLASH_EccError ............................ 116
kStatus_FLASH_CompareError ........................ 117
kStatus_FLASH_RegulationLoss ...................... 118
kStatus_FLASH_InvalidWaitStateCycles .............. 119
kStatus_FLASH_OutOfDateCfpaPage ................... 132
kStatus_FLASH_BlankIfrPageData .................... 133
kStatus_FLASH_EncryptedRegionsEraseNotDoneAtOnce .. 134
kStatus_FLASH_ProgramVerificationNotAllowed ....... 135
kStatus_FLASH_HashCheckError ...................... 136
kStatus_FLASH_SealedFfrRegion ..................... 137
kStatus_FLASH_FfrRegionWriteBroken ................ 138
kStatus_FLASH_NmpaAccessNotAllowed ................ 139
kStatus_FLASH_CmpaCfgDirectEraseNotAllowed ........ 140
kStatus_FLASH_FfrBankIsLocked ..................... 141
regards
Thank you very much for your reply.
I think I wasn't clear enough. I'm not sure what error the FLASH_VerifyErase function returns if the sector is not erased.
Thank you very much for your help and cooperation.
Best regards.
Hello @_Ferrari_
Please refer to the flash demo under SDK, there are flash erase/program/verify steps.
BR
Alice