完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我看了,但是没有找到任何东西。我们有一个可执行的十六进制文件(没有源代码),我们想移动。处理器是PIC18F242,现在正在被PIC18F252取代。原因是我们想使用2个不同的HEX文件和一个引导加载程序,可以跳转到2个不同的HEX文件。一个文件我们有源码,另一个文件只有HEX文件。一个没有源代码的人应该说是16K,而我们有一个源代码,我们可以改变,以便引导加载程序也可以跳到它。因此,在启动时,引导加载程序将跳转到所选文件执行。问题是没有源代码的文件链接到开始向量,我们不能改变它。任何帮助将被赞赏和感谢您提前。
以上来自于百度翻译 以下为原文 Hi, I have looked but not found anything on this. We have an executable hex file (without source code) that we would like to move. The Processor was PIC18F242 and now is being replaced by a PIC18F252. The reason is we want to use 2 different hex files and a boot loader that can jump to the 2 different hex files. One file we have source, the other we only have the hex file. The one that doesn't have the source code should go to say 16k and the one we have source code, we can change so that the bootloader can jump to it also. So at start up, the bootloader will jump to the selected file to execute. The problem is the file without source code was linked to start at the start vector and we can't change it. Any help would be appreciated and Thank you in advance. |
|
相关推荐
8个回答
|
|
HEX文件只在被构建的地方工作。你不能只是移动它。即使有了来源,也很难或不可能做你想做的事情。
以上来自于百度翻译 以下为原文 The Hex file will only work where is was built to work. You can't just move it. Even with the source it would be difficult or impossible to do what you want to do. |
|
|
|
旧的高内存高技术引导加载程序将接受一个未修改的HEX文件,链接到地址0,并在地址0修改其代码,以跳转到引导加载程序。听起来,这种方法可能适用于你想要做的事情。
以上来自于百度翻译 以下为原文 The old high-memory Hi-Tech bootloader would accept an unmodified hex file linked to start at address 0, and modify its code at address 0 to jump to the bootloader instead. It sounds like that approach might work for what you're trying to do. |
|
|
|
看起来他们希望在同一个PIC上有两个十六进制文件,而引导加载程序会选择哪一个来运行。至少这是我对它的解读
以上来自于百度翻译 以下为原文 It looks like they want two hex files on the same pic and the bootloader would choose which one to run. At least that's my reading of it |
|
|
|
嗨,NKurzman,是的,就是这样。我们有一个文件,我们不能改变(没有来源)和一个我们可以(有来源)。没有源的HEX文件运行在OPIC18F242上。我们想把两个文件加载到PIC18F252和引导加载程序,它将选择哪一个也可以跳转。所以,我听到的是,我们需要修改这两个文件。一个重新定位高,另一个我们需要修改,使其跳转到引导器在复位向量。引导加载程序位于上述两个文件的上方。我可以修改并直接编辑HEX文件,使第一条指令跳转到引导加载程序吗?还是会崩溃和燃烧?或者这完全是错误的做法吗?我不熟悉老式的Bootloader。内存映射:--------内存启动---------HEX文件,修改后的重置向量跳到引导加载代码--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------帽子可以跳到任何一个文件----------记忆的末端----------
以上来自于百度翻译 以下为原文 Hi NKurzman, Yes, that is it. We have one file we can't change(no source) and one we can (have source). No source HEX file ran on PIC18F242. We want to have the two files loaded on the PIC18F252 and a boot loader that would chose which one to jump too. So, what I'm hearing from jtemples is that we need to modify both files. One to relocate high and the other we need to modify to make it jump to the bootloader at the reset vector. And the bootloader is located above both of these files. Can I modify and directly edit the hex file to have the first instruction be a jump to the bootloader? Or will that crash and burn? Or is this the wrong approach altogether? I am not familiar with old high-tech bootloader. Memory Map: ----------start of memory------------- Hex file with modified reset vector jump to bootloader code ---------------------------------------- Relocated hex file from source code we have ---------------------------------------- Hi-Tech Bootloader that can jump to either file ------------End of Memory----------- |
|
|
|
当高科技Bootloader接收到第一个HEX文件包(地址0)时,它会将该代码写入Flash中的保留区域,保存在Flash中地址0的引导加载程序的启动代码。当引导装载程序想要启动下载的代码时,它将跳转到保留区域。这依赖于假设下载的应用程序(跳过中断向量)的最初几个指令中的GOTO分支到应用程序的启动代码。如果您的意图是地址0中的HEX文件总是存在并且从未加载过,那么您应该B。E可以编辑HEX文件,手动将代码的初始部分移动到Flash中的保留区域。您还可以在该HEX文件的开头向Bootloader添加一个跳转。对于您有源码的应用程序,您只需将它编译为代码偏移以将其重新定位到高内存。如果在两个程序中使用中断,则还有另一个问题要处理。
以上来自于百度翻译 以下为原文 When the Hi-Tech bootloader received the first packet of a hex file (address 0), it would write that code to a reserved area in flash, preserving the bootloader's startup code that was at address 0 in flash. When the bootloader wanted to launch the downloaded code, it would jump to the reserved area. This relied on the assumption that there wa a GOTO in the first few instructions of the downloaded app (to jump over the interrupt vector(s)) that branched to the startup code of the application. If your intent is that the hex file at address 0 is always there and never bootloaded, then you should be able to edit the hex file to manually move the initial part of the code to a reserved area in flash. You can also add a jump to the bootloader at the beginning of that hex file. For the application you have source code for, you'll just compile it with --codeoffset to relocate it to high memory. If you're using interrupts in both programs you have another issue to deal with. |
|
|
|
我会进一步说,如果两个程序都使用中断,它是一个显示停止器。如果低程序完成,它就可以工作,而高程序不需要。如果低的和高的,它将需要一些仔细的修改。
以上来自于百度翻译 以下为原文 I'd go further, and say it is a show-stopper if both programs use interrupts. It would just work if the low program did, and the high program didn't. It would take some careful modification if low didn't and high did. It would be a huge can of worms if both did. |
|
|
|
旧的十六进制文件中的绝对分支会疯狂。:)
以上来自于百度翻译 以下为原文 Absolute branches in the old hex file would go berserk.... :) |
|
|
|
跟进::我把原来的问题贴在这个帖子上,他决定不走这条路,试着找到解决这个问题的另一种方法。谢谢你的周到的回答。
以上来自于百度翻译 以下为原文 FOLLOW UP::: I posted the original question in this thread for a co-worker and he has decided to not pursue this route and will try to find another way to handle this problem. Thank you for all the thoughtful responses. |
|
|
|
只有小组成员才能发言,加入小组>>
5158 浏览 9 评论
1997 浏览 8 评论
1926 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3169 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2222 浏览 5 评论
722浏览 1评论
605浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
493浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
619浏览 0评论
518浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 07:23 , Processed in 1.422644 second(s), Total 91, Slave 75 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号