完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我正试着通过PIC18F65 K80完成AN1310。此刻我正试图理解代码是如何工作的。我用MPLAB X IDE和MPASM(我使用1.05版)编译了PIC18引导加载程序的ASM代码,而令我惊讶的是,程序内存窗口只显示FFS。最初我怀疑有一个MPLAB X IDE怪癖,但过了一会儿,我意识到我只是在看程序内存的启动,而Bootloader实际上是在它的结尾写的。这是意料之中的,因为这是我想使用的设置(在程序内存结束时用Bootloader),但是我希望在重置向量上可以看到“Goto”或“BRA”指令。相反,重置向量只是PANNFF,因此没有指令。将AN1310的文本放在穆尔的监视下,我看到了这样的语句:主机PC Bootloader应用程序将写一个“Goto”作为复位向量(地址,000小时)的第一条指令。这个GOTO在启动时跳转到引导加载程序。应用固件的原始复位向量指令在内存引导程序块之前自动移动到驻留。Bootloader固件使用这个应用程序重置向量来启动应用程序,当不请求引导加载模式时(参见图10)。因此,这个预期的GOTO指令将由PC软件…StestReStimg编写,但是:1。为什么在Bootloader固件本身中不是硬编码的?2。在编程程序启动引导程序后,你第一次启动微操作时发生了什么?它是否执行NOP,直到到达内存的引导加载程序的开始?
以上来自于百度翻译 以下为原文 Hi all, I am trying to work my way through the AN1310 in conjuntction with a PIC18F65K80. At the moment I am at the stage of trying to understand how the code works. I compiled the asm code of the PIC18 bootloader using MPLAB X IDE and mpasm (I am using version 1.05) and to my surprised I saw the program memory window as indicating FFs only. Initially I suspected an MPLAB X IDE quirk, but after a while I realized I was only looking at the beginnning of the program memory and the bootloader has actually been written at the end of it. That was as expected, as this is the setup I wanted to use (with the bootloader at the end of program memory), but I would have expected to see a "goto" or "bra" instruction at the reset vector. Instead, the reset vector is just playn FF, so no instruction there. Putting the text of AN1310 under moore scrutiny, I came across this statements: The host PC bootloader application will write a “GOTO” as the first instruction at the Reset vector (address, 0000h). This GOTO jumps to the bootloader at start-up. The application firmware’s original Reset vector instruction is automatically moved to reside just before the bootloader block of memory. The bootloader firmware uses this application Reset vector to start the application when the Bootloader mode is not requested (see Figure 10). So it seems this expected goto instruction will be written by the PC software...insteresintg, but: 1. Why was not this hardcoded in the bootloader firmware itself? 2. What happends the first time you power up the micro after having programmed the bootloader with a programmer? Does it just execute NOPs until it reaches the beginning of the bootloader application towards the end of the memory? |
|
相关推荐
5个回答
|
|
我终于明白了如何上传图片到这个论坛,所以我附上了上面帖子中提到的相关图10。
以上来自于百度翻译 以下为原文 I finally managed to understand how to upload pictures to this forum, so I have attached the relevant Figure 10 mentioned in the post above. Regards, Cristian Attached Image(s) |
|
|
|
我从来没有使用这个BooooDER,但从我看到你的帖子和应用程序。请注意,直到PC引导程序将应用程序代码写入PIC时,重置必须导致PIC执行“NOPS”,直到它击中内存顶部的引导加载程序为止。
以上来自于百度翻译 以下为原文 I have never used this booloader however from what I see in your post and the app. note it would seem that until the PC bootloader program writes the application code to the pic a reset must result in the pic executing "nops" until it hits the bootloader at the top of memory. |
|
|
|
该行为可以在Bootloader代码中进行配置。不确定行号是否正确,但应该在169左右,每次使用Bootloader时都必须清除并再次写入,因为要清除的内存区域必须清除。
以上来自于百度翻译 以下为原文 The behavior can be configured in the bootloader code. Not sure if the line numbers are correct but it should be around 169 #if BOOTLOADER_ADDRESS != 0 ORG 0 ; The following GOTO is not strictly necessary, but may startup faster ; for large microcontrollers running at extremely slow clock speeds. ;goto BootloaderBreakCheck <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ORG BOOTLOADER_ADDRESS BootloaderStart: bra BootloadMode Anyway, has to be cleared and written again every time you use the bootloader because the memory region that follows has to be cleared... |
|
|
|
就是这样!这就是为什么PC应用程序必须再次编写它的原因。谢谢!问候,克里斯蒂安
以上来自于百度翻译 以下为原文 That's it! This is why the PC application has to write it again. Thanks! Regards, Cristian |
|
|
|
您的引导加载程序也可以将其写入擦除的一部分。但是,如果你想最小化闪存块的零值,应该保存在RAM中并最后写入。这确保它直到你有完整的十六进制文件才被写入。
以上来自于百度翻译 以下为原文 Your bootloader could also write it as part of the erase. But it you want to minimize bricking the flash block zero should be saved in ram and written last. This insure it is not written until you have the full hex file. |
|
|
|
只有小组成员才能发言,加入小组>>
5192 浏览 9 评论
2011 浏览 8 评论
1936 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3183 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2238 浏览 5 评论
746浏览 1评论
632浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
517浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
644浏览 0评论
544浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-1 07:24 , Processed in 1.080000 second(s), Total 54, Slave 48 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号