MCAL EcuM - Sleep for S32K118

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCAL EcuM - Sleep for S32K118

2,666 次查看
talha_uyar
Contributor III

Is there a guide or Application Note Document that I can use to understand the EcuM module. I am trying to understand how to use the Wakeup Sources etc. and what modules can Run when the MCU is in sleep mode, as well as the required functions to call. I couldn't find the EcuM Integration Manual or EcuM User Manual. 

If there is no guide or Application Note, can you please tell me how can I set-up a Wakeup Timer and whether the communication peripherals (CAN, LIN, SPI etc.) work when MCU is in the sleep mode? It says in the CAN Integration Manual that a Self-Wakeup functionality can be used if it is available for the hardware. Is it available for S32K118, and if so how can I set it up and use?

Thanks in advance,

M. Talha Uyar

标签 (1)
标记 (2)
0 项奖励
回复
3 回复数

2,542 次查看
hungnguyenphi
NXP Employee
NXP Employee

Hello Muhammet Uyar,

The EcuM in the MCAL driver just support as stub. So it will not have a guide or Application node.
If there is no guide or Application Note, can you please tell me how can I set-up a Wakeup Timer and whether the communication peripherals (CAN, LIN, SPI etc.) work when MCU is in the sleep mode?
[Hung]

  • Please see the "Table 38-4. Module operation in available power modes" in the S32K1xx_RM. It will show us which clocks, peripherals can work in the sleep mode.
  • So basically user can set up the peripheral work on sleep mode by:
    - Configure the peripheral which can run in sleep mode
    - Set the clock of this peripheral to the source clock which can run in sleep mode.
  • As the "Table 39-2. Power mode transition triggers" the MCU will wake-up from sleep mode if it have an interrupt which supported by AWIC (Please see "Table 7-8. AWIC stop and VLPS wake-up sources" ). So to set-up a Wakeup Timer, user just need to choose the correct timer(which can run in sleep mode) and make sure it can generated the interrupt which can handler by AWIC.


Best regards,
Hung.

0 项奖励
回复

2,542 次查看
talha_uyar
Contributor III

Ok, so in the case of GPT using LPIT it can generate interrupt in the STOP1 mode. Here is the main function I wrote:

int main(void)

{
Mcu_Init(&McuModuleConfiguration);
Mcu_InitClock(McuClockSettingConfig_0);
Mcu_SetMode((Mcu_ModeType)MCU_RUN_MODE);

Gpt_Init(&GptChannelConfigSet);
Gpt_EnableNotification(Sample_Timer);
Gpt_EnableWakeup(Sample_Timer);

sys_enableIsrSource(LPIT0_Ch0_IRQn, 0x40);

Gpt_StartTimer(Sample_Timer, 4000000);

Gpt_SetMode(GPT_MODE_SLEEP);
Mcu_SetMode((Mcu_ModeType)MCU_STOP1_MODE);
while(1)
{

}
return 0;
}

But it fails to call Gpt_Timeout_Notification when I run the code. I understand that in the GPT User Manual it is stated the GptNotification is for non-Wakeup notification only. So how can I set up a wakeup notification function for GPT?

Edit: I tried the same thing for Mcu_SetMode((Mcu_ModeType)MCU_STOP2_MODE); and the it also does not call the Gpt_Timeout_Notification.

0 项奖励
回复

2,542 次查看
hungnguyenphi
NXP Employee
NXP Employee

Hello Muhammet Uyar,

In the autosar specification have pointed that the GPT notification will not use for wake up so it will not be called as wake-up notification.

pastedImage_2.png

The specification also mention the GptWakeupConfiguration which use for wakeup notification.

pastedImage_1.png

Best regards,

Hung.

0 项奖励
回复