cancel
Showing results for 
Search instead for 
Did you mean: 

CAN bus stop working when cpu is put in sleep (STM32F205VGTX)

HSagh.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

2 REPLIES 2
SofLit
ST Employee

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.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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.