1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,伙计们,我已经迁移了一个从DSPIC33 EP256MU806 toDSPIC33 EP512MU810的引导加载程序。引导加载程序从外部SPI闪存获得FixWEX HEX文件,并将其安装到Micro的程序Flash。一旦固件被写入Micro的内存中,它就跳转到应用程序。如果Bootloader在Micro的内存写入之后跳转到应用程序,则成功执行跳转。否则,如果引导加载程序没有安装固件(这是普通条件),当它跳转到应用程序时,应用程序运行在开始程序存储器的几个位置,从0x250到0x270(IVT从0x00到0x200分配,程序代码从0x200开始)。因此,我在我的应用程序的反汇编列表中寻找这个位置,它们没有出现。在两个条件下,我比较了程序存储器和数据存储器(SFRS),它们匹配了每个位置。为什么我的应用程序被困在那个循环中?这些地方的代码是什么?这是我用于引导加载程序的链接器脚本:陷阱循环的细节:这些是陷阱位置:地址序列是:0x260-gt;0x266& gt;0x268& gt;0x25c & gt;0x25e & gt;(从0x260重新启动)
以上来自于百度翻译 以下为原文 Hi guys, I've migrate a bootloader from dsPIC33EP256MU806 to dsPIC33EP512MU810. The bootloader gets the firware hex file from an external SPI Flash memory and installs it to the micro's program flash. Once the firmware is writed in the micro's memory, it jump to the application program. If the bootloader jumps to application after a micro's memory writing, the jump is performed successfully. Otherwise, if the bootloader doesn't install a firmware (this is the ordinary condition), when it jumps to application, the application program runs in a few location of the beginning program memory, from 0x250 to 0x270 (the ivt is allocateed from 0x004 to 0x200, the program code starts from 0x200), as if it is trapped in a loop. So, i looked for this location in the disassembly list of my application program, they don't appear. I compared the program memory and data memory (sfrs) before the jump in both conditions, they match every locations. Why is my application program trapped in that loop? What is the code in those locations? PS. this is the linker script i have used for bootloader: // - BOOTLOADER - SCRIPT MEMORY { data (a!xr) : ORIGIN = 0x1000, LENGTH = 0xD000 reset : ORIGIN = 0x7FFFFC, LENGTH = 0x4 ivt : ORIGIN = 0x7FFFFA, LENGTH = 0x4 program (xr) : ORIGIN = 0x7FC004, LENGTH = 0x3FFA FGS : ORIGIN = 0xF80004, LENGTH = 0x2 FOSCSEL : ORIGIN = 0xF80006, LENGTH = 0x2 FOSC : ORIGIN = 0xF80008, LENGTH = 0x2 FWDT : ORIGIN = 0xF8000A, LENGTH = 0x2 FPOR : ORIGIN = 0xF8000C, LENGTH = 0x2 FICD : ORIGIN = 0xF8000E, LENGTH = 0x2 FAS : ORIGIN = 0xF80010, LENGTH = 0x2 FUID0 : ORIGIN = 0xF80012, LENGTH = 0x2 } __FGS = 0xF80004; __FOSCSEL = 0xF80006; __FOSC = 0xF80008; __FWDT = 0xF8000A; __FPOR = 0xF8000C; __FICD = 0xF8000E; __FAS = 0xF80010; __FUID0 = 0xF80012; __IVT_BASE = 0x7FFFFA; __DATA_BASE = 0x1000; __DATA_LENGTH = 0xD000; __YDATA_BASE = 0x9000; __DMA_BASE = 0xD000; __DMA_END = 0xDFFF; __CODE_BASE = 0x7FC000; __CODE_LENGTH = 0x3FFA; Detail of trap loop: These are the trap locations: 00025C EB4900 CLR.B [W2] 00025E E80102 INC W2, W2 000260 390002 BRA NC, 0x266 000262 EC2034 INC DSWPAG 000264 A0F002 BSET W2, #15 000266 E90183 DEC W3, W3 000268 3EFFF9 BRA GTU, 0x25C 00026A 370004 BRA 0x274 00026C E12861 CP W5, #1 00026E 320001 BRA Z, 0x272 The address sequence is: 0x260 -> 0x266 -> 0x268 -> 0x25C -> 0x25E -> (restart from 0x260) |
|
相关推荐
4个回答
|
|
执行从地址0x000开始,什么是写初始复位指令?SEEHTTP://WW1. Microchip .com/下载/En/DeiceDC/OS/PD8:Bootloader在前一部分工作吗?主应用程序的链接器是什么样子的?您的链接器将允许应用程序重写IVT和重置向量?你只有4个单词分配给IVT?在引导加载程序中使用中断吗?毫秒
以上来自于百度翻译 以下为原文 Execution starts at address 0x0000, what is writing the initial reset instruction? See http://ww1.microchip.com/downloads/en/DeviceDoc/S8.pdf Additionally: Did the bootloader work on the previous part? What does the linker look like for the main application? Your linker will allow the application to over write the IVT and reset vector? You only have 4 words allocated to IVT? Are you using any interrupts in the bootloader? MS |
|
|
|
如果有人还想回答这些问题,我就提出了一些问题。我做了一个哑应用程序(LED闪光灯),看看问题是在引导加载程序还是在我的应用程序中。问题是在我的应用程序中:当我的应用程序启动时,中断不起作用。我的应用程序是基于定时器时间安排的,所以它没有做任何事情。这是IVT定义中的问题(在我的应用程序中)。我不使用链接器脚本,所以IVT是在默认位置定义的?
以上来自于百度翻译 以下为原文 If someone still wants to answer the threads, i've made a little step forward with my problem. I've made a dummy application program (led blinker) to see if the problem is in the bootloader or in my application. The problem is in my application: when my app starts, the interrupt doesn't works. My app is based on timer time scheduling, so it doesn't do anything. Is the problem due to ivt definition (in my app. i don't use linker script, so the ivt is defined in the default location)? |
|
|
|
你的问题很可能是IVT的分配问题。可选的IVT)。虽然我没有实际应用程序的经验,但引导加载程序文档应该给出如何使应用程序“引导加载程序就绪”的方法。
以上来自于百度翻译 以下为原文 Could well be that your problem is the allocation of the IVT (resp. the alternative IVT). While I have no practical experience with your application, the bootloader documentation should give away the way how to render your application "bootloader-ready". |
|
|
|
我有点惭愧,问题是iTCON2.GIE。我不知道我的应用程序是如何工作的,因为我从来没有设置它,但是自从引导加载程序清除它之后,一旦引导加载程序跳到应用程序,应用程序的中断就不起作用了。
以上来自于百度翻译 以下为原文 I am a bit ashamed, the problem was the INTCON2.GIE. I don't know how my app has worked, cause i never set it, but since the bootloader clear it, once the bootloader jumps to the app, the app's interrupts didn't work. Now it works good Thank you anyway |
|
|
|
只有小组成员才能发言,加入小组>>
5238 浏览 9 评论
2028 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3204 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
778浏览 1评论
666浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
595浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
677浏览 0评论
576浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 06:50 , Processed in 1.817265 second(s), Total 84, Slave 68 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号