IAP sector erase failure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IAP sector erase failure

1,300 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tioui657 on Fri Apr 18 08:23:44 MST 2014
Hi,

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;
iap_entry(param_table,result_table);
}
Labels (1)
0 Kudos
Reply
4 Replies

1,204 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tioui657 on Tue Apr 22 05:47:38 MST 2014
For flash bank A, i want to erase sector 4 to 14 (0x1A008000 - 0x1A07FFFF)
For flash bank B, all sectors from 0 to 14 (0x1B000000 - 0x1B07FFFF)
0 Kudos
Reply

1,204 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tioui657 on Tue Apr 22 05:44:22 MST 2014
The M4 core run at 120Mhz, the IAP parameter is set in Khz as 120,000
Thank you,
0 Kudos
Reply

1,204 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MarcVonWindscooting on Sun Apr 20 08:41:17 MST 2014
How do you know, the erase failed? I remember from other LPCs ISP handers, that checksum and blank-check fails for sector 0, because they have some boot ROM remapped there. Maybe your environment does the same/something similar?

What sector exactly did you try to erase?
0 Kudos
Reply

1,204 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Fri Apr 18 11:10:08 MST 2014
120,000 kHz or 12,000 kHz?
0 Kudos
Reply