完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好。对不起,如果有一个更好的地方,输出是从XC16,所以我想我粘在这里。我在寻找选项和方法,创建一个引导装载和分发固件更新的一个项目的矿山,我一直在建一个工具,“压缩”产生的“生产十六进制文件”在生成项目时提供AT。基本上只是去除(貌似?)多余的记录,将重置的“扩展线性地址”重置为相同的值,并将更多的指令聚合到单个记录中。这些都是很好的BWT.在HEX文件的末尾是什么看起来是配置位。但我有一个问题,希望有人能回答。以下是我感兴趣的内容:现在我将理解它,我可以删除很多:02行,因为它们只是重复设置目的地址的同一个上面的单词,我们可以把它转换成:我可以将这些进一步聚合到一个记录中,但是我会离开。更接近这一点,第一行(0200 000 0400 02F8)似乎把上面的地址字设置为0x002,这意味着第二行,例如,放在地址0x000 02AFE0(除非IVE得到了我的子孙混合在这里,但我认为我还好……),而值似乎M。我在MPLABX中的配置位窗口中看到了什么(例如,FICD有一个FFCF值,它看起来与上面的第二条记录匹配,只有在小字节中),我不能很好地理解地址如何翻译。在MPLABX,FICD在地址0x157f0……当然,它似乎对我选择的PIC(PIC24EP128)似乎没有意义,但是它非常接近于下一个大小的正确的-PIC24EP256,配置字节开始在0x02AFEC附近。但是,实际上,0x000 02AFE0实际上是在用户程序空间内,最后一页,我相信是正确的(再看数据表)。谁能解释一下这一点,或者指出我在这里的想法出了什么问题?这可能是HEX文件输出中的一个bug吗?0x000 02XXXX似乎不是这个PIC家族的有效地址……但是,看起来我不应该把这些作为软件更新的一部分来写,因为它最终能够实现代码保护,所以也许我只是在我重新工作的输出文件中排除了这些行?谢谢!汤姆
以上来自于百度翻译 以下为原文 Hi all. Sorry if there is a better place for this, the output is from XC16 so I figured I'l stick it here. Im looking in to options and methods for creating a bootloader and distributing firmware updates for a project of mine, and Ive been building a tool to "compress" the resulting "production hex file" that is provided when you build the project. Basically just removing (seemingly?) superfluous records that keep resetting the "extended linear address" to the same value, and aggregating more instructions in to a single record. Thats all working great btw. At the end of the hex file are what look to be the configuration bits. But I have a question about what is going on that hopefully someone can answer. Here are the contents that I am interested in: :020000040000fa :020000040002f8 :04afe000cfff00009f :020000040000fa :020000040002f8 :04afe400efff00007b :020000040000fa :020000040002f8 :04afe8006aff0000fc :020000040000fa :020000040002f8 :04afec001bff000047 :020000040000fa :020000040002f8 :04aff00078ff0000e6 :020000040000fa :020000040002f8 :04aff400ffff00005b :00000001FF Now as I would understand it, I can remove a lot of the :02 lines, since they are just repeatedly setting the same upper word of the destination address, and we can turn that in to: :020000040002f8 :04afe000cfff00009f :04afe400efff00007b :04afe8006aff0000fc :04afec001bff000047 :04aff00078ff0000e6 :04aff400ffff00005b :00000001FF I could aggregate those further in to a single record, but I'll leave that alone in this post. Getting closer to the point, the first line (:020000040002f8) seems to set the upper address word to 0x0002, meaning that the second line, for example, gets placed at address 0x0002AFE0 (unless Ive got my endianess mixed up here, but I think Im ok...) While the values seem to match what I see in the Configuration Bits window in MPLABX (e.g. FICD has a value of FFCF which seems to match the second record above, only in little endian), I cant quite work out how the address translates. In MPLABX, FICD is at address 0x157F0....? Certainly it doesnt seem to make sense for my chosen PIC (PIC24EP128), but its very close to being correct for the next size up - PIC24EP256, whos configuration bytes start at around 0x02AFEC. But 0x0002AFE0 then actually ends up within user program space, last page actually, which I believe is correct (looking at the datasheets some more). Can anyone shed any light on this or point out where Ive gone wrong in my thinking here? Is this a bug in the hex file output perhaps? 0x0002XXXX dont appear to be valid addresses for this family of PIC... It would seem, however, that I shouldnt be writing these as part of a software update anyway as it would end up enabling code protection, so perhaps I just exclude these lines in my re-worked output file? Thanks! Tom |
|
相关推荐
11个回答
|
|
在十六进制文件中,所有的地址都是加倍的。这是因为24位指令只占用2字节的地址空间。要将十六进制文件地址转换为物理地址,需要将其除以2。
以上来自于百度翻译 以下为原文 In the HEX file, all the addresses are doubled. This is because 24-bit instructions only occupy 2 bytes of the address space. To translate the HEX file address to the physical address you need to divide by 2. |
|
|
|
啊哈!太简单了。我甚至从来没有想过尝试除以二,所以这意味着HEX文件中的寻址是字节式的,而数据表是字面的呢?我甚至从未考虑过这一点。
以上来自于百度翻译 以下为原文 Ahhhhh!! So simple. I never even thought to try and divide by two. So this means that the addressing in the hex file is byte wise, whereas the datasheets are word wise? Ive never even considered this. |
|
|
|
|
|
|
|
HEX文件也是“臃肿”的事实,XC16将第四个幻像字节添加到00个24位指令中,使每个指令32位,因此HEX文件地址可分为两个。如果文件大小非常重要,可以考虑创建将HEX文件转换为SUITAB的ATOOL。LE自定义格式。
以上来自于百度翻译 以下为原文 The Hex file is also "bloated" by the fact that XC16 adds the fourth Phantom Byte as 00 for all 24 bit instructions, making it 32 bits per instruction so that HEX file addresses are dividable by two. If the file size is very important you may consider creating a tool that converts the HEX file to a suitable custom format. |
|
|
|
由此产生的文件大小本身并不是一个值得关注的问题,我希望尽可能简化事物的PIC方面,所以现在我将把幻像字节放进去。一旦我对它有了更好的了解,我可能会考虑在将来修剪一些东西。我确实创建了自己的工具来“重新打包”XC16中的HEX文件,使之成为对我的项目更有效的格式。:)
以上来自于百度翻译 以下为原文 The resulting file size itself is not so much of a concern, and I am looking to simplify things as much as possible on the PIC side of things, so I will leave the phantom bytes in for now. I may look at trimming things down in the future once I have a better grasp of it all. I have indeed created my own tool to "repackage" the hex file that comes out of XC16 in to a format that works better for my project. :) |
|
|
|
好啊。我的“自我更新”的解决方案是添加一个外部SPI闪存,我临时存储通过主应用程序USB代码更新。这样,我就不必创建一个单独的Bootloader项目,我只需添加一个受保护的PIC Flash页面,其中包含一个简单的“从SPI闪存写入PIC Flash”,代码大小非常小。
以上来自于百度翻译 以下为原文 OK. My "self update" solution was to add an external SPI FLASH where I temp-store the update via the main app USB code. In that way I do not have to create a separate bootloader Project, I just add a protected PIC FLASH Page that contains a simple "write to PIC Flash from SPI Flash" that is very small in code size. |
|
|
|
是的,这基本上是我想要做的,除了连接到我的设备是通过一个简化的“网络协议”,它是通过UART实现的。固件将通过主应用程序接收并存储在SPI EEPROM中,所以我不希望“引导加载程序”太大。我想我会写保护Bootloader闪存,但我有一种感觉,我希望能够引导引导加载更新。我有两个项目,一个是主应用程序,另一个是Bootloader,但就是这样,我可以修改两个链接器脚本来放置它们。在程序存储器中各自的位置,并保持程序存储器的其他部分的内容。
以上来自于百度翻译 以下为原文 Yep, that is essentially what I am intending to do as well, except connectivity to my devices is via a simplified "network protocol" which is implemented over UART. The firmware will be received and stored in SPI EEPROM via the main application, so I dont expect the "bootloader" to be too big. I dont think I'll be write protecting the bootloader flash though, I have a feeling I'd like to be able to ship bootloader updates as well. I do have two projects, one for the main application and the other for the bootloader, but that was namely so I could have two linker scripts modified to place them at their respective locations in program memory, and maintain the contents of the other parts of program memory. |
|
|
|
你看过六合一(安装为XC8的一部分,但我不确定其他XC编译器)吗?回到高科技,我们发现我们经常需要做各种各样的操作。HEX文件和HeMax是我们为此目的而构建的工具。
以上来自于百度翻译 以下为原文 Have you looked at HEXMATE (installed as part of XC8, but I'm not sure about the other XC compilers)? Back at HI-TECH we discovered we often needed to do assorted operations on .HEX files and HEXMATE was the tool we built for that purpose. |
|
|
|
我没听说过,但我会查一下。”不幸的是,我想,我的工具已经完成了,就像昨晚一样。-P
以上来自于百度翻译 以下为原文 I hadn't heard of it, but I will check it out. "Unfortunately", I guess, my tool is already complete, as of last night. :-P |
|
|
|
用闪光灯拍摄照片可能比较容易。未使用的闪存可以存储应用程序而不是外部EEPROM。
以上来自于百度翻译 以下为原文 It might be easier to take a PIC with more flash. The unused flash can store the app instead of external EEPROM. |
|
|
|
我打算这么做。我在我的项目中指定了一个1MIT SPI EEPROM来存储上传的固件以及设置/配置数据,但是我的项目比其他任何东西都更能存储内存,所以PIC I在我可以存储新固件的地方留下了大量的空间。事实上,我将能够将更大的图像融入其中,所以如果needed.SPI EEPROMs有像样的空间很难找到,而且昂贵的话,我就可以得到更大的应用程序的喘息空间。SPI闪存对于更大容量来说是便宜得多,但也没有用它。我可能最终使用SPI EEPROM作为原始目的,它存储设置和配置,因为它更容易使用,并且规格缩小。至少,直到我有更多的创造力,我可能会使用更多的备用内部闪光灯来“仿真”一些EEPROM空间,也许…
以上来自于百度翻译 以下为原文 I am going to do this. I had spec'd a 1mbit SPI EEPROM in to my project to store the uploaded firmware along with settings/configuration data, but my project is more memory intensive than anything else, so the PIC I have spec'd has oodles of space left over where I can store the new firmware. In fact I will actually be able to fit bigger images in to it, so Ive gained some breathing room for bigger applications further down the line if needed. SPI EEPROMs with decent space are hard to find and expensive when you do - a couple of pounds each. SPI flash memory is a lot cheaper for bigger capacities, but theres no point using that either. I will probably end up using the SPI EEPROM for the original purpose which was to store settings and configuration as its a little easier to work with, and spec it down in size. At least until I get a bit more creative about how I might use some more of the spare internal flash to "emulate" some EEPROM space perhaps... |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2224 浏览 5 评论
727浏览 1评论
612浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
501浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
626浏览 0评论
524浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 00:27 , Processed in 1.449712 second(s), Total 100, Slave 82 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号