cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 FDCAN Communication problem in classic mode

PMego
Associate

Hey guys,

I have this project with STM32H743 MCUs one board uses ZI and second VI version. Sources for both boards were generated in CubeMX.

After many unsuccessful attempts to get these two boards talking to each other via classic CAN I replaced one of the boards with Nucleo F767 board, generated basic code in CubeMX and bam works like champ, can send frame gets ACK from H743 so the baud rate seems to be ok. On the other and, H743VI is in chill and doesnt react to anything except generating the ACK bit.

Both MCUs (H743s) use crystal oscillators (25MHz) as clock source and are running at max 400MHz. Clock source for FDCAN is divided by 2 and set to 200MHz.

My handle config for H743ZI is below, and is same for the VI version.

  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 = 20;
  hfdcan1.Init.NominalSyncJumpWidth = 1;
  hfdcan1.Init.NominalTimeSeg1 = 16;
  hfdcan1.Init.NominalTimeSeg2 = 3;
  hfdcan1.Init.DataPrescaler = 20;
  hfdcan1.Init.DataSyncJumpWidth = 1;
  hfdcan1.Init.DataTimeSeg1 = 16;
  hfdcan1.Init.DataTimeSeg2 = 3;
  hfdcan1.Init.MessageRAMOffset = 0;
  hfdcan1.Init.StdFiltersNbr = 2;
  hfdcan1.Init.ExtFiltersNbr = 0;
  hfdcan1.Init.RxFifo0ElmtsNbr = 32;
  hfdcan1.Init.RxFifo0ElmtSize = FDCAN_DATA_BYTES_8;
  hfdcan1.Init.RxFifo1ElmtsNbr = 32;
  hfdcan1.Init.RxFifo1ElmtSize = FDCAN_DATA_BYTES_8;
  hfdcan1.Init.RxBuffersNbr = 0;
  hfdcan1.Init.RxBufferSize = FDCAN_DATA_BYTES_8;
  hfdcan1.Init.TxEventsNbr = 0;
  hfdcan1.Init.TxBuffersNbr = 0;
  hfdcan1.Init.TxFifoQueueElmtsNbr = 32;
  hfdcan1.Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
  hfdcan1.Init.TxElmtSize = FDCAN_DATA_BYTES_8;
  hfdcan1.msgRam.StandardFilterSA = 0;
  hfdcan1.msgRam.ExtendedFilterSA = 0;
  hfdcan1.msgRam.RxFIFO0SA = 0;
  hfdcan1.msgRam.RxFIFO1SA = 0;
  hfdcan1.msgRam.RxBufferSA = 0;
  hfdcan1.msgRam.TxEventFIFOSA = 0;
  hfdcan1.msgRam.TxBufferSA = 0;
  hfdcan1.msgRam.TxFIFOQSA = 0;
  hfdcan1.msgRam.TTMemorySA = 0;
  hfdcan1.msgRam.EndAddress = 0;
  hfdcan1.ErrorCode = 0;
  if (HAL_FDCAN_Init(&hfdcan1) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

2 REPLIES 2
Khouloud GARSI
Lead II

Hi @Peter M_2ego​ ,

I advise you to have a look on the STM32H743xI Errata sheet, check if you have the same conditions leading to the limitations described in section "FDCAN".

Link:

https://www.st.com/content/ccc/resource/technical/document/errata_sheet/group0/b8/f4/b7/a3/d1/a0/44/a6/DM00368411/files/DM00368411.pdf/jcr:content/translations/en.DM00368411.pdf

Khouloud.

Hi,

Unfortunately this example project doesn't work. In external loopback mode I can recieve data that I transive. but my logic analizer can't recognize that data as CAN communication and as a result device connected to this board can't recieve packet . Please see the pictures:

0690X000009YtcnQAC.jpg

 0690X000009YtcEQAS.jpg