Content originally posted in LPCWare by Andrew on Tue Sep 18 01:45:09 MST 2012
Exactly the same as Command code: 54 (decimal). I am using same pointer for in and out parameters, as follows:
#define IAP_LOCATION (0x1fff1ff1UL)
typedef union
{
struct
{
uint32_t cmd;
uint32_t param[4];
} in;
struct
{
uint32_t status;
uint32_t result[4];
} out;
} flash_cmd_t;
typedef void (*iap_t)(flash_cmd_t *cmd_arg, flash_cmd_t *status_arg);
static const iap_t iap_entry = (iap_t)IAP_LOCATION;
static flash_cmd_t flash_params;
flash_params.in.cmd = 54;
iap_entry(&flash_params, &flash_params);
if (flash_params.out.status == 0) //status should be zero, but it's actually 54
{
ret_id = flash_params.out.result[0];// even though this value is correct
}