Stm32H7 Can bus communication issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 9:47 AM - last edited on ‎2024-06-12 2:33 AM by mƎALLEm
Hello
I am having an weird issue and was hoping if someone could provide some guidance.
Hardware :
- Two Stm32 H7 with CAN Transciever
- Nvidia Orin
- Can Adapter/Sniffer (Canable)
What works :
- Stm32H7 to Stm32H7 Nucleo Board Can Bus works.
- Nvidia Orin < - > Canable Adapter Can bus works.
Issue :
- Can bus communication from stm32 H7 to Canable Adapter are not coming through. neither Tx nor Rx.
What have i done to troubleshoot
- Checked wirings for High to High and Low to Low and Tx and Rx as well.
- Checked voltages for Rx pins at 3.3v( using level shifters wit h transciever)
- Checked termination resistance and have tested the connections in isolation with both ends terminated with 120ohms ie (stm32- > stm32, Stm32-> adapter, Stm32 -> Orin)
- I have tested with different baud baud rate like 250, 444, 450, 440, 500k.
- Tried different Bit Timing Parameters but to no avail.
Below are my FDCan Parmeters from ioc file.
FDCAN1.AutoRetransmission=ENABLE
FDCAN1.CalculateBaudRateNominal=444444
FDCAN1.CalculateTimeBitNominal=2250
FDCAN1.CalculateTimeQuantumNominal=187.5
FDCAN1.ClockCalibrationCCU=DISABLE
FDCAN1.DataPrescaler=2
FDCAN1.DataSyncJumpWidth=4
FDCAN1.DataTimeSeg1=10
FDCAN1.DataTimeSeg2=3
FDCAN1.FrameFormat=FDCAN_FRAME_CLASSIC
FDCAN1.IPParameters=CalculateTimeQuantumNominal,CalculateTimeBitNominal,CalculateBaudRateNominal,Mode,AutoRetransmission,FrameFormat,NominalSyncJumpWidth,DataSyncJumpWidth,DataTimeSeg1,DataTimeSeg2,StdFiltersNbr,RxBuffersNbr,RxBufferSize,TxEventsNbr,TxBuffersNbr,TxElmtSize,NominalPrescaler,NominalTimeSeg1,NominalTimeSeg2,DataPrescaler,RxFifo1ElmtsNbr,TxFifoQueueElmtsNbr,RxFifo0ElmtsNbr,ClockCalibrationCCU,ProtocolException
FDCAN1.Mode=FDCAN_MODE_NORMAL
FDCAN1.NominalPrescaler=8
FDCAN1.NominalSyncJumpWidth=1
FDCAN1.NominalTimeSeg1=6
FDCAN1.NominalTimeSeg2=5
FDCAN1.ProtocolException=ENABLE
FDCAN1.RxBufferSize=FDCAN_DATA_BYTES_12
FDCAN1.RxBuffersNbr=10
FDCAN1.RxFifo0ElmtsNbr=10
FDCAN1.RxFifo1ElmtsNbr=10
FDCAN1.StdFiltersNbr=0
FDCAN1.TxBuffersNbr=10
FDCAN1.TxElmtSize=FDCAN_DATA_BYTES_12
FDCAN1.TxEventsNbr=10
FDCAN1.TxFifoQueueElmtsNbr=10
can anyone please advise on what to do to make STM32 communication work with other CAN devices?
Solved! Go to Solution.
- Labels:
-
CAN
-
FDCAN
-
STM32H7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-12 10:26 AM
Don't forget to check:
SB72 and R5 should be soldered:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-12 8:12 PM - edited ‎2024-06-12 8:18 PM
Thank you once again for the response and all the help thus far!
I tried what you suggested, but seems like I am still missing something.
- configured HSE to use Nucleo Clock.
- Changed clock configuration for HSE ->PLL1Q and PLL1Q -> FDCAN
- Input clock changed to 8 mhz.
- Set Bit parameters for 500k as shown in 3.FDCan.png
- Verified SB72 is jumped and R5 is present. do I need to remove R5 and jump it?
can you please review one more time and provide some more ideas as to what might not be going right..
   
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-12 9:17 PM
draw a block diagram of how you're connecting the H7/CAN transceiver to the Canable. Include the terminating resistors, ground reference. Is the terminating resistor on the Canable enabled?
Canable are made from all kinds of 3rd party vendors. Some have isolation circuits. Do you have V1, V1 Pro or V2 of the Canable? A link to the Canable would help.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-13 1:15 AM - edited ‎2024-06-13 10:19 AM
Hello,
"do I need to remove R5 and jump it?"
-> No need for that.
Could you please check with an oscilloscope the HSE frequency using MCO pin (PA8)? Do you get 8MHz?
I've attached your ioc file where I enabled MCO on PA8 to output a mirror of the HSE signal.
Need also to share with us more details about your HW, the transceivers part number (if possible the schematics of that part) you are using and as stated by @Karl Yamashita a block diagram of your connections and check the availability termination resistors at each node side: you need only two terminating resistors (no more nor less) of 120 ohm at both sides of the bus.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-14 6:13 PM
Hello,
Good evening,
Sorry I could not get back earlier.   
Please see below for the transceivers and the schematics of the circuits.     
Please note I don't have a scope, and I have just ordered one and will take me a couple days to report the results.
Meanwhile, can you please give me any other ideas to try? I am going to try again with a with a different baud rates, but other than that I don't have any other ideas...
Have a good evening!!
Thank you for all your help thus far!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-14 6:57 PM
More than likely the level shifter is causing an issue. An oscilloscope will help determine what is going on.
Also, I assume that you didn't connect the 3.3V to ground as shown in the schematic?
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-14 7:34 PM
Hi Karl,
Yea, in first image stm32 to stm32 where can bus works there was an error with wiring. please see attached revised.  
In my opinion level shifter is not the culprit because stm32->stm32 can bus works. Would you not agree?
So to conclude, I will report how does HSE/MCO on PA8 mirror looks like tomorrow once the scope arrives.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-15 7:02 AM
Thanks @Karl Yamashita @mÆŽALLEm
My Can BUS works. I think it was a combination of clock, Bit timing parameters, and (maybe) RCC Prescaler disabled.
Thank you soo very much!!

- « Previous
-
- 1
- 2
- Next »