Wakeup event S32K312

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

Wakeup event S32K312

Jump to solution
10,046 Views
sai-bodhanapu
Contributor I

hello, i am using S32k312 in S32DS using RTD, i tried to wakeup from Standby mode using external wkup pins, after exiting the standby mode it does the functional reset and jumps to main, how to enter my wakeup sequence in which i reintiliazes the clock, power and other peripherals after standby exit instead of functional reset.

Sincerely,

Sai Praveen Bodhanapu.

0 Kudos
Reply
1 Solution
10,042 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @sai-bodhanapu,

It always go through the functional reset.

There is an option to use the Fast standby exit.

In this case, the application starts at a user defined boot address instead of the reset handler.

danielmartynek_0-1685620584787.png

 

Please refer to: S32K3 Low Power Management AN and demos

https://community.nxp.com/t5/S32K-Knowledge-Base/S32K3-Low-Power-Management-AN-and-demos/ta-p/152772...

 

Regards,

Daniel

View solution in original post

0 Kudos
Reply
16 Replies
9,660 Views
sai-bodhanapu
Contributor I

Hello @danielmartynek, i need information about  standby modes which are provided in IDE. there is no much information in the reference manual except normal and fast standby mode. is it the case in any stanbymode after wakeup it goes to the reset handler?

is there any standby mode that continues from where it stopped (instead of reset handler and main )after wakeup with manually initializing the peripherals?

please provide information or the documentation related to other standby modes, so that we can choose the optimal mode for our project.

saibodhanapu_0-1686744740852.png

Sincerly,

Sai Praveen Bodhanapu

0 Kudos
Reply
9,652 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Sai Praveen Bodhanapu,

There is documentation of the driver (righ-click on the component), but it is not very helpful.

danielmartynek_0-1686750013913.png

I would recommend going through the code.

Power_Ip_SetMode() function:

danielmartynek_1-1686750240560.png

As you can see above, it offers some flexibility. It allows you to just prepare the Standby mode and put it into the standby mode later. Or you can do it at once.

There is the CORE_STANDBY_MODE, but this does not put the whole SOC into the Standby mode, just the core is halted (calls the WFI instruction, wait for interrupt).

 

Regards,

Daniel

 

 

 

 

 

0 Kudos
Reply
9,590 Views
sai-bodhanapu
Contributor I

Hello @danielmartynek , thank you for the information. can you please provide me the example for core standby, for me the wakeup does not work for corestandby mode.

Regards,

Sai Praveen Bodhanapu

0 Kudos
Reply
9,586 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Can you please create a new thread.

The original query has been answered here.

 

Thank you,

BR, Daniel

0 Kudos
Reply
10,022 Views
sai-bodhanapu
Contributor I

hello @danielmartynek, i tried fast standby exit, i placed the FastWkupBootVectorTable[] address that i found in .map file in debugger section and i placed it in Power FastStandby Boot Base Address. and i added some code to function in Wkup_FastWkupBootAddress(). but it didnot worked.

is Standby_Stack_StartAddr is standby ram end address or start address? when i see in .map file it doesnot matches the address from the example.

Regards,

Sai Praveen Bodhanapu

0 Kudos
Reply
9,994 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @sai-bodhanapu,

Please find the example attached, it is ported on the S32K312 MCUs.

Can you test it?

 

BR, Daniel

0 Kudos
Reply
7,462 Views
saritha_valluru
Contributor II

@danielmartynek 

 

as per  S32K312_GPIO_Wkup_S32DS_3_4_RTD_LLD_2_0.zip example PTB19 using WKPU[42], as per data sheet it is connected to WKPU[38]. Do we have any updated document for this? Please help.   

What is the WKUP index for PTB46?

43R2PTB19GPIO[51]GPIO[51] eMIOS_1_CH[15]_HFXIO_D2 eMIOS_2_CH[15]_H TRGMUX_OUT10WKPU[38]  eMIOS_1_CH[15]_HFXIO_D2 eMIOS_2_CH[15]_H  LPUART13_RX     GPIO[51]/eMIOS_1_CH[15]_H/FXIO_D2/eMIOS_2_CH[15]_H/TRGMUX_OUT10/LPUART13_RX/WKPU[38]c40esf3_p_io_standard_mv ILKG_33/50_S0

 

const Wkpu_Ip_ChannelConfigType Wkpu_Ip_ChannelConfig_PB_BOARD_InitPeripherals[1U] =
{
/** @brief IcuWkpu_Channel_EVB_PTB19 */
{
/** @brief Wkpu HW Channel used by the Icu channel */
42U,
/** @brief Wkpu HW Channel Filter enable */
FALSE,
/** @brief Wkpu HW Channel Pullup enable */
FALSE,
/** @brief Wkpu Default Start Edge*/
WKPU_IP_RISING_EDGE,
/** @brief Wkpu Channel Callback */
NULL_PTR,
NULL_PTR, /* Notification function */
/** @brief Wkpu Callback Param1*/
42U
}
};

0 Kudos
Reply
8,180 Views
Akhil1
Contributor I

Hello @danielmartynek , I want to make S32K312 controller to go from RUN mode to standby mode and to Run mode. I have tried the example with S32K312(S32K312_GPIO_Wkup_S32DS_3_4_RTD_LLD_2_0_fast_wakup), but I have faced the Issue while executing.

When I pressed SW5 pin, Blue LED is turning off and it is showing error.

Screenshot 2023-12-08 212643.png

can you please help me out and send me the zip file.

 

 

0 Kudos
Reply
9,990 Views
sai-bodhanapu
Contributor I
Hello @danielmartynek, the example you provided have normal standbymode, but i need example for fast standbymode.
Sai Praveen Bodhanapu
0 Kudos
Reply
9,788 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @sai-bodhanapu,

I'm sorry for the delay, I did not have the S32K312 WH for a while.

Please find the attached example.

After the fast exit (SW6), it stays in this loop until the flag variable is cleared by the debugger (attached session mode).

danielmartynek_0-1686306963575.png

The Boot Base Address is the base of the vector table.

The initial VTOR address is 0x00401000.

For the fast wakeup, add the .fast_wkup_boot_vector section into the linker and alligned it to 0x1000

danielmartynek_1-1686307203751.png

 

So the fast exit VTOR is 0x00402000

danielmartynek_2-1686307253208.png

 

Regards,

Daniel

 

 

0 Kudos
Reply
9,762 Views
sai-bodhanapu
Contributor I

Hello @danielmartynek, thank you for the reply. how to get the debugger connection back after exiting the standby mode. if mcu enters the standby mode my debugger connection is lost and i am using onboard debugger (PE micro debugger) for it, and i would like to know what is attached session in debugging?

Regards,

Sai Praveen Bodhanapu

0 Kudos
Reply
9,758 Views
danielmartynek
NXP TechSupport
NXP TechSupport

The debugger can be attached to the running MCU after the wakeup without reflashing/resetting the MCU.

The PE Micro debugger has this option:

danielmartynek_0-1686314997194.png

Once connected, halt the execution, and you should see it is in the while loop.

 

Regards,

Daniel

 

 

0 Kudos
Reply
10,039 Views
sai-bodhanapu
Contributor I

hello @danielmartynek, thank you for the response i will try with fast standby exit.

Regards,

Sai Praveen Bodhanapu 

0 Kudos
Reply
10,043 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @sai-bodhanapu,

It always go through the functional reset.

There is an option to use the Fast standby exit.

In this case, the application starts at a user defined boot address instead of the reset handler.

danielmartynek_0-1685620584787.png

 

Please refer to: S32K3 Low Power Management AN and demos

https://community.nxp.com/t5/S32K-Knowledge-Base/S32K3-Low-Power-Management-AN-and-demos/ta-p/152772...

 

Regards,

Daniel

0 Kudos
Reply
9,960 Views
kshitij_dadheka
Contributor II

Hello Daniel,
Thanks for the answers. I am working on a similar problem.

Is it at all possible to NOT reset and go to line 1 of main after exit from FAST STANDBY?
In the example, I see this function in Wkup.c:

/**
* @brief     This function to show MCU what need to do after fast wake up.
* @details   First, you can modify FIRC clock(FIRC default is 24MHz).
*			 However, you can add your code at here. MCU need to jump to Reset_Handler to initialize the MCU.
* @Param[in] None
*
* @return    void
**/
static void Wkup_FastWkupBootAddress(void)
{
	/*FIRC is 24M after wakeup. Change FIRC to 48M by bare metal code.*/
	if(((IP_CONFIGURATION_GPR->CONFIG_REG_GPR & CONFIGURATION_GPR_CONFIG_REG_GPR_APP_CORE_ACC_MASK) >> CONFIGURATION_GPR_CONFIG_REG_GPR_APP_CORE_ACC_SHIFT) == 5u)
	{
		/* FIRC Divider to 1 */
		IP_CONFIGURATION_GPR->CONFIG_REG_GPR = CONFIGURATION_GPR_CONFIG_REG_GPR_APP_CORE_ACC(5) | CONFIGURATION_GPR_CONFIG_REG_GPR_FIRC_DIV_SEL(3);
	}

	/* Customer can add their self code at here
	   Write your code here */

	/*Jump to Reset_Handler to initialize the MCU.*/
	// __asm("bl Reset_Handler");
	
	// Initialize clocks
		Clock_Ip_StatusType clockStatus;

	/* This function initializes the PLL and MCU specific clock options.*/
	clockStatus = Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);
    while (clockStatus != CLOCK_IP_SUCCESS)
    {
        clockStatus = Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);
    }

    /* Init MCU MC_RGM part of the registers, Init Power Management Controller and Disable the padkeeping */
	Power_Ip_Init(&Power_Ip_HwIPsConfigPB);
	// Re-initialize peripherals
		/* Clear RDSS to prevent automatic wake up after setting RDSS during standby */
	Power_Ip_GetResetReason();

	/* Set power to run mode which include enable last mile regulator and other PMC configuration */
	Power_Ip_SetMode(&Power_Ip_aModeConfigPB[0]);

	/* Pins configuration. */
	Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);
	

// Go back to routine
	
}

 Is it all possible to remove __asm("bl Reset_Handler"); and then manually init the clocks and peripherals after that. Then the MCU picks up from where it left off before going to FAST STANDBY

I only ask this because of the flowchart you mentioned in your answer.
Please let me know.

 

Thanks in advance,
KD

0 Kudos
Reply
9,786 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @kshitij_dadheka,

The startup code at Reset_Handler initializes the MCU, please have a look at startup_cm7.s

VTOR, Stack, SWT, RAM ECC checksum, etc.

 

BR, Daniel

0 Kudos
Reply