配置spc5744 SWT复位后不清零变量
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I removed the debugger ,The MCU sends the value by the CAN interface,got zero for my variable which should be 0xAA06 .


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 -
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:
So I will just blind shot that you have reset escalation scenario:
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
