完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,
我是来自意大利的学生,我正在开展一个测试平台是STM8S-Discovery板的项目。 我开发了我的项目没有问题,但现在,经过一些修改,以提高在板上运行的代码的性能,我不断获得相同的错误(报告如下): & sharperror clnk Debug aes.lkf:1段.bsct size overflow(10) & sharperror clnk Debug aes.lkf:1段.ubsct size overflow(10) 命令:''clnk -l''C: Program Files COSMIC CXSTM8_16K Lib'' - o Debug aes.sm8 -mDebug aes.map Debug aes.lkf''失败,返回值为:1 退出代码= 1。 我发现关于.bsct和.ubsct段的信息很少,它们应该与静态和静态未初始化数据相关。问题是我没有在修改后的代码版本中更改这些数据的大小。 编译和运行良好的代码包含6个256字节的查找表(总共1.5 kB)。应该编译的代码(不包含)恰好包含6个256字节的查找表(再次为1.5 kB)。其中一个表与以前不一样,但我几乎认为内容没有任何区别,因为它的大小相同。 注意:我尝试了调试和发布模式,但没有看到任何变化。 有没有人可以帮助解决这个问题? 先谢谢你。 #linking #c #programming #compiling #cosmic#stm8s-discovery 以上来自于谷歌翻译 以下为原文 Hello everyone, I'm a student from Italy and I'm working on a project in which the testing platform is an STM8S-Discovery board. I developed my project with no problem but now, after few modifications to improve the performance of the code running on the board I keep obtaining the same error (reported below): &sharperror clnk Debugaes.lkf:1 segment .bsct size overflow (10) &sharperror clnk Debugaes.lkf:1 segment .ubsct size overflow (10) The command: ''clnk -l''C:Program FilesCOSMICCXSTM8_16KLib'' -o Debugaes.sm8 -mDebugaes.map Debugaes.lkf '' has failed, the returned value is: 1 exit code=1. I found little information about .bsct and .ubsct segments, they should be related to static and static uninitialized data. The problem is that I didn't change the size of those data in the modified version of the code. The code that compiles and runs fine contains 6 look-up tables of 256 bytes (1.5 kB total). The code that is supposed to compile, which doesn't, contains exactly 6 look-up tables of 256 bytes (1.5 kB total again). One of those tables is not the same as before, but I hardly think the contents can make any difference since it is of the same size. Note: I tried both the debug and release mode and I see no changes. Is there anyone that can help with this problem? Thank you in advance. #linking #c #programming #compiling #cosmic #stm8s-discovery |
|
相关推荐
4个回答
|
|
你好Sirus,
您遇到的问题是(我认为)程序中的数据大小(全局变量的大小)。当我的程序使用的数据量超过256个字节时,我得到了相同的错误消息。 STM8处理器在其内存映射的开头有256个字节,而Cosmic编译器/链接器(我猜你必须使用Cosmic,而不是Rasonance),默认情况下,将这个空间用于数据;当所需的数量超过256个字节时,链接器会给出错误消息并退出。我没有找到方法告诉Cosmic将数据移动到其他地方(处理器确实有2k的数据空间,所以它是可能的);我发现Raisonance编译器提供了相同的错误消息,但是如果我使用“数据”这个词,例如''data char buffer [1000]'',应用程序编译并链接OK。 问题是,Rasonance工具集(1)在从STVD使用时返回错误消息,并且在我的生命中,我不明白错误消息窗口试图告诉我什么以及我必须做什么,以及(2)董事会的演示附带了一个针对Cosmic的项目,但不是Rasonance;当我创建一个工作区,一个项目,并且我包含了在Cosmic下编译的相同文件时,我开始遇到各种错误。 显然,ST以10美元的价格提供这款主板,但软件工具非常糟糕。我是一所加拿大大学的教授,我非常努力地学习这个板和工具,能够在我的课程中使用它们,但我这样做只是因为董事会便宜,而不是因为STM让我的生活很容易,因为我喜欢他们的产品...这太糟糕了。 我希望这有帮助。 丹尼尔 以上来自于谷歌翻译 以下为原文 Hello Sirus, The problem you have is caused (I think) about the data size (size of your global variables) in your program. I got the same error message the moment the amount of data my program used, exceeded 256 bytes. The STM8 processor has 256 bytes at the begining of its memory map, and the Cosmic compiler / linker (I guess you must be using Cosmic, and not Rasonance), by default, uses this space for data; the moment the needed amount exceeds 256 bytes, the linker gives an error message and quits. I did not manage to find a way to tell Cosmic to move the data somewhere else (the procesor does have 2k of data space, so it is possible); I found that the Raisonance compiler gives the same error message, however if I use the word ''data'', e.g. ''data char buffer[1000]'', the application compiles and links OK. The problem is, the Rasonance toolset (1) returns an error message when used from STVD, and for the life of me, I do not understand what the error message window is trying to tell me and what I must do, and (2) the demo for the board comes with a project for Cosmic, but not Rasonance; when I created a workspace, a project, and I included the same files that compiled under Cosmic, I started getting all kinds of errors. Clearly, ST gives this board for $10, but the software tools are terrible. I am a professor in a Canadian university, am trying very hard to learn this board and the tools, to be able to use them in my courses, but I do this only because the board is cheap, and not because STM has made my life easy and because of that I love their product... It's too bad. I hope this helps. Daniel |
|
|
|
嗨,
.bsct是包含page0中初始化数据的段 .ubsct是第0页中包含非初始化数据的段 .data是包含page0之外的初始化数据的段 .bss是包含page0之外的非初始化数据的段 如何将全局变量放在给定段中的示例: @tiny char aa; //将转到.ubsct @tiny char aa = 10; //将转到.bsct @near char aa; //将转到.bss @near char aa = 10; //将转到.data 如果您没有指定@tiny或@near,您使用的内存模型将由您决定(有关详细信息,请参阅手册) page0的体系结构限制为256字节,但实际上这个数字可能更低:链接器将检查任何段的实际大小与链接器文件中为该段指定的-m参数(通常由stvd7自动创建) ) 内存的其余部分(上面称为''out of Page0'')实际上仅限于您正在使用的特定设备上实现的RAM量:指定与设备一致的-m参数非常重要对于.data + .bss 总之,您看到的错误消息意味着存储的数据多于可用空间。如果您只是通过阅读源文件无法弄清楚原因,您可以按照以下步骤操作: - 手动编辑.lkf文件并为-m参数设置“大”值 - 您的应用程序现在将编译和链接(但当然不会执行:因为您使用的RAM比实际可用的RAM多 - 检查地图文件中段的填充方式(哪个变量在哪个段中) - 更正源,为-m恢复正确的值并构建应用程序 希望这可以帮助。 问候, 卢卡(宇宙) 以上来自于谷歌翻译 以下为原文 Hi, .bsct is the segment that contains initialized data in page0 .ubsct is the segment that contains non-initialized data in page0 .data is the segment that contains initialized data out of page0 .bss is the segment that contains non-initialized data out of page0 examples of how to put a global variable in a given segment: @tiny char aa; // will go to .ubsct @tiny char aa = 10; // will go to .bsct @near char aa; // will go to .bss @near char aa = 10; // will go to .data when you don't specify @tiny or @near the memory model you are using will decide for you (see the manual for details) The page0 is architecture-limited to 256 bytes, but this number can be lower in reality: the linker will check the actual size of any segment versus the -m parameter specified for that segment in the linker file (that is often created automatically by stvd7) The rest of the memory (referred to as ''out of Page0'' above) is actually limited to the amount of RAM implemented on the specific device you are using: it is important to specify a -m parameter that is coherent with the device for .data+.bss In conclusion, the error message you see means that there is more data than available space to store it. If you can't figure out why by just reading the source file you can follow these steps: - manually edit the .lkf file and set ''big'' values for the the -m parameter - your application will now compile and link (but of course will not execute: because you are using more RAM than actually available - check in the map file how the segments are filled (which variable goes in which segment) - correct the source, restore the right values for -m and build your application Hope this helps. Regards, Luca (Cosmic) |
|
|
|
卢卡你好,
谢谢您的回复。 我正在使用STM8S-Discovery板(我相信STM8S105C)。 您能否告诉我们必须使用哪些设置才能使用您的编译器/链接器成功编译具有超过256字节数据的应用程序。如果我理解正确,我们必须使用: @near char aa; 要么 @near char aa = 1; 正确? 丹尼尔 以上来自于谷歌翻译 以下为原文 Hello Luca, Thank you for your reply. I am using the STM8S-Discovery board (STM8S105C I believe). Can you please tell us what settings we must use to be able to successfully compile an application having more than 256 bytes of data, with your compiler / linker. If I understand you correctly, we must use: @near char aa; or @near char aa = 1; Correct? Daniel |
|
|
|
使用''long''内存模型(+ modsl或+ modsl0),默认情况下将所有数据放在@near中。
问候, 卢卡 以上来自于谷歌翻译 以下为原文 use a ''long'' memory model (+modsl or +modsl0) that will put all the data @near by default. Regards, Luca |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2632 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3607 浏览 6 评论
5987 浏览 21 评论
939浏览 4评论
1315浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
582浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1302浏览 3评论
1357浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 08:08 , Processed in 1.308744 second(s), Total 83, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号