STM32H7 FDCAN Goes to INIT when sending first message
- February 8, 2022
- 5 replies
- 3567 views
I have a STM32H745 Nucleo and I am trying to get the CAN peripheral working. I believe I have everything set up correctly (bit rate, RAM etc) but when I call HAL_FDCAN_AddMessageToTxFifoQ() the first time the peripheral goes back to INIT. The next call to it fails because the FIFO (size of 1 in current code) is full and the message never gets sent. I've attached the entire project including the ioc. The FDCAN configuration and sending code was basically copied from the the H7 DISCO board example. I've tried increasing the TxFifo size but nothing really changes. The FIFO fills up and then the AddMessage call fails. Always on the first call, the CCCR.INIT bit goes high when the line
hfdcan->Instance->TXBAR = ((uint32_t)1 << PutIndex);
is executed in the HAL_FDCAN_AddMessageToTxFifoQ() call.
Any help is appreciated.
