完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
亲爱的成员,我的Bootloader项目(XC32),基于“USB拇指驱动引导加载程序(beta 1)”,总是在前面有效的加载步骤之后生成错误“Max闪存地址”。错误意味着,写入Flash的应用程序的下一个地址超出有效范围。当这个错误发生时,地址是0x1fc00 800,这是我的PIC32 MX230F256B的引导闪存区域中的一个地址。在这个论坛中学习了很多关于Bootloader问题的线程之后,我仍然不知道如何解决这个问题:(有人能告诉我什么是这个吗?)加载程序试图写入引导区的原因是什么?这里是我的应用程序的链接器脚本:欢迎任何帮助!亲切关怀
以上来自于百度翻译 以下为原文 Dear members, my bootloader-project (XC32), based on "USB Thumbdrive Bootloader (BETA 1)", always generates the error "MAX_FLASH_ADDRESS" after previous valid load steps. The error means, that the next address of the application to write into flash exeeds the valid range. When this error occurs, the address is 0x1FC00800, which is an address in the boot flash area of my PIC32MX230F256B. After a long time of studying a lot of threads regarding bootloader issues in this forum, I still don't know how to solve that problem :-( Can anybody please tell me what could be the reason for the loader tries to write into the boot-area? Here is the linker script of my application: /************************************************************************* * Processor-specific peripheral libraries are optional *************************************************************************/ OPTIONAL("libmchp_peripheral.a") OPTIONAL("libmchp_peripheral_32MX230F256B.a") /************************************************************************* * Processor-specific object file. Contains SFR definitions. *************************************************************************/ INPUT("processor.o") /************************************************************************* * http://www.microchip.com/forums/m773400.aspx *************************************************************************/ SECTIONS { /DISCARD/ : { *(._debug_exception) } } /************************************************************************* * For interrupt vector handling *************************************************************************/ PROVIDE(_vector_spacing = 0x00000001); _ebase_address = 0x9D018000; /************************************************************************* * Memory Address Equates * _RESET_ADDR -- Reset Vector * _BEV_EXCPT_ADDR -- Boot exception Vector * _DBG_EXCPT_ADDR -- In-circuit Debugging Exception Vector * _DBG_CODE_ADDR -- In-circuit Debug Executive address * _DBG_CODE_SIZE -- In-circuit Debug Executive size * _GEN_EXCPT_ADDR -- General Exception Vector *************************************************************************/ _RESET_ADDR = (0x9D018000 + 0x1000); _BEV_EXCPT_ADDR = (0x9D018000 + 0x1000 + 0x380); _DBG_EXCPT_ADDR = (0x9D018000 + 0x1000 + 0x480); _DBG_CODE_ADDR = 0x9FC00490; _DBG_CODE_SIZE = 0x760; _GEN_EXCPT_ADDR = _ebase_address + 0x180; /************************************************************************* * Memory Regions * * Memory regions without attributes cannot be used for orphaned sections. * Only sections specifically assigned to these regions can be allocated * into these regions. *************************************************************************/ MEMORY { kseg0_program_mem (rx) : ORIGIN = (0x9D018000 + 0x1000 + 0x490), LENGTH = 0x40000 - (0x18000 + 0x1000 + 0x490) kseg0_boot_mem : ORIGIN = 0x9D018000, LENGTH = 0x0 exception_mem : ORIGIN = 0x9D018000, LENGTH = 0x1000 kseg1_boot_mem : ORIGIN = (0x9D018000 + 0x1000), LENGTH = 0x490 debug_exec_mem : ORIGIN = 0x9FC00490, LENGTH = 0x760 config3 : ORIGIN = 0xBFC00BF0, LENGTH = 0x4 config2 : ORIGIN = 0xBFC00BF4, LENGTH = 0x4 config1 : ORIGIN = 0xBFC00BF8, LENGTH = 0x4 config0 : ORIGIN = 0xBFC00BFC, LENGTH = 0x4*/ kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x4000 sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000 configsfrs : ORIGIN = 0xBFC00BF0, LENGTH = 0x10 } Any help is welcome! kind regards rom |
|
相关推荐
7个回答
|
|
如果地址不在有效的应用程序内存范围内,您的引导加载程序“什么也不做”吗?引导闪存(BFM)位于程序快闪存储器(BFM)之上。它包含调试执行和配置字,这应该被引导程序忽略。
以上来自于百度翻译 以下为原文 Can your bootloader "do nothing" if the address is not within the valid application program memory range? Boot Flash Memory (BFM) sits above Program Flash Memory (BFM). It contains the debug executive and configuration words, which should be ignored by your bootloader. |
|
|
|
您的代码太大,或者优化不够高,引导引导程序无法适应引导闪存区域。你需要把它移到正常的闪存区域,然后把你的应用程序放在后面。/ Ruben
以上来自于百度翻译 以下为原文 Your code is too big or the optimization is not high enough for the boot loader to fit in the boot flash area. You need to move it to the normal flash area and put your application after that. /Ruben |
|
|
|
非常感谢你的回复!麦克斯宾:我已经知道我的加载器对于BFM来说太大了,所以它在PFM中运行。我还测试了如何将我的(非常小的test-)app.hex作为可加载项添加到加载器项目中,以查看是否有任何重叠,并且没有重叠。我认为Adress应该是OK.AcCH0866:我试图改变我的代码来忽略那些无效的区域。
以上来自于百度翻译 以下为原文 thanks very much for your replies! maxruben: I already knew that my loader is too big for the BFM so it runs in the PFM. I also tested to add my (very small test-)app.hex as loadable into the loader project to see if there are any overlappings, and there are none. I think the adressing should be ok. aschen0866: I try to change my code to ignore those invalid areas. |
|
|
|
显示引导装载程序的链接器脚本。/ Ruben
以上来自于百度翻译 以下为原文 Show the linker script for the bootloader. /Ruben |
|
|
|
亲爱的鲁宾,亲爱的RISC,谢谢你的帖子,很抱歉我的回复太晚了!我不使用和声。我必须这么做吗?实际上,我不使用引导程序的链接器脚本。我在这个论坛上看到,当我将引导加载程序作为普通应用程序放在程序闪存中时,我不需要额外的链接器脚本。对吗?同时,在加载应用程序时,我编辑了BL代码以忽略BF区域中的地址。加载程序现在以成功告终,并在Application_ADDRESS启动应用程序,但是应用程序不像应该的那样运行。症状:在RP15的LED闪烁的小康(如它在BL,但较慢),并在RP14的LED不断。在我的小测试应用程序中,3个LED(RP13、14、15)像跟踪灯一样快速地打开、打开、关闭、关闭。以下是我的BL定义:defineApplication_ADDRESS 0x9D018000\define PROGRAM_FLASH_BASE 0x1D018000\define PROGRAM_FLASH_LENGTH(0x40000-0x18000)\define FLASH_BLOCK_SIZE 0x400;。内存使用:-BLData 16384(0x4000)字节数据使用:26,3%数据使用:26,3%数据使用:4312(0x10D8)数据使用:26,3%数据使用:4312(0x1010D8)免费:12072(0x2F28)263312(0x404040490)程序263312(0xF28)字节程序使用:36,7%程序使用:96724(0x179D4:96724(0x179D4)免费:166588(0x17166588(0x179D4)免费:166588(0x28ABC):166588(0x166588(0x28BC)1616166588(0X16161616384)1616384(0节目263312(0x40490)字节程序使用:1,3%程序使用:3464(0xD88)免费:259848(0x3F708)还需要什么信息?我乐意为您提供任何帮助。
以上来自于百度翻译 以下为原文 dear ruben, dear risc, thanks for your posts and sorry for my late reply! I don't use harmony. Do I have to? And I actually don't use a linker script for the bootloader. I read in this forum, that when I place the bootloader in the program flash as a normal application I don't need an extra linker script. Right? Meanwhile I edited my BL code to ignore the addresses in the BF-Area when loading the application. The loader ends with success now and starts the application at my APPLICATION_ADDRESS, but the application does not run like it should. Symptoms: An LED at RP15 blinks on an off (like it does at the BL but slower) and an LED at RP14 is constantly on. In my little test application 3 LEDS (RP13, 14, 15) blink fast on, on, on, off, off, off, like a chaser light. Here are my BL defines: #define APPLICATION_ADDRESS 0x9D018000 #define PROGRAM_FLASH_BASE 0x1D018000 #define PROGRAM_FLASH_LENGTH (0x40000 - 0x18000) #define FLASH_BLOCK_SIZE 0x400 Here are the memory usages: - BL Data 16384 (0x4000) bytes Data Used: 26,3% Data Used: 4312 (0x10D8) Free: 12072 (0x2F28) Program 263312 (0x40490) bytes Program Used: 36,7% Program Used: 96724 (0x179D4) Free: 166588 (0x28ABC) - App Data 16384 (0x4000) bytes Data Used: 0,0% Data Used: 0 (0x0) Free: 16384 (0x4000) Program 263312 (0x40490) bytes Program Used: 1,3% Program Used: 3464 (0xD88) Free: 259848 (0x3F708) What else information do you need? I will gladly post for any help. Best regards |
|
|
|
亲爱的Ruben,0x1FC0800不是在调试区,而是在保留区吗?我的PIC32的内存图显示:编辑:我错了,它不在预留区域!我确保配置设置是相同的。我只是简单地将它们从BL-Project复制到我的小型APP-Project中。我已经尝试把我的App.hex添加到BL-Project->Build中了,没有重叠。但是我不知道如何调试整个构建。我只是试图跳过真正的BL的“从拇指加载到闪存”的代码,方法是将“BootApplication()”命令(跳转到Application_ADDRESS)放在BL主程序的开头。最后一行可以设置断点,但我不能在应用程序的代码中设置有效断点。我已经在这个论坛中搜索过“如何做”,但不幸的是,我没有找到任何帮助来同时调试它们。
以上来自于百度翻译 以下为原文 Dear Ruben, isn't 0x1FC00800 far over the debug area, in the reserved area? The memory map of my PIC32 shows so. EDITED: I'm wrong, it's NOT in the reserved area! I ensured that the config settings are the same. I simply copied 'em from the BL-Project to my little APP-Project. And I already tried to add my APP.hex as loadable into the BL-Project -> Build is fine, no overlappings. But I don't know to debug the whole build. I just tried to skip the real BL's "load-from-thumb-into-flash" code by placing the "BootApplication()" command (jump to the APPLICATION_ADDRESS) at the beginning of my BLs main. There is the last line where I can set a breakpoint, but I cannot set a valid breakpoint in the app's code. I already searched for 'How Tos' about that in this forum, but I unfortunately didn't find any help how to debug both together. Kind regards |
|
|
|
您应该将应用程序项目作为可加载文件加载,而不是十六进制文件。0x1fc00800(引导闪存)是kseg1中的虚拟地址0xbfc00800或kseg0中的虚拟地址0x9fc00800的物理地址。
以上来自于百度翻译 以下为原文 You should load the application project as a loadable, not the hex file. 0x1fc00800 (the boot flash) is the physical address of the virtual address 0xbfc00800 in kseg1 or the virtual address 0x9fc00800 in kseg0. See http://ww1.microchip.com/downloads/en/DeviceDoc/60001115H.pdf /Ruben |
|
|
|
只有小组成员才能发言,加入小组>>
5242 浏览 9 评论
2031 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3207 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2256 浏览 5 评论
778浏览 1评论
669浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
597浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
679浏览 0评论
577浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 05:13 , Processed in 1.257377 second(s), Total 88, Slave 72 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号