How to IAP Sector0?

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

How to IAP Sector0?

1,119 Views
petervanhoomiss
Contributor III

I have started several threads and worked through most of my problems however I can not seem to get past this one. 

I am not able to erase or program the first 512bytes of sector0. All of my IAP commands return CMD_SUCCESS. But when I read back after an erase the data in the first 512bytes is the same. The rest of the sector will be erased properly after programming, and written properly after a write. The CRP is set to 0xFFFFFFFF, I relocate the interrupt table to RAM, but nothing seems to change the behavior. 

I am able to program data into the first 512bytes if I use the minimum write size of 256bytes however the data is full of errors. There are bits set that shouldn't be and some that should are not. Worse, after I write the chip no longer responds to IAP commands, including check ID. They never return a response, and the DHCSR reports that the core is in "LOCKUP". I am still able to read the JTAG id and write to the DPs and APs, even read and write to RAM, and read flash. But as soon as I try an IAP command the core locks up. I am not sure what it is about the state of the chip that causes it to lock, as erasing the chip with a ULink2 is able to recover it.

I see that several other people have posted about this issue in the LPC Forums but not with these specifics. I believe some guidance from an NXP engineer is needed.

Best regards,

Peter

Labels (1)
0 Kudos
3 Replies

795 Views
gracezhang
Contributor I

Hi,

We have the same problem for LPC8N04 device. Sector0 can't be erased and programmed use IAP method, while JFlash could erase and program sector 0. Not sure how JFlash do that. If you have this problem solved, please share the answer.

Thanks.

Grace

0 Kudos

795 Views
gracezhang
Contributor I

Problem solved. Set interrupt vectors reside in Flash, then erase/program sector0 works as expected.

/*----------------------------------------------------------------------------
Setup() configure PC & SP for RAM Debug
*----------------------------------------------------------------------------*/

FUNC void Setup (void) {
SP = _RDWORD(0x10000000); // Setup Stack Pointer
PC = _RDWORD(0x10000004); // Setup Program Counter
_WDWORD(0xE000ED08, 0x10000000); // Setup Vector Table Offset Register (CM0+ has VTOR register)
//_WDWORD(0x40048000, 0x00000001); // Interrupt vectors are re-mapped to Static RAM
}

Thanks.

0 Kudos

795 Views
axelschmidt
Contributor I

Hi ,

did you solve the problem in the mean time?

We have the same problem.

Best regards

Axel

0 Kudos