Цитата(murug @ Dec 24 2010, 14:59)

Прерывания в общем случае не отключаются:
"5.2.7 Interrupts during IAP
...
The IAP code does not use or disable interrupts."
(User manual на LPC24XX)
однако, во всех примерах от производителя, прерывания стабильно отключаются
Код
/*
* Erase Sector between 'start' and 'end'
* Return: IAP error code (0 when OK)
* NOTES: start needs to be a 256 byte boundary
* size should be 256, 512, 1024 or 4089
*/
unsigned int IAP_erase () {
struct iap_in iap; // IAP input parameters
unsigned int result[3]; // IAP results
unsigned int save_VicInt; // for saving of interrupt enable register
save_VicInt = VICIntEnable; // save interrupt enable status
VICIntEnClr = 0xFFFFFFFF; // disable all interrupts
stop_pll(); // IAP requires to run without PLL
iap.cmd = 50; // IAP Command: Prepare Sectors for Write
iap.par[0] = 0; // start sector
iap.par[1] = 27; // end sector
iap_entry (&iap, result); // call IAP function
if (result[0]) goto exit; // an error occured?
iap.cmd = 52; // IAP command: Erase Flash
iap.par[0] = 0; // start sector
iap.par[1] = 27; // end sector
iap.par[2] = CCLK; // CPU clock
iap_entry (&iap, result); // call IAP function
exit:
start_pll(); // start PLL
VICIntEnable = save_VicInt; // enable interrupts
return (result[0]);
}
извиняюсь, убрал из функции начальный и конечный сектор, стирается все содержимое сразу, но смысл не меняется