cancel
Showing results for 
Search instead for 
Did you mean: 

How to wakeup the system after few Hr's when system is in Stanbymode.

Shivananda SS
Associate II
Posted on October 25, 2017 at 05:43

Hello Team,

This is Shivananda from Robert BOSCH. we are using  SPC584Cx/SPC58ECx 32-bit MCU family (Chorus 4M).

we need to implement a feature when system in stanbymode, after 5 hours self wakeup of system should happen.

Hope using Timer/Counter concept we need to achieve 5 hours count  and also using '

Smart Standby Wakeup unit� (SSWU) we can Wakeup the system.

As per reference manual I have this information

IRCOSC is also the system clock available during the STANDBY and it is placed in

STANDBY power domain.

Is it possible to implement this feature in Chorus4M???? if Pls can anyone help me in this to implement this feature.

- I need Register details which are required to achieve this

      1. How to run timer in stanbymode and which and how to enable clock to run the timer.

      2. After 5 hrs. of time how can I wakeup the system( which registers need to program).

Thanks and Regards,

Shiva

9739636666

#standbymode #automotive #sleep-wakeup #lowpower-sleep
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
7 REPLIES 7
Erwan YVIN
ST Employee
Posted on October 25, 2017 at 09:47

Hello Shivananda ,

To wakeup after few hours, i would use RTC Clock to trigger a wakeup.

0690X00000608gQQAQ.png

Even if SSWU is more complicated than STANDBY SPC56 , we have some Example in SPC56 Family (SPC5Studio)

SPC560Dxx OS-Less STANDBY SRAM Test Application for Discovery

SPC560Dxx_RLA RTC Test Application for Discovery

Anyway, I am asking to the application team is such application is existing on Chorus 4M.

            Best regards

                         Erwan

Posted on October 25, 2017 at 10:57

Thank you Erwan.

Pls let me know any use case( code) is available to achieve above functionality.

Requirement is System need to self wakeup after 5 hours. Is it possible?

Posted on October 25, 2017 at 11:52

Yes, with RTC you can put 5 hours you have just find the good Compare Value register

(RTC_APIVAL)

0690X00000608kBQAQ.png

        Best regards

                      Erwan

Shivananda SS
Associate II
Posted on October 26, 2017 at 08:31

Yvin.Erwan

Thanks for the input.

I gone through the RTC chapter. By using set of registers in RTC we can achieve this.

But I have3 questions.

1. How to enable RTC in Standby mode or default it is enabled ?

2. Which is the clock source for RTC and How to configure it (which are the registers need to program)?

3. Is there link between RTC and SSWU? After 5 hours system needs to wakeup according to this RTC interrupt will trigger SSWU for system wakeup? I have attached the image which shows the relation.

0690X00000608UJQAY.png

Erwan YVIN
ST Employee
Posted on October 31, 2017 at 23:04

Hello Shiva ,

After checking the RM , there is no PCTL associated on SPC58 Family

I think that RTC is not switched off in Low Power Mode. (STANDBY or STOP mode)

i will answer you next monday.

check the Chapter 96 for the specific registers for RTC

   Best Regards

                      Erwan

Shivananda SS
Associate II
Posted on November 02, 2017 at 04:54

Yvin.Erwan

I started coding I have put ???? in where I need support. Pls see the below code.

/* MCU registers to enable RTC */

??????

/* Clock configuration to RTC in stanbymode */

/*---------------------------------

STANDBY configuration

------------------------------------*/

PMCDIG.MISC_CTRL_REG.B.SIRC_ENB = 0; // Enable SIRC in running modes

LPRCOSC.CTL.B.LPRCON_STDBY = 1; // Enable SIRC in STANDBY

/*WAKEUP registers program */

WKPU.WRER.R |= 0x02; /* Enable Wakeup1 which is connected to RTC module */

/*RTC module configuration */

RTC_API.RTCS.B.RTCF = 1; // Clear the RTC flag by writing 1

RTC_API.RTCC.B.CNTEN = 0; // reset the counter

RTC_API.RTCC.R = 0x80009001; //start RTC counter :CNTEN = 1 , APIEN= 1 , CLKSE = 01 , TRIG_EN = 1

used, Trigger enabled */

RTC_API.RTCVAL.R = 0x0009C400; // T=5sec

OR /* In these two registers which one we should use ?????? */

RTC_API.APIVAL.R = 0x00001000; // API period =25msec

/* Interrupt Handling */

??????????

Posted on November 06, 2017 at 10:43

Hello Shiva ,

i have checked the IP RTC between SPC56 and SPC58

it is the same IP

1) Check the applicationSPC560Dxx_RLA RTC Test Application for Discovery

2) After init your RTC IP , Enable the interruption

INTC_PSR(SPC_RTC0_INT_NUMBER) = SPC5_RTC0_IRQ_PRIORITY;�?�?

3) Serve your interrupt

/**  * @brief RTC interrupt handler.  *  * @isr  */ IRQ_HANDLER(SPC_RTC0_HANDLER) {  IRQ_PROLOGUE();   spc5xx_serve_rtc_interrupt(&RTCD1)   IRQ_EPILOGUE(); } �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Best regards

Erwan

________________

Attachments :

rtc_lld.h.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyKp&d=%2Fa%2F0X0000000b67%2Fao5uMCQr4XIjVL9gvpPWRBqEYhq1KrmOpTaTHAxwxuQ&asPdf=false

rtc_lld.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyL4&d=%2Fa%2F0X0000000b6A%2Frm_20OqRVf3HCILMyytShgulYkHCpH6zg3FbUGWbDFU&asPdf=false