2024-05-19 04:39 PM
On STM32F205VGTX, when I put cpu in sleep by using this command:
HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);
CAN peripheral stops working. It does not acknowlege bus messages anymore and there is no CAN interrupts to wake up the cpu.
I had a look at the datasheet, I was not able to find whether CAN is supposed to or not supposed to work in cpu sleep mode.
My question is if this is how it is supposed to be, or I need to do some more to keep CAN alive in this mode.
Thanks
Solved! Go to Solution.
2024-05-21 01:01 AM
Actually I found the problem. Somewhere hidden in the inititalisation code AxBnLPENR registers were wrongly cleared by a test code that should have been removed. That was the main reason.
I also do not need to enable Autowakeup, becasue I do not put CAN module into SLEEP. I just put cpu into sleep.
2024-05-20 01:27 AM - edited 2024-05-20 01:27 AM
Hell,
Related thread: https://community.st.com/t5/stm32-mcus-products/wake-up-mcu-by-canbus-interruptions-from-sleep-mode-stm32f1/td-p/62564
Did you enable CAN Rx FIFO interrupt?
Did you enable Autowakeup?
Also read "27.4.3 Sleep mode (low-power)" section in RM0033.
2024-05-21 01:01 AM
Actually I found the problem. Somewhere hidden in the inititalisation code AxBnLPENR registers were wrongly cleared by a test code that should have been removed. That was the main reason.
I also do not need to enable Autowakeup, becasue I do not put CAN module into SLEEP. I just put cpu into sleep.