2021-05-05 03:23 AM
Hi All,
I am new in development of controller run in low power mode and resume, I used the STM32F072RBT6 microcontroller.
In my code CAN Peripheral with extended data frame( 1 Byte data) format and three timers are used.
Now, The requirement is when the 0x10 data receive on from CAN bus then I want to enter in low power mode or sleep mode also wakeup when 0x12 data receive. I have used the CAN interrupt method. its not working properly
I have develop in two methods but its not working, I have used the 1st method
1)
if(pHeaderRx.ExtId == 0x072E2510)
{
if(DataRx[0] == 0x12)
{
HAL_CAN_WakeUp(&hcan1);
}
else if(DataRx[0] == 0x10)
{
HAL_CAN_RequestSleep(&hcan1);
}
}
2)
if(pHeaderRx.ExtId == 0x072E2510)
{
if(DataRx[0] == 0x12)
{
HAL_PWR_DisableSleepOnExit ();
HAL_ResumeTick();
}
else if(DataRx[0] == 0x10)
{
HAL_SuspendTick();
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
}
}
Any Help will be highly appreciated
Thanks & Regards,
STAR