Hello. I have a SWT configured as shown in the image below. When I service the SWT, it works as expected. Wen I purposely don't refresh the SWT to prove that it can reset the software execution, it does reset, but only 8 times in a row. After 8 times, it doesn't reset any more and the microcontroller seems not to be running any code. When I have used a SWT with other microcontrollers, the SWT keeps resetting indefinitely if it is not refreshed.
I am not running in debug mode.
Board: S32K3x4EVB-Q257
Thanks in advance!
Solved! Go to Solution.
For anyone having this issue, it is related to the value of FRET (section 32.8.7 of the Reference Manual). By changing the value of FRET on boot as shown below, the SWT doesn't have a limited number of times to reset the system.
#define MC_RGM 0x4028C000
#define MC_RGM_FRET MC_RGM+0x18
char *pFRET = (char *)MC_RGM_FRET;
*pFRET = 0;
For anyone having this issue, it is related to the value of FRET (section 32.8.7 of the Reference Manual). By changing the value of FRET on boot as shown below, the SWT doesn't have a limited number of times to reset the system.
#define MC_RGM 0x4028C000
#define MC_RGM_FRET MC_RGM+0x18
char *pFRET = (char *)MC_RGM_FRET;
*pFRET = 0;
Hi @vgonzalez
According to the information provided, I suggest you to try testing just the SWT without the intervention of any other module, the section 65.3.8 Test SWT operation of the S32K3xx Reference Manual, Rev. 5 shows how to ensure that the internal countdown timer is working properly.
Also, take a look at Swt_Ip_Example_S32K344, the examples use SWT timeout interrupt to feed itself. Each 1 second, the SWT timeout expired and the SWT interrupt will reset the counter by writing the service sequence. SWT will be de-initialized after performing 5 times SWT service.
Let me know if it is helpful for you.
B.R.
VaneB
Thank you for your reply @VaneB
I ran the sample code Swt_Ip_Example_S32K344 and it worked as you described. The example is configured with Operation Mode as Interrupt. As described in the reference manual, this mode generates an interrupt on an initial time-out, and a reset on a second consecutive time-out. To allow the reset to occur, I removed the SWT de-initialization after performing 5 times SWT service and the reset occurred only 8 time as originally described. Is it possible that this is how NXP designed the SWT to operate?