• AVR Freaks

Hot!CRC difference between EZBL bootloader generated .hex and .bl2 on dsPIC33EV256GM106

Author
balakumaran
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2016/11/24 01:34:58
  • Location: 0
  • Status: offline
2019/12/04 19:12:03 (permalink)
0

CRC difference between EZBL bootloader generated .hex and .bl2 on dsPIC33EV256GM106

Hello Everyone,
I am using EZBL bootloader in dsPIC33EV256GM106, EZBL bootloader is flashing and working fine on my custom board. I got some simple sample for calculating CRC of program memory. The CRC value of the hex file and the converted .bl2 file CRC value is not matching. This is strange why it does  changes CRC value.
 

 
void CRCCalculation() {
    crcPMValue = 0;
    int i;
    uint32_t dwvResult0, dwvResult1;
    uint16_t wTBLPAGSave;
    wTBLPAGSave = TBLPAG;
    TBLPAG = ((uint32_t*) 0x0200);
    for (i = 0; i < 13526; i++) {
        dwvResult1 = __builtin_tblrdh((uint16_t) i);
        dwvResult0 = __builtin_tblrdl((uint16_t) i);
        i++;
        crcPMValue = crcPMValue + dwvResult1 + (dwvResult0 >> 8) + dwvResult0;
    }
    TBLPAG = wTBLPAGSave;
}

 
Note: CRC value print through UART.
 
thanks you,

 
 
#1

1 Reply Related Threads

    Stampede
    Super Member
    • Total Posts : 403
    • Reward points : 0
    • Joined: 2006/10/04 05:59:28
    • Location: Germany
    • Status: offline
    Re: CRC difference between EZBL bootloader generated .hex and .bl2 on dsPIC33EV256GM106 2019/12/06 01:49:09 (permalink)
    0
    Hvae you noticed that the Bl2 CRC covers different data than the hex? They are both completely different formats, thus teh CRC must be different
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5