Standby mode & wake-up with RTC

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

Standby mode & wake-up with RTC

Jump to solution
2,481 Views
buccno
Contributor III

Hi,

I'm conducting low-power testing on a board using the S32k312 processor. The board has an external oscillator with a frequency of 16MHz. I've configured two different clock frequencies.

In the first set of clock configurations, the processor clock is derived from PLL, and in the second set, it uses FIRC (Software Standby mode entry sequence is here).

When I switch to the second clock configuration, debugging becomes problematic, leading me to infer power consumption from the power supply. In my test code, I examined CLKOUT RUN (PTD10) and CLKOUT STANDBY (PTA12) pins with an oscilloscope.


Initially, everything seems correct, but after setting the "SOC STANDBY" mode during the prepare mode, I can't obtain a proper frequency; I get a frequency similar to what is shown in the image. What could be the reason for this?

I also created an alarm in the RTC for testing, but it seems like it's not waking up (I suspect the inability to read the correct frequency from the CLKOUT standby pin is indicating this issue).

I'm sharing my test code, and I would greatly appreciate it if you could take a look. Thanks in advance for your assistance.

 

0 Kudos
Reply
1 Solution
2,349 Views
buccno
Contributor III
I solved the problem. I hadn't added the WKPU module to the project, so it wasn't waking up. Now, I can wake it up. The response "Please keep in mind that the RTD drivers have been tested with Os only, as per the release notes." was helpful; I didn't know that. thank you.

View solution in original post

0 Kudos
Reply
7 Replies
2,440 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @buccno,

Not sure what the issue is, but I understand you want to keep the FIRC running while the MCU is in the Standby mode (Power_Ip_SetMode(&Power_Ip_aModeConfigPB[2U])).

The FIRC must be enabled in the Standby mode first.

It is disabled in teh project.

danielmartynek_0-1700058116632.png

 

Regards,

Daniel

 

 

 

0 Kudos
Reply
2,437 Views
buccno
Contributor III

Thank you for your response, but the MCU still doesn't wake up. When it goes into standby mode, the power downs from 50mA to 20mA(20mA is too big for standby I think btw), but I can't seem to wake it up.

Honestly, I can't figure out the reason, and I'm sharing the code I'm working on. Everything looks correct, but where is the issue?

Also, should I use the RTC_Ip_Trigger function before entering standby mode?

0 Kudos
Reply
2,426 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Let me look at the project.

Meanwhile refer to the examples here:

https://community.nxp.com/t5/S32K/s32k312-RTC-not-working/td-p/1512153

 

Regards,

Daniel

2,417 Views
buccno
Contributor III
Thanks, I'm waiting for your response after your review.

Thanks for the code examples, but I have already reviewed all the sample projects in the community.





0 Kudos
Reply
2,358 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @buccno,

I haven't much time testing it.

  • The FIRC clock must be configured to 48 MHz during the RUN - STANDBY transition:

danielmartynek_0-1700668356547.png

  • The system clock must be configured to on of the examples in the RM, Section 24.7.2 Clocking use case examples. The examples can be changed, however, the divider ratio must be maintained.

danielmartynek_1-1700668523048.png

 

  • I see you use O0 optimization.

Please keep in mind that the RTD drivers have been tested with Os only, as per the release notes.

 

Regards,

Daniel

 

 

0 Kudos
Reply
2,350 Views
buccno
Contributor III
I solved the problem. I hadn't added the WKPU module to the project, so it wasn't waking up. Now, I can wake it up. The response "Please keep in mind that the RTD drivers have been tested with Os only, as per the release notes." was helpful; I didn't know that. thank you.
0 Kudos
Reply
2,467 Views
buccno
Contributor III

In addition to 

 
uint32 retval = Clock_Ip_GetClockFrequency(CLKOUT_RUN_CLK);
uint32 ret_val2 = Clock_Ip_GetClockFrequency(CLKOUT_STANDBY_CLK);

 

This retval = 48 MHz, because I set it to FIRC clock.

ret_val2 = 24 MHz, FIRC/2. 

but when I look pins with oscilloscope for freqs

buccno_0-1699960699224.png

this two pin equal to each other(48 MHz), why?

0 Kudos
Reply