cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 does not receive 29Bit-IDs on CAN

GS1
Senior III

Hello all,

I have an issue with receiving CAN Ids with 29 Bit IDs. 11 Bit IDs are working properly, but 29 Bit IDs are not received.

I do not use any filter setting, and in the GlobalFilter Setting I define to receive 29Bit IDs in FIFO0 or FIFO1 (desn't make a difference, Messages are not received with both settings).

Is there anything else which has to be activated to receive 29 Bit IDs?

Any ideas?

Here is my configuration:

...

   halErr = HAL_FDCAN_Stop(phCan);   // Stop CAN

   if (sCanBusInit[nCan].bFDCAN != TRUE)

      phCan->Init.FrameFormat = FDCAN_FRAME_CLASSIC;

   else phCan->Init.FrameFormat = FDCAN_FRAME_FD_BRS;

   if (sCanBusInit[nCan].nOperationMode != CAN_MODE_NORMAL)

   {

      phCan->Init.Mode = (uint32_t)sCanBusInit[nCan].nOperationMode;      // Loop Intern/Extern or Listen only

   }

   else

   {

      phCan->Init.Mode = FDCAN_MODE_NORMAL;

      CLEAR_BIT(phCan->Instance->CCCR, FDCAN_CCCR_TEST);

   }

   phCan->Init.AutoRetransmission = ENABLE;//Retransmission of disturbed Messages DISABLE;

   phCan->Init.TransmitPause = DISABLE;

   phCan->Init.NominalPrescaler = nNominalPrescaler;

   phCan->Init.NominalSyncJumpWidth = 1;

   phCan->Init.NominalTimeSeg1 = nNominalTimeSeg1;

   phCan->Init.NominalTimeSeg2 = nNominalTimeSeg2;

   phCan->Init.DataPrescaler = nDataPrescaler;

   phCan->Init.DataSyncJumpWidth = 1;

   phCan->Init.DataTimeSeg1 = nDataTimeSeg1;

   phCan->Init.DataTimeSeg2 = nDataTimeSeg2;

   phCan->Init.MessageRAMOffset = 0;

   phCan->Init.StdFiltersNbr = 0;

   phCan->Init.ExtFiltersNbr = 0;

   phCan->Init.RxFifo0ElmtsNbr = 64;   // 0..64

   phCan->Init.RxFifo0ElmtSize = FDCAN_DATA_BYTES_8;

   phCan->Init.RxFifo1ElmtsNbr = 64;

   phCan->Init.RxFifo1ElmtSize = FDCAN_DATA_BYTES_8;

   phCan->Init.RxBuffersNbr = 10;   

   phCan->Init.RxBufferSize = FDCAN_DATA_BYTES_8;

   phCan->Init.TxEventsNbr = 0;

   phCan->Init.TxBuffersNbr = 0;

   phCan->Init.TxFifoQueueElmtsNbr = 1;

   phCan->Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;

   phCan->Init.TxElmtSize = FDCAN_DATA_BYTES_8;

   phCan->msgRam.StandardFilterSA = 0;

   phCan->msgRam.ExtendedFilterSA = 0;

   phCan->msgRam.RxFIFO0SA = 0;

   phCan->msgRam.RxFIFO1SA = 0;

   phCan->msgRam.RxBufferSA = 0;

   phCan->msgRam.TxEventFIFOSA = 0;

   phCan->msgRam.TxBufferSA = 0;

   phCan->msgRam.TxFIFOQSA = 0;

   phCan->msgRam.TTMemorySA = 0;

   phCan->msgRam.EndAddress = 0;

   phCan->ErrorCode = 0;

   halErr = HAL_FDCAN_Init(phCan);

   if (halErr != HAL_OK)

   {

      MyErrorHandler(E_CAN_DIV, halErr);

   }

   // Receive all IDs: 11-Bit in FIFO0, 29 Bit in FIFO1

   HAL_FDCAN_ConfigGlobalFilter(phCan, FDCAN_ACCEPT_IN_RX_FIFO0, FDCAN_ACCEPT_IN_RX_FIFO1, FDCAN_REJECT, FDCAN_REJECT);

                                                                  //FDCAN_REJECT_REMOTE, FDCAN_REJECT_REMOTE);

   /* Start the FDCAN module */

   halErr = HAL_FDCAN_Start(phCan);

   halErr = HAL_FDCAN_ActivateNotification(phCan, FDCAN_IT_RX_FIFO0_NEW_MESSAGE, 0);

   halErr = HAL_FDCAN_ActivateNotification(phCan, FDCAN_IT_RX_FIFO1_NEW_MESSAGE, 0);

0 REPLIES 0