iar等效符号__bss_end__
我想知道Cortex-M的RAM中静态数据的末端在哪里。 GCC CMSIS Linker脚本提供了__ BSS_END __
的符号,我只是采用其地址。有同等的IAR吗?还是我必须用一个变量进行虚拟部分,然后将其放在readwrite
之后?
这是我(非常标准的)IAR链接脚本:
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x00010000-1);
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x00002000-1);
/*-Sizes-*/
if ( !isdefinedsymbol( __ICFEDIT_size_cstack__ ) )
{ define symbol __ICFEDIT_size_cstack__ = 0x400; }
if ( !isdefinedsymbol( __ICFEDIT_size_heap__ ) )
{ define symbol __ICFEDIT_size_heap__ = 0x800; }
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
keep { section .intvec };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK,
block HEAP };
I want to know where is the end of my static data in RAM of Cortex-M. GCC CMSIS linker scripts provide a symbol for __bss_end__
and I simply take its address. Is there an IAR equivalent? Or do I have to make a dummy section with a single variable and place it after readwrite
?
This is my (very standard) IAR linker script:
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x00010000-1);
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x00002000-1);
/*-Sizes-*/
if ( !isdefinedsymbol( __ICFEDIT_size_cstack__ ) )
{ define symbol __ICFEDIT_size_cstack__ = 0x400; }
if ( !isdefinedsymbol( __ICFEDIT_size_heap__ ) )
{ define symbol __ICFEDIT_size_heap__ = 0x800; }
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
keep { section .intvec };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK,
block HEAP };
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果创建一个块,请将数据放入其中并放置块,您可以使用
__ section_begin()
和__ section_end()
将指针纳入此开始和结束堵塞。示例链接器配置:
以及访问信息的代码
If you create a block, put the data in it and place the block you can use
__section_begin()
and__section_end()
to get pointers to the beginning and the end of this block.Example linker configuration:
And the code to access the information