LPC1769 CRP3 sector 0 problem

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

LPC1769 CRP3 sector 0 problem

1,039 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wernerc on Tue Aug 06 04:55:03 MST 2013
Hello,

since a long time I am using the LPC1769 with CRP3 code protection for some devices I manufacture.
Normally a new firmware is upload via the once programmed bootloader, no problems here up to now.

But now I need to update the bootloader itself and therefore to erase sector 0 (or the complete chip) which holds the CRP3 protection data.
I tried to erase sector 0 like any other sector from the downloaded firmware, the sector is not erased and keeps intact !

I thought about the erasing all sectors at once with IAP like when using ISP with CRP modes 1 and 2, but using this I screwed up several devices as it seems that all sectors except sector 0 are erased only. And my bootloader is larger than sector 0 !

Another try was to activate ISP handler and erase manually with IAP command 57 decimal, but this didn't work either.

I even tried to check the stack not to be conflicting with IAP/ISP code as well as executing the erase code from RAM, nothing worked.

Any ideas from someone ?
  

Regards
Labels (1)
0 Kudos
Reply
3 Replies

940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wernerc on Tue Aug 06 06:36:43 MST 2013
Finally I now got a solution.

I tried with some tests using CRP2 so being able to erase manually on external request for the tests.
Sometimes the IAP prep function seems not to return the needed CMD_OK code, cancelling the erase call for sector 0.
I ignored the prep return code and everything works fine.

Regards
0 Kudos
Reply

940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wernerc on Tue Aug 06 05:31:38 MST 2013
I verified with a downloaded code to erase any sectors except those ones than the bootloader uses with IAP commands without problems, keeping the bootloader intact.
If I delete any of the bootloader sectors the system hangs of course, but I am not able to erase sector 0 alone (or as a complete block of all bootloader sectors or vene chip sectors) which holds the CRP3 protection code !
And when erasing fails, I can't reprogram of course.
And even the ISP command handler cannot be activated like described in the manual (regarding the manual it should be possible to activate by IAP even with CRP3).
Maybe this is a special "feature" of the LPC1769...
0 Kudos
Reply

940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TKoe on Tue Aug 06 05:19:33 MST 2013

Quote: wernerc

But now I need to update the bootloader itself and therefore to erase sector 0 (or the complete chip) which holds the CRP3 protection data.
I tried to erase sector 0 like any other sector from the downloaded firmware, the sector is not erased and keeps intact !

I thought about the erasing all sectors at once with IAP like when using ISP with CRP modes 1 and 2, but using this I screwed up several devices as it seems that all sectors except sector 0 are erased only. And my bootloader is larger than sector 0 !



How did you check if all sectors except 0 were erased? Becaues if you refer to the user manual (chapter 32.6, especially table 596) it pretty much says that when using CRP3 the only way to make *any* changes to the device is by using IAP (both JTAG and ISP are disabled). And IIRC you cannot overwrite the flash section that IAP is used from (I might me wrong there, though).

I guess your best bet is to program another "bootloader" into your user program and overwrite your bootloader in sectors 0+ from there.
0 Kudos
Reply