Microchip
直播中

黄明光

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

如何修复从hightech切换到xc8编译器后的引导加载程序问题

大家好,我需要你们的帮助:/我有许多设备拥有相同的引导加载程序和应用程序,它们都是由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 application, 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

回帖(4)

陈杰

2019-7-19 15:39:55
我想知道您是否可以重建原始引导加载程序和应用程序并使其全部工作?

以上来自于百度翻译


      以下为原文

    I wonder if you can rebuild the original bootloader and application and make it all work ?
 
举报

胡芝恒

2019-7-19 15:53:35
如何处理高、低中断向量位置?

以上来自于百度翻译


      以下为原文

    How do you handle the high and low interrupt vector locations?
举报

张婷婷

2019-7-19 16:07:52
是的,我可以用旧编译器使用旧项目,但我更喜欢用xc8编译的新应用程序项目。但是,如果没有可能的话,我必须优化和补充旧的代码(这是经过多年开发的,您可以看到:/)。应用程序具有正常中断HighApplicationIsr(void)/void中断low_.LowApplicationIsr(void)函数,该函数实现了d引导加载程序有一个GOTO到0x2008/0x2018(应用程序有一个0x2000的偏移量)的a t void中断HighBootloaderIsr(void)/void中断low_.LowBootloaderIsr(void)。不是好方法,而是一种行之有效的方法,那就是我不明白为什么!两个编译器使用不同的方式组合C的指令集,以实现相同的功能性。如果我把两个项目和不同的编译器结合起来,为什么会有这么大的问题呢?

以上来自于百度翻译


      以下为原文

   
Yes, I'm able to use the old projects with the old compiler, but i would prefer to use my new application project compiled with xc8. But if there is no possibility to make it work, I have to optimize and complement the old code (which was developed over years and you can see that :/).


The application has the normal void interrupt HighApplicationIsr(void)void interrupt low_priority LowApplicationIsr(void) functions implemented and the bootloader has a GOTO to 0x2008 / 0x2018 (the application has an offset of 0x2000) at void interrupt HighBootloaderIsr(void)void interrupt low_priority LowBootloaderIsr(void).

The biggest problem isn't that nothing is working, I can use the workaround with the old application firmware (thats not the nice way, but a way that works) , it's that I don't understand why!? The two compiler use different ways of combining the instruction set of the µC to achieve the same funcitonality. Why is it such a big problem if I combine two projects with different compilers?
举报

陈杰

2019-7-19 16:13:00
据我所知:似乎你可以用Mplab X和XC8构建一个引导加载程序和应用程序,所有的工作都可以用XC8引导加载程序[编辑]得很好。它不能用HTC引导加载程序。--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------应用(使用HTC)将HTC引导加载程序更改为XC8引导加载程序,以便我可以继续。这个序列不是简单的,而是可能的,在我的例子中,它要求XC8引导加载程序不使用应用程序共享的内存。

以上来自于百度翻译


      以下为原文

    As I understand the situation:
It seems you can build a bootloader and application with Mplab X and XC8 and all works will [edit]well[/edit]with the XC8 bootloader.
It does not work with the HTC bootloader.
----------------
Providing the config registers do not have to change I found I could build an application ( with HTC ) that changed the HTC bootloader to the XC8 bootloader so I could continue.
This sequence was not straightforward but possible, in my case it required the XC8 bootloader to use no memory shared by the application.
 
举报

更多回帖

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