S32k324 RTC wake up

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

S32k324 RTC wake up

Jump to solution
360 Views
Prasad_330
Contributor III

hi,

I am using S32k324 controller,

I am trying to put the controller in sleep mode and waking up from the RTC.

I am able to put the controller into standby mode.

But the controller is not waking from Standby mode.

RTC-API is used to  wakeup controller.

I have also attached the stand-alone rtc wake up code.

Please let me know what modifications has to be done 

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

Hi @Prasad_330,

Try to use this wake up config instead:


static inline void Rtc_Ip_SetCompareValue(uint8 instance, uint32 value)
{
    /* Set RTCVAL */
    rtcBase[instance]->RTCVAL = value;
}

void Wkup_Config(void)
{
	/* WKPU configuration */
	Wkpu_Ip_Init(WKPU_INST, &Wkpu_Ip_Config_PB);
	Wkpu_Ip_EnableInterrupt(WKPU_INST, 0);

	/* Init RTC and RTC_0_InitConfig_PB is config tool generated */
	Rtc_Ip_Init(RTC_INST, &RTC_0_InitConfig_PB);

	/* Disables the API functionality
       Clears the API interrupt flag*/
	Rtc_Ip_StopTimer(RTC_INST);

	Rtc_Ip_StartCounter(RTC_INST); 				/*<! Start the counter. */
	Rtc_Ip_SetCompareValue(RTC_INST, RTC_API_TIME);	/*<! Set counter value. */
	Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0);
}

Also, make sure that SIRC is enabled in standby mode:

Julin_AragnM_0-1723136674936.png

Best regards,
Julián

View solution in original post

7 Replies
173 Views
Prasad_330
Contributor III

hi Julian_AragonM

I am working on s32k324 VLSR mode.

I have changed the clock to FIRC, But i am not able to make the CORE_CLK to 3MHZ.  Because the FIRC = 48MHZ  clock divider max value is only 8. so core clock = 48MHZ/8  is equal to 6MHZ.

How to change into 3MHZ.

I also wanted to know what are the module that can be used in the VLSR. I wanted use CAN and UART in VLSR mode.

how to change the "FlexCanProtocol clock" to 3MHZ

Can you plz help me out.

0 Kudos
Reply
159 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Prasad_330,

You can select the frequency for Fast IRC from the Clocks Diagram:

Julin_AragnM_0-1724177021594.png

And for the peripherals, please go into "Peripheral Clock View" and the source clock for each peripheral can be selected:

Julin_AragnM_1-1724177085346.png

Best regards,
Julián

 

0 Kudos
Reply
133 Views
Prasad_330
Contributor III

hi Julian_AragonM

Thanks for the reply,

I have configured the clock configuration and Peripheral Clock View  as suggested by you.

But my FlexCAN configuration is configured as below snapshot and it is working properly in the RUN mode

Prasad_330_0-1724241462190.png

where my FlexCAN Protocal Clock is 25000000(25Mhz).

Now in VLSR mode if I change the clock of FlexCAN  to 3000000(3Mhz), should want to do any changes in the bitrate (kbps). if  so, then how to configure.

I am getting the bus_error in VLSR mode.

Plz let me know any other configuration I am missing.

 

0 Kudos
Reply
104 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Prasad_330,

The FlexCAN protocol clock needs to be configured as the peripheral clock:

1.png

Julin_AragnM_4-1724273279504.png

 

Please refer to chapter 73.3.10.8 Protocol timing from the S32K3XX's reference manual. 

Best regards,
Julián

 
 
 

 

0 Kudos
Reply
330 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Prasad_330,

Try to use this wake up config instead:


static inline void Rtc_Ip_SetCompareValue(uint8 instance, uint32 value)
{
    /* Set RTCVAL */
    rtcBase[instance]->RTCVAL = value;
}

void Wkup_Config(void)
{
	/* WKPU configuration */
	Wkpu_Ip_Init(WKPU_INST, &Wkpu_Ip_Config_PB);
	Wkpu_Ip_EnableInterrupt(WKPU_INST, 0);

	/* Init RTC and RTC_0_InitConfig_PB is config tool generated */
	Rtc_Ip_Init(RTC_INST, &RTC_0_InitConfig_PB);

	/* Disables the API functionality
       Clears the API interrupt flag*/
	Rtc_Ip_StopTimer(RTC_INST);

	Rtc_Ip_StartCounter(RTC_INST); 				/*<! Start the counter. */
	Rtc_Ip_SetCompareValue(RTC_INST, RTC_API_TIME);	/*<! Set counter value. */
	Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0);
}

Also, make sure that SIRC is enabled in standby mode:

Julin_AragnM_0-1723136674936.png

Best regards,
Julián

304 Views
Prasad_330
Contributor III

hi Julian_AragonM

Thanks for your reply,

Your solution worked for me.

I also wanted to know is there Very Low Speed Run (VLSR) mode.

Can you please share me some documents  regarding the configuration of VLSR mode or some Sample code 

0 Kudos
Reply
287 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Prasad_330,

You can refer to the pdf included with the Low Power Managements demos. All of the example codes contain another clock configuration which uses the FIRC for VLSR.

Julin_AragnM_0-1723219566635.png

Julin_AragnM_1-1723219842524.png

Julin_AragnM_2-1723219901111.png

Best regards,
Julián

 

 

0 Kudos
Reply