IAP sector erase failure

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by tioui657 on Fri Apr 18 08:23:44 MST 2014

I use a LPC4357 on a Keil MCB4357 evaluation bord and need some help.
Own project use 12Mhz crystal oscillator with PLL1 to clock M4 core at 120Mhz. When i'am trying to prepare and erase one or few sectors in flash bank A or B with IAP services, they will fail to erase the 1'st one with IAP command success return code. The parameter3 of erase sector IAP command will be set to CPU Clock Frequency (CCLK) in kHz at 120000.

void erase_sector(uint32_t start_sector, uint32_t end_sector, uint32_t flash_bank)
param_table[0] = ERASE_SECTOR;
param_table[1] = start_sector;
param_table[2] = end_sector;
param_table[3] = CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE)/1000;
param_table[4] = flash_bank;