How do I get the wake source for K344

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

How do I get the wake source for K344

Jump to solution
688 Views
ZDDL
Contributor III

I looked at the S32K3 Low Power Management AN and demos, but those demos uses DS3.4, which I couldn't open and compile. Is there a demo of DS3.5 available?

I have a problem with low power Management. After the MCU is awakened, the reset type obtained by using Power_Ip_GetResetReason() is MCU_WAKEUP_REASON, and this is correct. But when I used Wkpu Ip GetInputState() to get the wake source, I didn't get the correct result.  I don't know why.

ZDDL_2-1732804683081.png

 

ZDDL_1-1732804624327.png

This is my test project. I hope someone could help me.

Thanks!

0 Kudos
Reply
1 Solution
667 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @ZDDL,

You can refer to the following examples: S32K3 Low Power Management AN and demos RTD 4.0.0 & 5.0.0 - NXP Community.

For the wakeup source, please try reading the registers directly:

uint32_t WISR_Value;
uint32_t WISR64_Value;

void WKPU_Handler(void)
{
	/*store the WISR value which indicate the wake up source.*/
	WISR_Value = IP_WKPU->WISR;
	WISR64_Value = IP_WKPU->WISR_64;
	if(MCU_WAKEUP_REASON == Power_Ip_GetResetReason())
	{
		printf("Reset reason = MCU_WAKEUP_REASON\r\n");
	}
	printf("WISR = %"PRIu32",", WISR_Value);
	printf("WISR64 = %"PRIu32".\n", WISR64_Value);
	/*Clear the flag by writing 1.*/
	IP_WKPU->WISR = 0xffffffff;
	IP_WKPU->WISR_64 = 0xffffffff;
	__asm("dsb");
	__asm("isb");
}

Best regards,
Julián

View solution in original post

0 Kudos
Reply
1 Reply
668 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @ZDDL,

You can refer to the following examples: S32K3 Low Power Management AN and demos RTD 4.0.0 & 5.0.0 - NXP Community.

For the wakeup source, please try reading the registers directly:

uint32_t WISR_Value;
uint32_t WISR64_Value;

void WKPU_Handler(void)
{
	/*store the WISR value which indicate the wake up source.*/
	WISR_Value = IP_WKPU->WISR;
	WISR64_Value = IP_WKPU->WISR_64;
	if(MCU_WAKEUP_REASON == Power_Ip_GetResetReason())
	{
		printf("Reset reason = MCU_WAKEUP_REASON\r\n");
	}
	printf("WISR = %"PRIu32",", WISR_Value);
	printf("WISR64 = %"PRIu32".\n", WISR64_Value);
	/*Clear the flag by writing 1.*/
	IP_WKPU->WISR = 0xffffffff;
	IP_WKPU->WISR_64 = 0xffffffff;
	__asm("dsb");
	__asm("isb");
}

Best regards,
Julián

0 Kudos
Reply