大家好,我需要你们的帮助:/我有许多设备拥有相同的引导加载程序和应用程序,它们都是由MyPrimor开发并用HTC编译的。两个都是多年来开发的,所以代码不太好。我用MPLAB X和XC8编译器开发了一个新的应用程序FFW,因为我认为HTC的引导加载程序和XC8的应用程序不会有问题。如果我包含了Bootloader的HEX文件,请给出我的应用程序。在一个代码偏移,编译与XC8和程序(与拾取2)的PIC18F45 85一切都很好。我可以通过bootloader毫无问题地闪烁新的应用程序fw。但是如果我编程“旧的”十六进制文件(使用HTC编译的应用程序的引导加载程序)并试图通过bootloader升级应用程序(使用XC8编译的新应用程序),控制器永远不会进入应用程序部分:/。如果使用XC8编译旧应用程序,但不使用HTC编译,则会发生。使用HTC->旧应用程序编译的Bootlaoder-hex文件可以通过引导加载程序升级,新的不是。使用XC8->旧应用程序编译的Bootlaoder-hex文件既不是旧固件也不是新固件。可以通过bootloader升级。用XC8->新应用程序编译的Bootloader-hex-file可以升级,旧的应用程序。我不知道如何修复这个错误或者我做错了什么,你呢?最好的问候Goku
以上来自于百度翻译
以下为原文
Hello guys, i need your help :/
I have many devices with the same bootloader and an applica
tion, both developed by my predecessor and compiled with HTC. Both were developed over many years and so the code isn't well looking.
I developed a new application fw with MPLAB X and the XC8 compiler, because I thought that there would be no problem with an bootloader from HTC and an application from XC8.
If I include the bootloader hex file, give my application a codeoffset, compile that with XC8 and program (with a PICkit 2) the PIC18F4585 everything works fine. I can flash a new application fw without any problem via bootloader.
But if I program the 'old' hex file (bootloader with application compiled with HTC) and try to upgrade the application (new one compiled with XC8) via bootloader, the controller never enters the application part :/.
The same problem occures if I compile the old application with XC8, but not if I compile it with HTC.
Bootlaoder-hex-file compiled with old application with HTC -> old firmware can be upgraded via bootloader, new one not.
Bootlaoder-hex-file compiled with old application with XC8 -> neither old or new firmware can be upgraded via bootloader.
Bootloader-hex-file compiled with new application with XC8 -> new application can be upgraded, old application not.
I have no clue how I can fix that or what I'm doing wrong, do you?
Best regards Goku