cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 CAN Stuck in Normal Mode Acknowledge After Baudrate Change

ramji
Visitor

 

Hello,

I’m using STM32F746 with CAN1 peripheral in Normal mode, and facing an issue during runtime:

  • when the master and slave device communicate at baud rate of 1Mbps and if I change the baud rate of master device to any other baud rate then then gets stuck in a while loop waiting for Normal Mode acknowledgment:

 

// Enter Normal Mode
CAN1->MCR &= ~CAN_MCR_INRQ;
while ((CAN1->MSR & CAN_MSR_INAK) == CAN_MSR_INAK); // stuck here

What I've Done:

  • I perform a software reset before reinitializing CAN:

     
    RCC->APB1RSTR |= RCC_APB1RSTR_CAN1RST;
    RCC->APB1RSTR &= ~RCC_APB1RSTR_CAN1RST;
  • I cleared the BUS-OFF condition manually:

     
    if (CAN1->ESR & CAN_ESR_BOFF)
    { CAN1->ESR = 0; }
  • I enabled auto bus-off recovery:

     
    CAN1->MCR |= CAN_MCR_ABOM;
  • CAN is configured in Normal mode, with filters set and interrupts enabled.

Problem:

After the master changes its baud rate, the STM32 re-initializes, but hangs at the wait for Normal mode acknowledge.

Question:

  • Is there something else needed to recover cleanly from this situation?

  • Do I need to delay or detect bus idle before exiting INIT mode?

  • Any additional register I should clear or sequence to follow?

Any suggestions or official guidance would be appreciated.

0 REPLIES 0