View previous topic :: View next topic |
Author |
Message |
georpo
Joined: 18 Nov 2008 Posts: 281 Location: Athens, Greece.
|
bootloader crc |
Posted: Sun Dec 13, 2020 12:48 pm |
|
|
Hello,
I have seen that the loader_pcd checks each line checksum and then writes to program memory.
What if some lines are OK but some lines are bad data? Do I get a corrupt PIC?
In my tests, I send the hex file 2 times and write to 2 different locations of external flash, then compare the 2 files byte by byte and only if they are OK, I write them to the program memory.
This of course works but needs big flash etc.
How can I calculate the CRC of the hex file so I can send the hex file only once?
Code: |
;DSPIC33FJ64GP804
;CRC=8C7D CREATED="13-Dec-20 19:44"
|
_________________ George. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
georpo
Joined: 18 Nov 2008 Posts: 281 Location: Athens, Greece.
|
|
Posted: Sun Dec 13, 2020 1:14 pm |
|
|
Thanks PCM programmer!
I have the hex file in external flash.
Below are the last lines:
Code: |
:1059E0008410020000000000F81202000000000015
:1059F000A415020000000000B8270200000000000B
:085A0000FFFF37000040FE002B
:00000001FF
;DSPIC33FJ64GP804
;CRC=8C7D CREATED="13-Dec-20 19:44"
|
So, which is the last ASCII character that I will pass through the CRC16 code?
Is it the last 'F' before the 1st ';'? _________________ George. |
|
|
georpo
Joined: 18 Nov 2008 Posts: 281 Location: Athens, Greece.
|
|
Posted: Sun Dec 13, 2020 1:51 pm |
|
|
I got it.
It includes the ";DSPIC33FJ64GP804" line but not the CRC line.
It WORKS!
Thanks!!!!!! _________________ George. |
|
|
|