AnsweredAssumed Answered

LPC546xx iap write returns undocumented error code 21

Question asked by Casey Kelso on Feb 10, 2019
Latest reply on Feb 17, 2019 by Casey Kelso

When writing to sector 0x0 starting at location 0x0 iap write returns error code 21 which is not defined in the user guide or fsl_flashiap.h. I'm using the same code to write to sector 7 without any issues. I'm using a dual enhanced image to boot from sector 7, and then attempt to write to sector 0.  If I boot from sector 0 and write to sector 7, the same logic works perfectly.

 

Is error 21 defined?

 

/*@}*/

/*!
* @brief Flashiap status codes.
*/
enum _flashiap_status
{
kStatus_FLASHIAP_Success = kStatus_Success, /*!< Api is executed successfully */
kStatus_FLASHIAP_InvalidCommand = MAKE_STATUS(kStatusGroup_FLASHIAP, 1U), /*!< Invalid command */
kStatus_FLASHIAP_SrcAddrError =
MAKE_STATUS(kStatusGroup_FLASHIAP, 2U), /*!< Source address is not on word boundary */
kStatus_FLASHIAP_DstAddrError =
MAKE_STATUS(kStatusGroup_FLASHIAP, 3U), /*!< Destination address is not on a correct boundary */
kStatus_FLASHIAP_SrcAddrNotMapped =
MAKE_STATUS(kStatusGroup_FLASHIAP, 4U), /*!< Source address is not mapped in the memory map */
kStatus_FLASHIAP_DstAddrNotMapped =
MAKE_STATUS(kStatusGroup_FLASHIAP, 5U), /*!< Destination address is not mapped in the memory map */
kStatus_FLASHIAP_CountError =
MAKE_STATUS(kStatusGroup_FLASHIAP, 6U), /*!< Byte count is not multiple of 4 or is not a permitted value */
kStatus_FLASHIAP_InvalidSector =
MAKE_STATUS(kStatusGroup_FLASHIAP,
7), /*!< Sector number is invalid or end sector number is greater than start sector number */
kStatus_FLASHIAP_SectorNotblank = MAKE_STATUS(kStatusGroup_FLASHIAP, 8U), /*!< One or more sectors are not blank */
kStatus_FLASHIAP_NotPrepared =
MAKE_STATUS(kStatusGroup_FLASHIAP, 9U), /*!< Command to prepare sector for write operation was not executed */
kStatus_FLASHIAP_CompareError =
MAKE_STATUS(kStatusGroup_FLASHIAP, 10U), /*!< Destination and source memory contents do not match */
kStatus_FLASHIAP_Busy =
MAKE_STATUS(kStatusGroup_FLASHIAP, 11U), /*!< Flash programming hardware interface is busy */
kStatus_FLASHIAP_ParamError =
MAKE_STATUS(kStatusGroup_FLASHIAP, 12U), /*!< Insufficient number of parameters or invalid parameter */
kStatus_FLASHIAP_AddrError = MAKE_STATUS(kStatusGroup_FLASHIAP, 13U), /*!< Address is not on word boundary */
kStatus_FLASHIAP_AddrNotMapped =
MAKE_STATUS(kStatusGroup_FLASHIAP, 14U), /*!< Address is not mapped in the memory map */
kStatus_FLASHIAP_NoPower = MAKE_STATUS(kStatusGroup_FLASHIAP, 24U), /*!< Flash memory block is powered down */
kStatus_FLASHIAP_NoClock =
MAKE_STATUS(kStatusGroup_FLASHIAP, 27U), /*!< Flash memory block or controller is not clocked */
};

Outcomes