Skip to main content
Visitor II
May 19, 2024
Solved

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

  • May 19, 2024
  • 1 reply
  • 1224 views

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

    This topic has been closed for replies.
    Best answer by HSagh.1

    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.

    1 reply

    Technical Moderator
    May 20, 2024

    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.

     

    HSagh.1AuthorAnswer
    Visitor II
    May 21, 2024

    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.