SM_048 Implementation

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

SM_048 Implementation

1,503 Views
manish_singh
Contributor II

As per S32K1xx Series Safety Manual, Rev. 4, 09/2018 document for SM_048, DBG bit in the Watchdog Control and Status Register (CS) should be set to 1 and we are also using LPIT then LPIT_MCR[DBG_EN] = 1.

I am able to set the DBG bit to 1 by configuring the Wdg Run in debug mode parameter as shown below 

manish_singh_0-1653298815524.png

manish_singh_1-1653298954687.png

but when I try to set LPIT_MCR[DBG_EN] = 1, then my application is continuously resetting and LPIT_MCR[DBG_EN] bit is never getting set to 1.

manish_singh_2-1653298985659.png

Can you please let me know the correct procedure to set LPIT_MCR[DBG_EN] bit and also the implementation support to meet SM_048 requirement.

0 Kudos
10 Replies

1,483 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @manish_singh

 

How do you configure the LPIT module?

Do you follow the steps in Table 48-4. Initializing the LPIT modul?

 

Anyway, when the MCU is in the active debug mode and the core is halted, the WDOG (with DBG = 1) cannot be refreshed, therefore the WDOG will reset the MCU.

Regarding SM_048, please read it in the context of the whole Section 5.6.2.1 Debug mode.

"The debugging facilities of the S32K1xx and S32K14xW pose a possible source of failures if they are activated during the operation of functional safety-relevant applications."

That is why we can have certain modules active even in this active debug mode, and in this case, the WDOG can reset the MCU.

 

Regards,

Daniel

 

 

0 Kudos

1,469 Views
manish_singh
Contributor II

Hi Daniel,

I am able to set LPIT_MCR[DBG_EN] bit to 1, but I am not able to set WDOG ->CS[DBG] = 1 from the code, these bits are only getting set only from the configuration, is there any way I can set it manually.

Source code I am using to set the WDOG ->CS[DBG]  = 1

WDOG ->CS = 0x0000A5A4;

0 Kudos

1,465 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @manish_singh,

In the initial initialization of the WDOG, you need to set the UPDATE bit.

danielmartynek_0-1653656063965.png

So, before you write the register, read it first, is UPDATE = 1?

 

Thanks,

BR, Daniel

 

0 Kudos

1,462 Views
manish_singh
Contributor II

Hi @danielmartynek 

Yes, I have checked this condition but then also I was not able to set it.

0 Kudos

1,455 Views
danielmartynek
NXP TechSupport
NXP TechSupport

I forgot to mention that the WDOG must be unlocked first.

danielmartynek_0-1653657355871.png

 

0 Kudos

1,450 Views
manish_singh
Contributor II

@danielmartynek 

I will try the suggested solution and update you.

0 Kudos

1,417 Views
manish_singh
Contributor II

@danielmartynek 

I have tried the suggested solution but I am not able to set WDOG ->CS[DBG] = 1, kindly find the below code for reference

manish_singh_0-1653886089934.png

 

0 Kudos

1,408 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Manish,

Please double-check the code, it clears both DBG and UPDATE.

 

BR, Daniel

0 Kudos

1,379 Views
manish_singh
Contributor II

@danielmartynek 

I have updated the code but then also it was not getting set. Can we have a meeting to discuss on this ?

0 Kudos

1,370 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @manish_singh,

Please keep in mind that if the WDOG is enabled in the debug mode, and the core is halted by the debugger, the WDOG does not get refreshed, and the MCU is then reset.

Can you scope the reset_b signal while you are testing it?

 

Thank you,

BR, Daniel

0 Kudos