Self-Erasing Program for CRP level 3 testing

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

Self-Erasing Program for CRP level 3 testing

1,833 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MarcVonWindscooting on Thu Apr 24 15:52:17 MST 2014
As a part of testing my (soon to be released version 3.0 of) 'mxli' I wrote an LPC17xx program that uses CRP levels 1,2 and 3.
The program uses UART0 at 115200bd, 8N1, connected to the same pins as the ISP boot loader and outputs a message after boot up. If you enter a '!' it will commit suicide and erase the whole FLASH. That way it's possible to test CRP level 3 without risk of losing the device.

I share the program with you, in case you want to test your FLASH-programming equipment's CRP features and you suffer from increased adrenaline levels and tremor when only thinking about that :O
I tested the program with LPC1754, LPC1764, LPC1758.

The archive contains the binary images crp1.bin .. crp3.bin. These images contain the corresponding CRP codes.
Do [color=#f00]NOT[/color] use these images, if you don't have access to UART0 pins P0.2 and P0.3 on your board !!

Please have a look at the source code, before using the binary images. If you don't agree with the program's sector-scanning erasure algorithm, then don't use it!

Original Attachment has been moved to: self-erase.c.zip

Original Attachment has been moved to: self-erase.tar.bz2

Labels (1)
0 Kudos
Reply
6 Replies

1,637 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MarcVonWindscooting on Sat Apr 26 04:14:24 MST 2014
Re-invoke ISP is a cleaner solution than mine, because it can't be interrupted by a premature RESET or power down like my approach (at program execution time). Also, my code 'returns' to erased FLASH contents. This is effectively a FLASH full of NOPs (branch . +2) and quickly the program counter runs across the FLASH upper limit...

@usb10185:
I do prefer binary images rather than source code here to eliminate the risk of a compilation/linking error.
0 Kudos
Reply

1,637 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by usb10185 on Fri Apr 25 16:55:07 MST 2014
@R2D2, yep, twas a dead link. Fixed now. Thanks for the patience!
0 Kudos
Reply

1,637 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri Apr 25 13:49:21 MST 2014
Seems to be a Dead link here...

AN10851 can be downloaded here:

http://www.nxp.com/documents/application_note/AN10851.zip
0 Kudos
Reply

1,637 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by usb10185 on Fri Apr 25 12:56:09 MST 2014
You may not be logged in, seems to work here ok..
0 Kudos
Reply

1,637 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri Apr 25 11:00:10 MST 2014

Quote: usb10185
NXP have an application note that does something similar, see:
http://www.lpcware.com/content/nxpfile/an10851-crp-example-source-code



:quest:


Quote:
We are sorry, but the page you requested is not available (404)

0 Kudos
Reply

1,637 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by usb10185 on Fri Apr 25 10:18:21 MST 2014
NXP have an application note that does something similar, see:
http://www.lpcware.com/content/nxpfile/an10851-crp-example-source-code
0 Kudos
Reply