Wakeup event S32k312

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
845件の閲覧回数
sai-bodhanapu
Contributor I

Hello @danielmartynek,  i am working on corestandby, 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 件の賞賛
返信
1 解決策
833件の閲覧回数
giraffe508
Contributor IV

Hello Sai Praveen Bodhanapu,

I understand you are working on core standby mode and facing issues with the wakeup event for the S32K312. Here's an example to help you implement core standby and configure the wakeup event:

   #include 'S32K312.h'   #include 'clocks_and_modes.h'
void SIRC_Init(void) { SCG->SIRCCSR = SCG_SIRCCSR_SIRCDIV(0) | SCG_SIRCCSR_SIRCLPEN_MASK | SCG_SIRCCSR_SIRCEN_MASK; }
void PORT_Init(void) { PCC->PORTC = PCC_PORTC_CGC_MASK; PORTC->PCR[12] = PORT_PCR_MUX(1) | PORT_PCR_PE_MASK | PORT_PCR_PS_MASK; }
int main(void) { SIRC_Init(); PORT_Init();
SMC->PMPROT = SMC_PMPROT_AVLLS_MASK; SMC->PMCTRL = SMC_PMCTRL_STOPM(3); SMC->STOPCTRL = SMC_STOPCTRL_PSTOPO(0) | SMC_STOPCTRL_LLSM(0);
NVIC_EnableIRQ(PORTC_IRQn); NVIC_SetPriority(PORTC_IRQn, 3);
PORTC->PCR[12] |= PORT_PCR_IRQC(0xA);
while (1) { S32_NVIC->ICPR[1] = 1 << (44 % 32); S32_SCB->SCR |= S32_SCB_SCR_SLEEPDEEP_MASK; __asm('WFI'); } }
void PORTC_IRQHandler(void) { if (PORTC->ISFR & (1 << 12)) { PORTC->ISFR = (1 << 12); } }

In this example, the S32K312 is configured to enter core standby mode using the 'WFI' instruction. The wakeup event is configured using the PORTC interrupt. The PORTC_IRQHandler() function is the interrupt service routine that will be executed when the wakeup event occurs.

Make sure to configure the NVIC (Nested Vectored Interrupt Controller) to enable the PORTC interrupt. 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
834件の閲覧回数
giraffe508
Contributor IV

Hello Sai Praveen Bodhanapu,

I understand you are working on core standby mode and facing issues with the wakeup event for the S32K312. Here's an example to help you implement core standby and configure the wakeup event:

   #include 'S32K312.h'   #include 'clocks_and_modes.h'
void SIRC_Init(void) { SCG->SIRCCSR = SCG_SIRCCSR_SIRCDIV(0) | SCG_SIRCCSR_SIRCLPEN_MASK | SCG_SIRCCSR_SIRCEN_MASK; }
void PORT_Init(void) { PCC->PORTC = PCC_PORTC_CGC_MASK; PORTC->PCR[12] = PORT_PCR_MUX(1) | PORT_PCR_PE_MASK | PORT_PCR_PS_MASK; }
int main(void) { SIRC_Init(); PORT_Init();
SMC->PMPROT = SMC_PMPROT_AVLLS_MASK; SMC->PMCTRL = SMC_PMCTRL_STOPM(3); SMC->STOPCTRL = SMC_STOPCTRL_PSTOPO(0) | SMC_STOPCTRL_LLSM(0);
NVIC_EnableIRQ(PORTC_IRQn); NVIC_SetPriority(PORTC_IRQn, 3);
PORTC->PCR[12] |= PORT_PCR_IRQC(0xA);
while (1) { S32_NVIC->ICPR[1] = 1 << (44 % 32); S32_SCB->SCR |= S32_SCB_SCR_SLEEPDEEP_MASK; __asm('WFI'); } }
void PORTC_IRQHandler(void) { if (PORTC->ISFR & (1 << 12)) { PORTC->ISFR = (1 << 12); } }

In this example, the S32K312 is configured to enter core standby mode using the 'WFI' instruction. The wakeup event is configured using the PORTC interrupt. The PORTC_IRQHandler() function is the interrupt service routine that will be executed when the wakeup event occurs.

Make sure to configure the NVIC (Nested Vectored Interrupt Controller) to enable the PORTC interrupt. 

0 件の賞賛
返信
814件の閲覧回数
sai-bodhanapu
Contributor I
Thank you @giraffee508, now its working.
0 件の賞賛
返信