ISP: Fail to copy to the first 512 bytes of sector 0 of FLASH

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

ISP: Fail to copy to the first 512 bytes of sector 0 of FLASH

448 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrenvq on Sun Mar 06 23:50:33 MST 2016
So I tried to flash LPC1768 through ISP starting at FLASH address 0x00. I am flashing 256 bytes at once. The first two runs that flashes at FLASH address 0x00 and 256 fails as can be seen below, then the third run and so on run just fine; however, the code runs fine on LPC1768. I commanded the ISP bootloader to read FLASH and RAM content to check validity.

What I checked:
1. Correct checksum at 0x1C
2. Return code from all commands are 0
3. Contents in RAM are correct, checked with online UU-encoder
4. I did call unlock 231300
5. I did call prepare command for sector 0 as in "P 0 0"


Synchronized
SynchronizedOK
12000OK
U 231300

P 0 290
E 0 290
A 0
0
0
0 <-- "W 268435968 256"
OK <- checksum
0 <- P 0 0
0 <- C 0 268435968 256
0 <- R 268435968 256
M`(``$`T"```5`@``%P(``!D"```;`@``'0(``'9S_^\````````````````?
M`@``(0(````````C`@``)0(``"<"```G`@``)P(``"<"```G`@``)P(``"<"
M```G`@``)P(``"<"```G`@``)P(``"<"```G`@``)P(``"<"```G`@``)P(`
M`"<"```G`@``)P(``"<"```G`@``)P(``"<"```G`@``)P(``"<"```G`@``
M)P(``"<"```G`@``)P(```#P`O@`\);X"J"0Z``,@D2#1*KQ`0?:10'1`/"+
?^*_R"0ZZZ`\`$_`!#QB_^QI#\`$#&$D0P``1$,`````
8428
0 <- R 0 256
M_!\`$($`_Q\`````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````````#?^!A`W_@0
M4"9H!>H&!B9@W_@`\`$"_Q__O___P,,/0```````````````````````````
M````````````````````````````````````````````````````````````
?````````````````````````````````````````````
4789
0
OK
0
0
0
M$#HDOWC(>,'ZV%(')+\PR##!1+\$:`Q@<$<````C`"0`)0`F$#HHOWC!^]A2
M!RB_,,%(OPM@<$=N*0#PD8-P*0#PQX1F*0/P18=E*0/P0H=G*0/P/X=A*0/P
M/H<#:!L**+]!\(`!:2D`\#Z#9"D`\#N#=2D`\#B#;RD`\%6$>"D`\).$Z2D`
M\.^#Y"D`\.R#]2D`\.F#[RD`\%*$^"D`\)*$`VC;"2B_0?"``6,I`?#Q@W,I
M`?#V@^,I`?`!A/,I`?`&A``@<$<?M9WH`P``\%?_`?"S_@0``"``(0/P_/U`
?'&!@`"``(0/PX/W@8`#PD?X`\"_Z'[T"\-C]$4;_]_?W
27771
0
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
?````````````````````````````````````````````
0
0
OK
0
0
0
MX_\"\*3\`O`7_P``!DB`1P9(`$?^Y_[G_N?^Y_[G_N?^Y_[G_N?^YY4K``#%
M````"T8!1AA&`/`GNP``#[0`M8VP$*D)D`"1"Y!/\/\P"I``(`R0!DAX1`:0
M!DAX1&I&!Y`/F0FH`/`)_0VP7?@4^T,*``!;"@``<+4$1L!H@0<3T(`&`=6E
M:@3@H6E@:`A$(6E%&B!&`/#Y_0`B!D8I1B!&`/`?_3!&<+T`('"]<+40L;WH
M<$#?YP`E!TQN'@?@($;_]]G_`+$U1B!M(/`!!``L]=$H1G"]?`(`$#HH`-(P
?."#P(`)!*@'3HO$W`(A"`=-/\/\P<$=P1W!'________
27231
0
MX_\"\*3\`O`7_P``!DB`1P9(`$?^Y_[G_N?^Y_[G_N?^Y_[G_N?^YY4K``#%
M````"T8!1AA&`/`GNP``#[0`M8VP$*D)D`"1"Y!/\/\P"I``(`R0!DAX1`:0
M!DAX1&I&!Y`/F0FH`/`)_0VP7?@4^T,*``!;"@``<+4$1L!H@0<3T(`&`=6E
M:@3@H6E@:`A$(6E%&B!&`/#Y_0`B!D8I1B!&`/`?_3!&<+T`('"]<+40L;WH
M<$#?YP`E!TQN'@?@($;_]]G_`+$U1B!M(/`!!``L]=$H1G"]?`(`$#HH`-(P
?."#P(`)!*@'3HO$W`(A"`=-/\/\P<$=P1W!'________
27231
0



Why is this happening? Is it normal?
Labels (1)
0 Kudos
3 Replies

399 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos

399 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrenvq on Sun Mar 13 01:11:20 MST 2016
I tried the method and then reset to let the code runs. It didn't work. I checked if I receive 'OK' and '0', I did, but still cannot write to FLASH.
0 Kudos

399 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DF9DQ on Mon Mar 07 09:32:08 MST 2016
This happens when the boot code is visible at address 0 (see SYSMEMREMAP register).
You should change this register to contain 1, so that the user flash becomes mapped to address 0.

It is not possible to write to a register via ISP, so you must download and execute a small piece of code to do it.
Download the following 12 bytes to address 0x10000200, and execute them in Thumb mode:
0x01 0x48 0x01 0x21 0x01 0x60 0x70 0x47 0x40 0xC0 0x0F 0x40

Send:     W 268435968 12
Receive:  0
Send:     ,`4@!(0%@<$=`P`]`
Send:     722<CR>
Receive:  OK
Send:     G 268435968 T
Receive:  0


After that it should be possible to program/verify the first 512 bytes.


0 Kudos