2018-12-05 11:55 AM
We have the following situation: We want to use
the FDCAN of the STM32H743ZI with 500 kbit/s. We've got following
configuration parameters for the FDCAN1:
hfdcan1.Instance = FDCAN1;
hfdcan1.Init.FrameFormat = FDCAN_FRAME_CLASSIC;
hfdcan1.Init.Mode = FDCAN_MODE_NORMAL;
hfdcan1.Init.AutoRetransmission = DISABLE;
hfdcan1.Init.TransmitPause = DISABLE;
hfdcan1.Init.NominalPrescaler = 50;
hfdcan1.Init.NominalSyncJumpWidth = 1;
hfdcan1.Init.NominalTimeSeg1 = 13;
hfdcan1.Init.NominalTimeSeg2 = 2;
hfdcan1.Init.DataPrescaler = 50;
hfdcan1.Init.DataSyncJumpWidth = 1;
hfdcan1.Init.DataTimeSeg1 = 13;
hfdcan1.Init.DataTimeSeg2 = 2;
hfdcan1.Init.MessageRAMOffset = 0;
hfdcan1.Init.StdFiltersNbr = 1;
hfdcan1.Init.ExtFiltersNbr = 0;
hfdcan1.Init.RxFifo0ElmtsNbr = 64;
hfdcan1.Init.RxFifo0ElmtSize = FDCAN_DATA_BYTES_8;
hfdcan1.Init.RxFifo1ElmtsNbr = 64;
hfdcan1.Init.RxFifo1ElmtSize = FDCAN_DATA_BYTES_8;
hfdcan1.Init.RxBuffersNbr = 64;
hfdcan1.Init.RxBufferSize = FDCAN_DATA_BYTES_8;
hfdcan1.Init.TxEventsNbr = 0;
hfdcan1.Init.TxBuffersNbr = 2;
hfdcan1.Init.TxFifoQueueElmtsNbr = 2;
hfdcan1.Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
hfdcan1.Init.TxElmtSize = FDCAN_DATA_BYTES_8;
hfdcan1.msgRam.StandardFilterSA = 0x4000AC00;
hfdcan1.msgRam.ExtendedFilterSA = 0x4000AC40;
hfdcan1.msgRam.RxFIFO0SA = 0x4000AC80;
hfdcan1.msgRam.RxFIFO1SA = 0x4000ACC0;
hfdcan1.msgRam.RxBufferSA = 0x4000AD00;
hfdcan1.msgRam.TxEventFIFOSA = 0x4000AD40;
hfdcan1.msgRam.TxBufferSA = 0x4000AD80;
hfdcan1.msgRam.TxFIFOQSA = 0x4000ADC0;
hfdcan1.msgRam.TTMemorySA = 0x4000AE00;
hfdcan1.msgRam.EndAddress = 0x4000D3FF;
hfdcan1.ErrorCode = 0;
The problem is that Busmaster now only receives Bit and Stuffing errors when we
try to transmit our message frames. We suspect our parameter configuration to mismatch
with Busmaster's baud configuration. Does anyone tested the H7 FDCAN and has experience
in choosing the correct values? Thank you very much.
2019-10-09 07:53 AM
One part that needs configuring that isn't shown here is the clock speed of the FDCAN port, so maybe you missed that. If you are communicating with another ST device, it will work if you set the clock speed of the port and these FDCAN timing parameters to the same values.