完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我想了解为什么编译器/链接器在引导内存中放置数据。目前我使用XC-32(V1.44),MPLABX(V5.00),和声(V2.04)。我正在构建的项目是一个PIC32 MX795F512L的和谐项目。I使用自定义链接器文件,这些看起来工作(我可以看到内存布局等,除了BooFlash,大多数东西看起来都不错),也就是说,问题可能与这些有关。自定义链接器文件的原因是I。AM构建要使用PIC32 PROG的CHIPKIT M32 Bootloader加载项目,所以链接器文件来自MPIDE软件。最初,这个问题是从PIC32 PROG抱怨DeFCFG丢失(这对于我的BooooDER来说是奇怪的),但是不管怎样,在读取PIC32 PROG源之后,我粗略地看到,如果.HEX文件包含BooFlash内存空间中的数据,那么PIC32 PROG预期DEVCFG信息。当我在构建项目后查看MPLABX的内存部分时,数据存在于Booflash中,但我不知道如何实现。如果打开XC32 LD的“显示内存使用”,生成后的输出统计数据显示Booflash区域使用的0字节。使用的KSG00BooToMeMm的总使用量为0:KSEG1Y-BOOTHOMEME:0,但我可以在ELF浏览器、内存段查看器和MPLAB IPE内存段查看器中查看数据。ELF查看器将使用的内存部分标记为.xDebug,开始于0x1FC0480长度0x2C。我尝试了“剥去所有SyMaSOL”,配置项目使用模拟器(没有调试器),在和谐配置中,我设置了“后台调试程序启用(调试)=关闭”。链接器文件中的ORE部分具有长度0:KSG00BooToMeM: Orth= 0x9FC0490,长度=0kSe11BooTyMe:Ont= 0xBFC000,长度=0i不知道在这一点上编译器为什么把这个部分放在什么地方?米
以上来自于百度翻译 以下为原文 Hi, I am trying to understand why compiler/linker is placing data in bootflash memory. Currently I am using xc-32(v1.44), MPLABX (v5.00), HARMony (v2.04). The project I am building is a Harmony project for a PIC32MX795F512L. I a using custom linker files and these appear to working (I can see the memory layout etc and most things look ok except the bootflash), that said the problem could be related to these. The reason for the custom linker files is I am building the project to be loaded using the chipKit MAX32 bootloader with pic32prog so the linker files are from the mpide software. Initially this problem started with the pic32prog complaining about DEVCFG missing (which is strange for the booloader i think) but anyhow after reading the pic32prog source it roughly appears to me that if the .hex file contains data in the bootflash memory space then pic32prog expects DEVCFG info. When I review the memory sections in MPLABX after building the project there is data located in the bootflash but I have no idea how. If I turn on "Display memory usage" for xc32-ld, the output statistics after build show 0bytes used of bootflash area. Total kseg0_boot_mem used : 0 Total kseg1_boot_mem used : 0 But I can see the data in a ELF viewer, Memory Sections Viewer and MPLAB IPE Memory sections viewer. The ELF viewer labels the section of memory used as ._debug_exception starting at 0x1FC00480 length 0x2C. I've tried "Strip all symobols", configure the project to use Simulator (no debugger), in Harmony configuration I have set "Background Debugger Enable (DEBUG) = OFF" for DEVCFG0. The specific memory sections in the linker files have a length 0: kseg0_boot_mem : ORIGIN = 0x9FC00490, LENGTH = 0 kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0 I don't know at this point why the compiler is putting anything this section? M |
|
相关推荐
6个回答
|
|
|
|
|
|
在引导闪存中,Bootstrap异常向量和调试异常向量不应是任何意外,它应该是根据硬件设计而定的。当PIC设备用ARDUNO Bootloader编程,以及最终的ARDUINO调试工具时,引导引导程序将驻留在引导中。从0xbfc000到0xbfc4480,然后在MPLAX构建应用程序时,在启动闪存中放置C启动代码、引导异常向量、调试异常向量和中断向量,当编程调试时,MPLAB也将调试执行程序编程为BOO。当加载一个应用程序(ARDUINO)Bootloader时,引导加载程序可能有逻辑忽略程序HeXFILE的部分,以避免重写引导加载程序代码或向量。在MPLAX中有一个选项不链接启动代码。我不知道它是否已经在您的项目中设置,或者它是否会对此有所帮助。迈西尔
以上来自于百度翻译 以下为原文 Hi, Bootstrap Exception Vector and Debug Exception Vector in Boot Flash memory, should Not be any surprise. It is where they should be according to the hardware design. When a PIC device is programmed with Arduino Bootloader, and eventual Arduino debugging tools, then the bootloader will reside in Boot Flash memory from 0xBFC00000 and thru 0xBFC00480 and onwards. When MPLAB X build a application, it will place C Startup code, Bootstrap exception vector, Debug exception vector, and Interrupt vectors in Boot Flash memory. When Programming for Debugging, MPLAB will also program Debug Executive into Boot Flash memory. When loading an application by means of a (Arduino) bootloader, the bootloader may have logic to ignore parts of a program hexfile, to avoid overwriting bootloader code or vectors. Programming a PIC microcontroller in MPLAB should be expected to overwrite any bootloader that might reside in the device. There is an option in MPLAB X to not link startup code. I do not know if it have been set already in your project, or if it will help for this. Mysil |
|
|
|
如果您进一步查看章节链接器命令,您将看到,例如,它告诉链接器是否定义了“X调试器”,然后为调试异常地址保留8个字节的AtdBGGExcel PTADDR,而对于调试执行程序,在X-BGGO-CODEADADDR的0xFF0字节中,没有初始值。只有当您尝试运行“调试会话”时,工具才生成一个内部宏。当使用Bootloader应用程序相关的项目时,您应该仔细查看.map文件以获得更好的内存分配图。
以上来自于百度翻译 以下为原文 If you look a bit further into the SECTIONS linker command, you'll see, for example, ... /* Debug exception vector */ .dbg_excpt _DBG_EXCPT_ADDR (NOLOAD) : { . += (DEFINED (_DEBUGGER) ? 0x8 : 0x0); } > kseg1_boot_mem /* Space reserved for the debug executive */ .dbg_code _DBG_CODE_ADDR (NOLOAD) : { . += (DEFINED (_DEBUGGER) ? _DBG_CODE_SIZE : 0x0); } > debug_exec_mem ... This tells the linker if _DEBUGGER is defined, then reserve 8 bytes at _DBG_EXCPT_ADDR for debug exception address, and 0xFF0 bytes at _DBG_CODE_ADDR for debug executive, no initial value. _DEBUGGER is an internal macro generated by the toolchain only when you try to run a "debug session". When working with bootloader/application related projects, you should really look into the .map file to get a better picture of memory allocation. |
|
|
|
是的,但我认为这对OP.来说是一条相当危险的道路。
以上来自于百度翻译 以下为原文 Yes, but I think that's a rather dangerous path for the OP. |
|
|
|
谢谢你的快速反应!有趣的是,我以前选择了这个选项,但是我得到了一个构建警告:警告:找不到登录符号。事实上,我只是用选项设置了一个构建来不链接启动代码。这工作于移除Debug GNORT条目,因此引导闪存没有数据/代码就位。正如预期的那样,PIC32 PROG闪现了我的HEX文件,不幸的是,我不能评论该应用程序是否运行,因为它纯粹是一个空白的主(和声)项目,我将添加一些代码来获得LED闪烁或其他东西。现在我已经注意到,ARDUINO最终构建步骤有-NoStaskFrime.我仍然有点担心为什么我会得到构建错误,并且我认为从AsCH0866响应中可能会有其他问题不允许“启动代码”?这是我一直在努力解决的问题,因为就我所知的所有设置而言,我并不是为“调试会话”而构建的,我从字面上点击“生产”-gt;“构建主项目”。因此,我不明白为什么工具链生成了X调试器符号?
以上来自于百度翻译 以下为原文 Thanks for the fast response! Interestingly I had this option select previously but I was getting a build warning: warning: cannot find entry symbol _reset; defaulting to 9d001000 I didn't realised until now that when I disabled that option and allowed "startup code" it had the effect of adding the debug code. In fact I just did a build with the option set to not link startup code. This worked as far as removing debug_exception entries so the bootflash memory has no data/code in place. As expected the pic32prog flashed my hex file, unfortunately I can't comment on if the application ran because it is purely a blank main() harmony project, I will add some code to get an LED flashing or something. I have noticed now that the Arduino final build step has -nostartfiles. I would still be a bit concerned as to why I get the build error and I think from aschen0866 response there may be other issues from not allowing "startup code"? This is something I've been trying to figure out, because as far as I know from all of the settings I am not building for a "debug session", I literally click "Production"->"Build Main Project". So I don't get why the toolchain is generating the _DEBUGGER symbol? |
|
|
|
除此之外,启动代码初始化运行时环境(静态和全局,以及C++代码的构造函数)。
以上来自于百度翻译 以下为原文 Among other things, the startup code initializes the runtime environment (statics and globals, also constructors for C++ code). |
|
|
|
只有小组成员才能发言,加入小组>>
4847 浏览 9 评论
1846 浏览 8 评论
1763 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
2973 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2075 浏览 5 评论
472浏览 1评论
1123浏览 1评论
314浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
376浏览 0评论
270浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-5-14 23:09 , Processed in 1.117881 second(s), Total 91, Slave 72 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号