2021-09-12 02:00 AM
Hi there,
I have problems when I m using the FDCAN controller. I m using the NUcleo STM32h745ZI with a shield with a can controller on in CLASSICAL CAN mode (NO FDCAN).
If a run an example in the HAL_Driver folder it works ( @1MHz Fdcan kern freq = 40MHz )
I need a baudrate @500Kb/s so I just configured the fdcan in this way:
hfdcan1.Instance = FDCAN1;
hfdcan1.Init.FrameFormat = FDCAN_FRAME_CLASSIC;
hfdcan1.Init.Mode = FDCAN_MODE_NORMAL;
hfdcan1.Init.AutoRetransmission = ENABLE;
hfdcan1.Init.TransmitPause = DISABLE;
hfdcan1.Init.ProtocolException = ENABLE;
hfdcan1.Init.NominalPrescaler = 0x1; /* tq = NominalPrescaler x (1/fdcan_ker_ck) */
hfdcan1.Init.NominalSyncJumpWidth = 8;
hfdcan1.Init.NominalTimeSeg1 = 63; /* NominalTimeSeg1 = Propagation_segment + Phase_segment_1 */
hfdcan1.Init.NominalTimeSeg2 = 16;
hfdcan1.Init.MessageRAMOffset = 0;
hfdcan1.Init.StdFiltersNbr = 1;
hfdcan1.Init.ExtFiltersNbr = 0;
hfdcan1.Init.RxFifo0ElmtsNbr = 10;
hfdcan1.Init.RxFifo0ElmtSize = FDCAN_DATA_BYTES_8;
hfdcan1.Init.RxFifo1ElmtsNbr = 0;
hfdcan1.Init.RxBuffersNbr = 0;
hfdcan1.Init.TxEventsNbr = 0;
hfdcan1.Init.TxBuffersNbr = 0;
hfdcan1.Init.TxFifoQueueElmtsNbr = 10;
hfdcan1.Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
hfdcan1.Init.TxElmtSize = FDCAN_DATA_BYTES_8;
if (HAL_FDCAN_Init(&hfdcan1) != HAL_OK)
if a send or receive it works but when I try to do at the same time the FDCAN controller stops working. I m sure that the ccan configuration is fine for running @500Kb/s
Thanks
Davide
2021-09-12 02:11 AM
I just tried making work with the following settings for the NominalTimeSeg1:
hfdcan1.Init.NominalTimeSeg1 = 64; /* NominalTimeSeg1 = Propagation_segment + Phase_segment_1
instead of 63 even if 63 should be the right value.
After 30 minutes it s still working.
Anyone has any idea?
Thanks
Regards
Davide