2024-10-29 06:05 PM - last edited on 2024-10-31 09:16 AM by SofLit
Hello,
I am attempting to have a two stm32 nucleo boards communicate by sending and receiving can messages. My goal is to have the PA5 LED of the STM32 f446re blink when a can message is received. I know that the canbus must be configured to classical can which the baud rate must match both boards. The two boards I am using are the stm32 f446re and the stm32 h723zg. Currently, I suspect an electrical issue as I have been running a two 220 ohm resistors in parallel with the CAN_H and CAN_L lines, but when in a recessive state the CANH and CANL both read 2.2V and fail to change when in the dominant state. However, I want to ensure that the software is also not the issue. I am also using two waveshare SN65HVD230 can transceivers as well.
Any help is appreciated, and I have attached a picture of the set up (ignore the 7 segment) as well as each project's codebase.
Solved! Go to Solution.
2024-10-31 09:12 AM - edited 2024-10-31 09:18 AM
After checking your RCC clock config it seems you are configuring the HSE for Crystal/Resonator while these crystals on both Nucleo boards are not present. And I'm pretty sure your program didn't overpass HAL_RCC_ClockConfig(). See this thread.
Now, you need to refer to the boards' schematics:
Nucleo-F446RE schematics:
Your HSE config is set to Crystal/Resonator:
Nucleo-H723ZI schematics:
Your HSE config is set to Crystal/Resonator:
So for the Nucleo board you need to use HSE in Bypass mode:
As the external crystal is unavailable on these boards, the clock is generated from the STLINK MCO output.
For Nucleo-H723 (featuring STLINK-V3) you need to review my article in this link to configure STLINK MCO frequency output before going ahead.
For NucleoF4 there is nothing to configure on the STLINK (STLINK-V2).
Hope it helps.
2024-10-31 03:48 AM
Hello @MichaelRosol and welcome to the community.
First thing to check is the transceiver RS pin:
2024-10-31 04:38 AM - edited 2024-10-31 04:41 AM
The golden rule with this kind of thing is not to try to do both ends of the link at once!
When you do that, you can't tell whether the problem is with your "sender", or with your "receiver" - or both!
So make your life easier by concentrating on one end of the link at a time, and using some known-good device as the other end.
PS:
https://community.st.com/t5/stm32-mcus-boards-and-hardware/i2c/m-p/668411/highlight/true#M18743
#BothEnds
2024-10-31 06:53 AM
He could start with Loopback mode and validate the communication then move on with Normal mode.
2024-10-31 09:12 AM - edited 2024-10-31 09:18 AM
After checking your RCC clock config it seems you are configuring the HSE for Crystal/Resonator while these crystals on both Nucleo boards are not present. And I'm pretty sure your program didn't overpass HAL_RCC_ClockConfig(). See this thread.
Now, you need to refer to the boards' schematics:
Nucleo-F446RE schematics:
Your HSE config is set to Crystal/Resonator:
Nucleo-H723ZI schematics:
Your HSE config is set to Crystal/Resonator:
So for the Nucleo board you need to use HSE in Bypass mode:
As the external crystal is unavailable on these boards, the clock is generated from the STLINK MCO output.
For Nucleo-H723 (featuring STLINK-V3) you need to review my article in this link to configure STLINK MCO frequency output before going ahead.
For NucleoF4 there is nothing to configure on the STLINK (STLINK-V2).
Hope it helps.