我们曾经发布的一条内容中,有用户咨询如下问题,请帮忙解答:
单片机干货|AURIX™ TC3xx 复位后RAM不初始化方法
https://zhuanlan.zhihu.com/p/442135193
您好,我在infineon的community提的问题,其实没有得到完美的答案。
希望您能再提供一些技术支持
community.infineon.com/
我的诉求是,在RAM里分配一个section(DLMU0/1或者DSRAM0/1都可以),只有这个section里的变量在warm reset时,不要被iLLD的库函数(也许是C_Init()?)初始化。
不期望在UCB里把整个DLMU0/1或者DSRAM0/1配置成不初始化。因为其他在这个RAM区域的变量需要初始化。
例如变量 counter_receive 申明如下:
#pragma section fardata "NoInit_RAM"
#pragma noclear
uint32 counter_receive;
#pragma clear
#pragma section fardata restore
这个变量counter_receive在软件运行中变成了5。然后用调试器的restart功能复位,这个变量还是变成0.
开发环境是 Aurix Development Studio V1.8, TC367, 评估板 TC367_5V_TFT.
LSL里,把DSRAM0从192K改成了128K,一部分空间分配到"AppRam"
抱歉在知乎我没有贴图片的权限,lsl的片段如下,我想您一看就能明白。
memory dsram0 // Data Scratch Pad Ram
{
mau = 8;
size = 128k;
type = ram;
map (dest=bus:tc0:fpi_bus, dest_offset=0xd0000000, size=128k, priority=8);
map (dest=bus:sri, dest_offset=0x70000000, size=128k);
}
memory appRam // Application RAM
{
mau = 8;
size = 16k;
type = ram;
map (dest=bus:tc0:fpi_bus, dest_offset=0xd0020000, size=16k, priority=8);
map (dest=bus:sri, dest_offset=0x70020000, size=16k);
}
section_layout :vtc:linear
{
/*aplication RAM sections*/
group (ordered, attributes=rw, run_addr=mem:appRam)
{
select ".data.NoInit_RAM";
}
}
已解决! 转到解答。
答案:因为您在UCB里把整个DLMU0/1或者DSRAM0/1配置成初始化,所以这个变量还是变成0。
Answer: Because you configured the entire DLMU0/1 or DSRAM0/1 to initialize in UCB, this variable still becomes 0.
答案:因为您在UCB里把整个DLMU0/1或者DSRAM0/1配置成初始化,所以这个变量还是变成0。
Answer: Because you configured the entire DLMU0/1 or DSRAM0/1 to initialize in UCB, this variable still becomes 0.