配置spc5744 SWT复位后不清零变量

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

配置spc5744 SWT复位后不清零变量

229 Views
zhangzhixing
Contributor II

我的map 文件中已经配置好了一个 noinit 变量,但是用multilink debug的时候,SWT复位后清零了,我禁止了.S 中的初始化 SRAM 的代码,也是清零的,是否能提供一个比较全面的方案来实现这个功能。

Tags (1)
0 Kudos
Reply
5 Replies

216 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

The debugger disable SWT by default. So you can debug and not be reset on SWT timeout by counter running in background.

 

Google translate:

A noinit variable has been configured in my map file, but when using multilink debug, the SWT is cleared after reset. I disabled the code for initializing SRAM in .S, and it was also cleared. Can you provide a more comprehensive solution to implement this function?

Hopefully I understand your questions from translate. If not, please formulate it in English.

Best regards,

Peter

0 Kudos
Reply

207 Views
zhangzhixing
Contributor II

I removed the debugger ,The MCU sends the value by the CAN interface,got zero for my variable  which should be 0xAA06 .

0 Kudos
Reply

196 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Unfortunately I am not able to understand the question.

Could you reformulate it in a more clear way so I can guide you?

Best regards,

Peter

 

0 Kudos
Reply

168 Views
zhangzhixing
Contributor II

in the LD file, the Noinit SRAM area is set. Startup.s didn't clear it, and the Mac file removed the clearing operation. A variable in this area is defined in main.c and has been referenced. In the map file, I found the address allocation text for variables. After the SWT reset, I found this variable was still cleared. Could you tell me the reason?

0 Kudos
Reply

158 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Ok, so you basically want to preserve RAM content trough reset.

You have set the area in RAM where the data should be preserved as noinit - so RAM initialization is not done on this area.

After SWT reset you see the area filled with ECC. = reset state of RAM

 

SWT triggers functional reset -

petervlna_0-1742542736896.pngpetervlna_1-1742542750934.png

So the SRAM is preserved after functional reset.

Here I expect you are not doing RAM init at all, as it is still preserved.

But what can cause behavior you see is destructive reset or power on reset:

petervlna_2-1742542874339.png

So I will just blind shot that you have reset escalation scenario:

petervlna_3-1742542946083.png

When you see the RAM not initialized, check the content of RGM [DES] to see the source of you issue. It must be destructive reset.

Best regards,

Peter

 

 

0 Kudos
Reply