完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在使用STVD和COSMIC编译器,我只是想在特定位置将数据存储在闪存中。我到目前为止做了什么:
- 在链接器的STVD中定义新的sesement和section,测试问题的具体位置应为0xfff0 - 0xffff - >我的链接器文件现在有一个额外的段和部分: #段测试: + seg .testsection -b 0xfff0 -m 0x10 -n .testsectionNow我正试图以这种方式向此部分添加一个常量值(如COSMIC推荐的那样): #pragma section const {testsection} const unsigned char variable = 0xAA; const unsigned char variable2 = 0xBB; #pragma section const {}如果我编译它一切正常......但是当我看到.s19文件的末尾(地址0xfff0 - 0xffff)时,一切都是空的,我的变量存储在哪里? 有人有提示吗? 以上来自于谷歌翻译 以下为原文 I'm working with STVD and COSMIC compiler and I'm just trying to store data in flash at a specific location. What I've done up to now: - Defining a new segement and section in STVD for the linker, specificed location for test issues should be 0xfff0 - 0xffff -> My linker file has now an additional segment and section: # Segment test: +seg .testsection -b 0xfff0 -m 0x10 -n .testsectionNow I'm trying to add a constant value to this section, in this way (as COSMIC recommends): #pragma section const {testsection} const unsigned char variable = 0xAA; const unsigned char variable2 = 0xBB; #pragma section const {}If I compile this everything works...but when I watch the end of the .s19 file (address 0xfff0 - 0xffff) everything is empty, where are my variables stored? Does anyone has a hint? |
|
相关推荐
6个回答
|
|
你好,
看起来对我来说,地图文件说的是什么? 问候, 卢卡 以上来自于谷歌翻译 以下为原文 Hello, looks correct to me, what does the map file say ? Regards, Luca |
|
|
|
嗨卢卡,
感谢你的回答, 我的新部分的地图文件: start 0000fff0 end 0000fff0 length 0 segment .testsection 长度0和起始和结束地址相同? 以上来自于谷歌翻译 以下为原文 Hi Luca, thanks for the answer, My map file for the new section: start 0000fff0 end 0000fff0 length 0 segment .testsection length 0 and start and end address the same? |
|
|
|
嗨,
我做了完全相同的事情,它按预期工作: start 0000fff0 end 0000fff2 length 2 segment .testsection 确保没有任何微不足道的问题(就像你链接的东西不同于你正在编译的东西,如不同的目录或类似的问题)而且,在链接器文件中,段定义位于包含你的特殊目标文件的名称之前部分。 卢卡 以上来自于谷歌翻译 以下为原文 Hi, I have done exactly the same thing and it works as expected for me: start 0000fff0 end 0000fff2 length 2 segment .testsection make sure there's no trivial problem (like you are linking something different from what you are compiling, like different directories or similar problems) and also that, in the linker file, the segment definition comes before the name of the object file that contains your special section. Luca |
|
|
|
嘿卢卡,
我用STVD(Project-> Settings-> Linker-> Input)添加新段,您是否添加了任何选项? 我用STVD重新编译了整个项目。 我的链接文件: 基于此链接器文件生成了映射文件: 此代码作为全局定义添加在main.c文件中: #pragma section const {testsection} const unsigned char variable = 0xAA; const unsigned char variable2 = 0xBB; #pragma section const {}但是测试部分的长度仍为0?! 以上来自于谷歌翻译 以下为原文 Hey Luca, I add the new segment with STVD (Project->Settings->Linker->Input), did you add there any options? I recompiled the whole project with STVD. My Linker file: Based on this linker file the map file was generated: This code was added in the main.c file as a global definition: #pragma section const {testsection} const unsigned char variable = 0xAA; const unsigned char variable2 = 0xBB; #pragma section const {}But still the length of the testsection is 0?! |
|
|
|
尝试在链接器文件的段行中添加-k(通过stvd或手动):
+ seg .testsection -b 0xfff0 -m 0x10 -n .testsection -k 如果仍然无效,请在此处或在我们的支持地址上分享整个lkf和地图文件( 邮寄地址:support@cosmic.fr ) 问候, 卢卡 以上来自于谷歌翻译 以下为原文 try to add a -k on the segment line in the linker file (through stvd or manually): +seg .testsection -b 0xfff0 -m 0x10 -n .testsection -k If it still does not work please share the whole lkf and map files, either here or on our support address ( mailto:support@cosmic.fr ) Regards, Luca |
|
|
|
嗨卢卡,
将选项-k添加到部分是问题,与此选项一起工作。 非常感谢你的支持 最好的祝福 丹尼尔 以上来自于谷歌翻译 以下为原文 Hi Luca, adding the option -k into section was the problem, together with this option it works. Many thanks for the support Best Regards Daniel |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2644 浏览 1 评论
3209 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1784 浏览 1 评论
3613 浏览 6 评论
5990 浏览 21 评论
940浏览 4评论
1317浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
585浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1304浏览 3评论
1362浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 16:47 , Processed in 1.124469 second(s), Total 59, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号