IAR定义的内存区域的自定义数据 [英] IAR define memory region for custom data
问题描述
我想在STM32微在哪里存储一些字符串来定义一个特定的存储区。我使用IAR编译,但我没有找到一个简单的例子,可以帮助我在使用ICF文件的正确的方式来创建的区域。我怎样才能创建区域,并在code使用的区域?谢谢
我发现这个解决方案:
在ICF文件我用这种方式定义存储区:
定义区域LANGUAGE_region =纪念品:从0x080FB000到0x080FC000]
LANGUAGE_PLACE:发生在LANGUAGE_region {部分.LANGUAGE_PLACE.noinit}开始;
我将填补这一地区使用程序员外部SREC文件。
用一个简单的程序测试区(使用整数),我使用此声明:
在头:
的extern const的无符号整型MYDATA @LANGUAGE_PLACE.noinit。
在C文件:
const的无符号整型MYDATA;
块引用>在调试器中我可以看到0x0800FB000 MYDATA不变的正确地址
I want to define a specific memory region in the STM32 micro where to store some strings. I'm using IAR compiler but I don't find a simple example that can help me to create the region in the correct way using the icf file. How can I create the region and use this region in the code? Thanks
解决方案I found this solution:
In the icf file I define the memory region in this way:
define region LANGUAGE_region = mem:[from 0x080FB000 to 0x080FC000]; "LANGUAGE_PLACE":place at start of LANGUAGE_region { section .LANGUAGE_PLACE.noinit };
I will fill this region with an external srec file using a programmer. To test the region with a simple program (using an integer) I use this declaration:
In the header:
extern const unsigned int mydata @".LANGUAGE_PLACE.noinit";
In the C file:
const unsigned int mydata;
In the debugger I can see the correct address of mydata constant at 0x0800FB000
这篇关于IAR定义的内存区域的自定义数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!