Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - deeeed

#1
For information, when i try to copy to flash from address 512 and more, it works correctly.
It's just for writting from flash address 0 to 512...
#2
Hello,
i don't understand how to compute the first 512 bytes from my hex files. I think i have to compute something relative to "Criterion for Valid User Code" :
4.1.1 Criterion for Valid User Code
      Criterion for valid user code: The reserved ARM interrupt vector location (0x0000 0014)
      should contain the 2's complement of the check-sum of the remaining interrupt vectors.
      This causes the checksum of all of the vectors together to be 0. The boot loader code
      disables the overlaying of the interrupt vectors from the boot block, then checksums the
      interrupt vectors in sector 0 of the flash. If the signatures match then the execution control
      is transferred to the user code by loading the program counter with 0x0000 0000. Hence
      the user flash reset vector should contain a jump instruction to the entry point of the user
      application code.
I don't understand what it means in practise...
Here is a small example of my isp session logs for write:
Quote
[INFO] Sending command: W 1073742336 512
+ W 1073742336 512
- W 1073742336 512
0

END_W ret: 0
[INFO] Sending command: M$0``ZA3PG^44\)_E%/"?Y13PG^4``*#A$/"?Y1#PG^4X````/````$````!$
[INFO] Sending command: M````B`$``$@```#^___J_O__ZO[__^K^___J_O__ZAP!G^6J$*#C52"@XR`P
[INFO] Sending command: MH..@,8#EH#&0Y4`P$^+\__\*`3"@XPPQ@.4),*#CA#"`Y8P0@.6,((#E`3"@
[INFO] Sending command: MXX`P@.6,$(#EC""`Y8@PD.4!,Q/B_/__"H@PD.7(0)_E!#`#X`E`H.,$,#/@
[INFO] Sending command: M^?__&@0PH.,$,8#E!3"@XP@Q@.4%,Z#CJ#&`Y0`PH..L,8#E`S"@XX`P@.6,
[INFO] Sending command: M$(#EC""`Y8@`G^7;\"'C`-"@X00`0.+7\"'C`-"@X00`0.+1\"'C`-"@X00`
[INFO] Sending command: M0.+2\"'C`-"@X0$+0.+3\"'C`-"@X0$+0.+?\"'C`-"@X=/P(>,``*#C/!"?
[INFO] Sending command: MY3P@G^4"`%'A!`"!-/S__SH``*#C`!"@X0`@H.$`L*#A`'"@X1R@G^4/X*#A
[INFO] Sending command: M&O\OX?[__^H`P!_@_W__``!Q`$!8!`!`0#``0)T"```$X$[B_U\MZ0`03^$"
[INFO] Sending command: M`"WI`$#@X_\P%.4/X*#A$_\OX0`PH./_,`3E`@"]Z`'P8>'_G_WH!/!>X@3P
[INFO] Sending command: M7N(`,.#C`""@X^L_`^7_(`/E`A"@X?,O`^40,(/B`"\!Y0`^`>4$$('B@`!1
[INFO] Sending command: 1X_K__QH>_R_A`3"@XQ,PH.$`
[INFO] Sending command: 64402
+ 64402
- 6
- 4402
OK

Then i copy the ram to the flash:
Quote
[INFO] Sending command: P 0 27
+ P 0 27
- P
-  0 27
0

END_P ret: 0
[INFO] Sending command: C 0 1073742336 512
+ C 0 1073742336 512
- C
- 0 1073742336 512
0

END_C ret: 0

And finally i try to read data from ram and flash to verify if they are correctly written:
Quote
Dumping memory from ramAddress:1073742336 and flashAddress:0
[INFO] Sending command: R 1073742336 512
+ R 1073742336 512
- 0
Return Code: 0
- $0``ZA3PG^44\)_E%/"?Y13PG^4``*#A$/"?Y1#PG^4X````/````$````!$
- ````B`$``$@```#^___J_O__ZO[__^K^___J_O__ZAP!G^6J$*#C52"@XR`P
- H..@,8#EH#&0Y4`P$^+\__\*`3"@XPPQ@.4),*#CA#"`Y8P0@.6,((#E`3"@
- XX`P@.6,$(#EC""`Y8@PD.4!,Q/B_/__"H@PD.7(0)_E!#`#X`E`H.,$,#/@
- ^?__&@0PH.,$,8#E!3"@XP@Q@.4%,Z#CJ#&`Y0`PH..L,8#E`S"@XX`P@.6,
- $(#EC""`Y8@`G^7;\"'C`-"@X00`0.+7\"'C`-"@X00`0.+1\"'C`-"@X00`
- 0.+2\"'C`-"@X0$+0.+3\"'C`-"@X0$+0.+?\"'C`-"@X=/P(>,``*#C/!"?
- Y3P@G^4"`%'A!`"!-/S__SH``*#C`!"@X0`@H.$`L*#A`'"@X1R@G^4/X*#A
- &O\OX?[__^H`P!_@_W__``!Q`$!8!`!`0#``0)T"```$X$[B_U\MZ0`03^$"
- `"WI`$#@X_\P%.4/X*#A$_\OX0`PH./_,`3E`@"]Z`'P8>'_G_WH!/!>X@3P
- 7N(`,.#C`""@X^L_`^7_(`/E`A"@X?,O`^40,(/B`"\!Y0`^`>4$$('B@`!1
- X_K__QH>_R_A`3"@XQ,PH.'A
- 64402
[INFO] Sending command: OK
+ OK
- OK
-

[INFO] Sending command: R 0 512
+ R 0 512
- 0
Return Code: 0
- &$"?Y1!0G^4`8)3E!F`%X`!@A.4$\!_E0.#_?_^___\`@/\_````````````
- `````````````````````````/[__^K^___J_O__ZAP!G^6J$*#C52"@XR`P
- H..@,8#EH#&0Y4`P$^+\__\*`3"@XPPQ@.4),*#CA#"`Y8P0@.6,((#E`3"@
- XX`P@.6,$(#EC""`Y8@PD.4!,Q/B_/__"H@PD.7(0)_E!#`#X`E`H.,$,#/@
- ^?__&@0PH.,$,8#E!3"@XP@Q@.4%,Z#CJ#&`Y0`PH..L,8#E`S"@XX`P@.6,
- $(#EC""`Y8@`G^7;\"'C`-"@X00`0.+7\"'C`-"@X00`0.+1\"'C`-"@X00`
- 0.+2\"'C`-"@X0$+0.+3\"'C`-"@X0$+0.+?\"'C`-"@X=/P(>,``*#C/!"?
- Y3P@G^4"`%'A!`"!-/S__SH``*#C`!"@X0`@H.$`L*#A`'"@X1R@G^4/X*#A
- &O\OX?[__^H`P!_@_W__``!Q`$!8!`!`0#``0)T"```$X$[B_U\MZ0`03^$"
- `"WI`$#@X_\P%.4/X*#A$_\OX0`PH./_,`3E`@"]Z`'P8>'_G_WH!/!>X@3P
- 7N(`,.#C`""@X^L_`^7_(`/E`A"@X?,O`^40,(/B`"\!Y0`^`>4$$('B@`!1
- X_K__QH>_R_A`3"@XQ,PH.'A
- 62230
[INFO] Sending command: OK
+ OK
- OK

So, here we can see that the data are correct in the ram but not in the flash. I would like to understand how to modifiy my first 512 bytes to be correct after the copy to the flash. Any idea? ;)
When i look how FlashMagic send theses firsts bytes i can see that:
4D 24 30 60 60 5A 41 33 50 47 5E 34 34 5C 29 5F 45 25 2F 22 3F 59 31 33 50 47 5E 35 5F 37           M$0``ZA3PG^44\)_E%/"?Y13PG^5_7
54 22 54 24 2F 22 3F 59 31 23 50 47 5E 34 58 60 60 60 60 2F 60 60 60 60 24 60 60 60 60 21           T"T$/"?Y1#PG^4X````/````$````!
24 0D 0A                                                                                            $..

So we can see a difference "4``*#A" and 5_7T"T, I think it's something like a program checksum but i don't find a good documentation which could explain how to compute it.
Please help me ;)
Arthur
#3
I finally found how to compute the final checksum, it's just the sum of all the non encoded data.
#4
I have another checksum problem  :'(, i don't know how to determin the last checksum after a read or a write command.

ISP command:
57 20 31 30 37 33 37 34 32 33 33 36 20 35 31 32 0D 0A                                               W 1073742336 512..

Then send the data after CMD_SUCCESS.
*** Sending the uuencoded data ***

Finally we send the checksum:
31 32 33 31 36 35 0D 0A                                                                             123165..

For example the checksum for "W addr 512" seems to be always 123165, how do you compute this number ?
I read the datasheet but they don't explain how to determin this number.
#5
Thanks for your answer, now it's easier ;)
#6
Hello,
i'm using flash magic to program my lpc2368 and it works very good.
Actually i would like to write my own embedded programmer but when I analyze how flash magic program the mcu there is something i don't understand.
First it sends the write command and wait for CMD_SUCCESS:
57 20 31 30 37 33 37 34 32 33 33 36 20 35 31 32 0D 0A                                               W 1073742336 512..
Then it can send the 61 uuencoded data + \r\n :
4D 24 30 60 60 5A 41 33 50 47 5E 34 34 5C 29 5F 45 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 2B 27           M$0``ZA3PG^44\)_E___________+'
5C 21 2A 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F           \!*___________________________
5F 0D 0A   
     
                                                                                                                                    _..

I just don't understand the first byte of the data 4D, i think it's something relative to the size the data but i don't know how to compute it. I also think it is used for computing the final checksum after sending uuencoded data.
So here my questions are: how to guess the first byte of data ? and how to compute the final checksum ?
Arthur

ps: Sorry for my really bad english