完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,
我正在为STM8S208RB(128k闪存)开发一个应用程序(PROJECT) 帽子正在使用大约100kB的闪光灯。现在 我添加了一个新的库(LIBRARY),它将内存使用量增加到120kB的闪存 。现在,当我在我的应用程序中删除一些代码时,我收到以下错误: & sharperror clnk 项目 _release PROJECT .lkf:152 PROJECT _release library_api.o:section boundary crossing(.text:095c)f_LIBRARY_SetListCallback 命令:'clnk -l'C: Program Files(x86) COSMIC FSE_Compilers Lib'-o PROJECT_release project.sm8 -m 项目 _release PROJECT .map PROJECT _release PROJECT .lkf'失败,返回值为:1 退出代码= 1。 (在评论与库有关的if-else之后我收到此错误) ( LIBRARY_SetListCallback是与库相关的函数,但它与if-else没有任何关系 )我正在使用以下编译器选项: 长堆(+ modsl) 最小化代码大小(+紧凑) 实施原型功能(-pp) 允许指针缩小(-pnp) 我在用着 以下链接器选项: 0x8000上的中断向量 代码/常量从0x8080到0x27FFF 零页面从0x0000到0x00FF RAM从0x0100到0x13FF 这是我的记忆部分地图: -------- 段 -------- 开始00004000结束00004000长度0段.eeprom start 00000000 end 00000000 length 0 segment .bsct 开始00000000结束0000000a长度10段.ubsct 开始0000000a结束0000000a长度0段.bit 开始0000000a结束0000000a长度0段.share 开始00000100结束000003a3长度675段.data,初始化 开始0000ba74结束0000bd17长度675段.data,来自 开始000003a3结束00001380长度4061段.bss start 00000000 end 000079be length 31166 segment .info。 开始00008000结束00008080长度128段.const 开始0000ba6c结束0000ba74长度8段.init 我在STM8论坛中查找了此错误代码,但我找不到可以帮助我的答案。 有没有人知道如何解决这个链接器错误? 在此先感谢大家, 吉列尔莫, #linker#section-boundary-crossing#stm8-microcontrollers 以上来自于谷歌翻译 以下为原文 Hi all, I'm developing an application (PROJECT) for a STM8S208RB (128k flash) t hat was using around 100kB of flash. Now I have added a new library (LIBRARY) that has increased memory usage to 120kB of flash .Now, when I delete some code in my application I get the following error: &sharperror clnk PROJECT _releasePROJECT .lkf:152 PROJECT _releaselibrary_api.o: section boundary crossing (.text:095c) f_LIBRARY_SetListCallback The command: 'clnk -l'C:Program Files (x86)COSMICFSE_CompilersLib' -o PROJECT_releaseproject.sm8 -m PROJECT _releasePROJECT .map PROJECT _releasePROJECT .lkf' has failed, the returned value is: 1 exit code=1. (I get this error after commenting an if-else related with the library) ( LIBRARY_SetListCallback is a function related with the library, but it doesn't have any relation with the if-else )I'm using the following compiler options:
I'm using the following linker options:
This is my memory sections map: -------- Segments -------- start 00004000 end 00004000 length 0 segment .eeprom start 00000000 end 00000000 length 0 segment .bsct start 00000000 end 0000000a length 10 segment .ubsct start 0000000a end 0000000a length 0 segment .bit start 0000000a end 0000000a length 0 segment .share start 00000100 end 000003a3 length 675 segment .data, initialized start 0000ba74 end 0000bd17 length 675 segment .data, from start 000003a3 end 00001380 length 4061 segment .bss start 00000000 end 000079be length 31166 segment .info. start 00008000 end 00008080 length 128 segment .const start 0000ba6c end 0000ba74 length 8 segment .init I looked for this error code in the STM8 forum but I couldn't find a answer that would help me. Has anybody any idea of how to solve this linker error? Thanks all of you in advance, Guillermo, #linker #section-boundary-crossing #stm8-microcontrollers |
|
相关推荐
2个回答
|
|
你好,
有些代码段无法跨越0xFFFF限制进行链接,因为它们包含16位内部跳转,可以低于0xFFFF或高于0xFFFF,但不能跨越。通常这些小部分代码都在我们(Cosmic)为编译器提供的库中,但在您的情况下,它们看起来像是在其他人提供的一些库中:解决方案是将这些库链接到另一个地址, changig链接顺序(这基本上就是当你的整体代码更大时发生的事情),或者是在你遇到问题的目标文件之前强制一个从0x10000开始的段。 我希望这很清楚,但如果您遇到困难,请不要犹豫,直接通过支持电子邮件与我们联系。 问候, 卢卡(宇宙) 以上来自于谷歌翻译 以下为原文 Hello, there are some sections of code that cannot be linked across the 0xFFFF limit, because they contain 16 bit internal jumps that would work either below 0xFFFF or above it, but not across. Usually these small sections of code are inside the libraries that we (Cosmic) provide with the compiler, but in your case it looks like they are inside some libraires provided by someone else: the solution is to link these libraries at another address, by either changig the linking order (that was basically what was happening when your overall code was bigger) or by forcing a segment beginning at 0x10000 just before the object file where you get the problem. I hope this is clear, but if you have difficulties don't hesitate to contact us directly on the support email. Regards, Luca (Cosmic) |
|
|
|
嗨卢卡,
非常感谢您的快速反应,现在我想我理解了问题的根源。 大多数新库都位于.text段的末尾(IE:The LIBRARY_SetListCallback 在错误中提到的位于0x25000附近,真的远离0xFFFF)我还添加了一些位于.text开头的新代码(IE:提到的触发错误)。因此,由于这个新代码,我认为我已经将一些其他代码移到0xFFFF,生成了 截面过境点 错误。这个推理是否正确? 按照您的说明,我在'PROJECT.lkf'文件中手动更改了链接顺序,现在从0x8080到0 x12000我有一些我永远不会修改的库,因此不存在再次“跨越0xFFFF移动代码”的风险。在这一点上我有一些疑问:有一种方法可以改变STVD的链接顺序吗?当你提到大约0xFFFF时,通常会找到COSMIC库,这是因为COSMIC库总是链接到最后一个,在< ; 64Kb内存模型,它们将在0xFFFF左右处理?这个解决方案是否正确?我的意思是,如果使用0x8080和0x12000之间的新代码,项目将进行编译,并且永远不会修改该代码。部分过境错误可能再次出现? 谢谢大家提前和最好的问候。 吉列尔莫, 以上来自于谷歌翻译 以下为原文 Hi Luca, Thank you so much for your fast response, now I think I understand the source of my problem. Most of the new library is at the end of the .text segment (IE: The LIBRARY_SetListCallback mentioned in the error is located around 0x25000, really far away from 0xFFFF) I added also some new code that was located at the begining of .text (IE: the mentioned that triggered the error). So because of this new code I think I have moved some other code across 0xFFFF, generating the section boundary crossing error. Is this reasoning correct? Following your instructions, I have changed the linking order manually in the 'PROJECT.lkf' file, so now from 0x8080 to 0 x12000 I have some libraries that I will never modify, so there is no risk of 'move code across 0xFFFF' again. At this point I have some doubts:
Thanks all you in advance and best regards. Guillermo, |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2751 浏览 1 评论
3244 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1814 浏览 1 评论
3655 浏览 6 评论
6046 浏览 21 评论
1342浏览 4评论
204浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
360浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
452浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
278浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-30 22:05 , Processed in 1.419671 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号