How to flash sector 0

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

How to flash sector 0

460 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by claudio.destro on Mon Feb 01 23:30:54 MST 2016
Hello guys,

Maybe an old question:

How to flash sector 0 of my LPC2368 by using serial ISP?

I remember I need to do something special in order to write/read sector 0, but I was not able to find any documentation/example about it.

I am implementing my own programmer in node.js/electron, all works fine except for sector 0: my ARM code doesn't run.

I know the ARM code works because it is production code and FlashMagic can flash it, thus I would include it in the list of working software

ISP sequence:

<--- U 23130
---> 0
<--- P 0 1
---> 0
<--- E 0 1
---> 0
<--- W 1073752064 4096
...
---> OK
<--- U 23130
---> 0
<--- P 0 0
---> 0
<--- C 0 1073752064 4096
---> 0
<--- W 1073752064 4096
...
---> OK
<--- U 23130
---> 0
<--- P 1 1
---> 0
<--- C 4096 1073752064 4096
---> 0


Thank you in advance

Claudio
Labels (1)
0 Kudos
2 Replies

383 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by claudio.destro on Tue Feb 02 23:52:21 MST 2016
Thank you!
downloaded/compiled lpc21isp ... and it succeeded ;(
I am clearly doing something wrong :)

by reading the code, it seems there is no something special to do except for erasing sector 0 first and flashing it last.
... and (maybe last but not least) patching the vector table so that the checksum will be 0 (otherwise the hardware boot loader keeps taking control endlessly): I think this is the key point.
Thanks
0 Kudos

383 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mysepp on Tue Feb 02 10:33:23 MST 2016
Have a look at "lpc21isp". There is also a option to write debug output, which contains all exchanged data.
Perhaps you can compare your sequence with the one of lpc21isp.
0 Kudos