Microchip
直播中

宫昊

7年用户 237经验值
私信 关注
[问答]

怎么计算引导加载程序固件的CRC?

您好,我使用PIC32 MZ2048 EFH064,MPLABX3.40,XC32 V1.42,和声V2.01B。我的PC应用程序使用MS Visual C++ 2010 Express。我不想用Microchip的PIC32下载器来构建自己的下载器,我想用PC主机应用程序下载我的自定义加密固件。现在问题是,我能够连接和下载Bootloader固件使用我的自定义应用程序,但CRC验证(即程序验证)是失败的。因为通过固件计算和发送的CRC与我的自定义应用程序为HEX文件计算的CRC不匹配。现在我的观察是:两个都使用相同的地址范围和相同的程序长度,其中CRC被计算。地址范围是:0x9Fc0000—0x9FC0FF4。两个都使用相同的CRC表,CRC例程来计算CRC。我想问一下,计算CRC是否应该包括配置寄存器区?

以上来自于百度翻译


      以下为原文

    Hi, I am using PIC32MZ2048EFH064, MPLABx3.40, XC32 V1.42, HARMony V2.01b. And my PC app is using MS Visual C++ 2010 Express.
  Instead of using microchip's Pic32 downloader I want to build my own downloader and, I want to download my custom encrypted firmware using PC host application. Now problem is, I am able to connect and download the bootloader firmware using my custom app, but CRC verification (i.e. program verification) is failed. Because the CRC calculated (and sent) by firmware doesn't matches to the CRC calculated by my custom app for the hex file. Now my observations are :
  • Both are using same address range and same program length over which CRC is calcuated.
  • Address range is : 0x9FC00000 - 0x9FC0FFF4.
  • Both are using same CRC table, CRC routine to calculate CRC.

I want to ask that, whether calculating CRC should include config register area also?

回帖(2)

李天竹

2019-3-5 11:57:46
我建议你从芯片上读取这个区域,并把它与你想写的东西进行比较。如果它们是相同的,问题就在CRC。

以上来自于百度翻译


      以下为原文

    I suggest you read the area from the chip and compare it with what you wanted to write. If they're the same the problem is in CRC.
举报

张珊珊

2019-3-5 12:09:26
感谢吉姆和NothGee,正如吉姆所建议的,我的自定义应用程序HEX文件正在生成所有0xFF的图像,然后将HEX文件放置在链接器中建议的相同位置。

以上来自于百度翻译


      以下为原文

    Thanks Jim and NorthGuy, As Jim suggested, My custom app hex file is generating image of all 0xff and after that its placing the hex file in same locations as suggested in linker.
And, NorthGuy, I really need to try this option to read back and compare it.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分