Skip to content

Conversation

@TD-JBL
Copy link
Contributor

@TD-JBL TD-JBL commented Sep 3, 2025

This PR adds FDCAN support for STM32H7RS series microcontrollers.
As the H7RSx doesn't have the clock calibration unit (CCU) inside the FDCAN peripheral and a different message RAM size compared to H7x, I took the H5x configuration as template for this change. According to the reference manuals, the FDCAN peripheral is the same (except for register addresses, clock source and interrupt numbers).

Changes:

SoC support: Add FDCAN1 and FDCAN2 controller configurations for STM32H7RS series

  • Includes register addresses, clock sources and interrupt definitions
  • Board Support: Add FDCAN1 to NUCLEO_H7S3L8 board. PD0 (RX) and PD1 (TX) are used for interfacing an external CAN transceiver according to the breakout connector description in the board's schematic.

Clock Configuration:

I added the second (optional) clock to the configuration (called domain clock in the driver), even if the HSE is already the default clock source. But programmers can then see more quickly how they can adjust the clock source.

Testing Status:

  • Tested on NUCLEO-H7S3L8 for FDCAN1 with external Waveshare SN65HVD230 CAN transceiver with samples/drivers/can/babbling.
  • Tested on NUCLEO-H7S3L8 for FDCAN2 with external Waveshare SN65HVD230 CAN transceiver with custom board definition and app.

@github-actions
Copy link

github-actions bot commented Sep 3, 2025

Hello @TD-JBL, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency in commits header lines in the Git revisions history, could your change it:

-dts: st: stm32h7rs: Add fdcan1 and fdcan2 configuration
+dts: arm: st: h7rs: Add fdcan1 and fdcan2 configuration 

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please enable the node at board level so we have a way to test it in CI

@TD-JBL
Copy link
Contributor Author

TD-JBL commented Sep 4, 2025

Please enable the node at board level so we have a way to test it in CI

The NUCLEO-H7S3L8 does not have a CAN transceiver onboard. Is it useful to enable CAN on some random pins on the breakout headers for this board? The bigger STM32H7S78-DK also does not have a CAN receiver. I'm not aware of other H7RSx boards.

@erwango
Copy link
Member

erwango commented Sep 4, 2025

The NUCLEO-H7S3L8 does not have a CAN transceiver onboard. Is it useful to enable CAN on some random pins on the breakout headers for this board? The bigger STM32H7S78-DK also does not have a CAN receiver. I'm not aware of other H7RSx boards.

Indeed, CAN transceivers are generally missing, but yet it could be enabled on board to run basic driver initialization. See other STM32 boards with CAN enabled for reference: https://docs.zephyrproject.org/latest/boards/index.html#vendor=st&features=can

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For commit "boards: arm: st: nucleo_h7s3l8: Add fdcan1":
Could you break lines (74char/line) in the commit message body?

@TD-JBL TD-JBL force-pushed the h7rs_fdcan branch 2 times, most recently from 7b38bb4 to 4ef43b1 Compare September 5, 2025 08:54
@TD-JBL
Copy link
Contributor Author

TD-JBL commented Sep 5, 2025

For commit "boards: arm: st: nucleo_h7s3l8: Add fdcan1": Could you break lines (74char/line) in the commit message body?

Sure, I thought the 74 char limit was only for the first line, already fixed. And thanks for catching my repeating copy'n'paste 8U -> 8 errors ;)

@etienne-lms
Copy link
Contributor

etienne-lms commented Sep 5, 2025

In case it helps, you can file find the Zephyr guidelines on commit message formatting at:
https://docs.zephyrproject.org/latest/contribute/guidelines.html#commit-message-guidelines

erwango
erwango previously approved these changes Sep 5, 2025
Comment on lines 173 to 174
clocks = <&rcc STM32_CLOCK(APB1_2, 8)>,
<&rcc STM32_SRC_HSE FDCAN_SEL(0)>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non blocking: Adding clocks here is optional, but it could be clearer to keep it indeed.

Provide the soc configuration for fdcan1 and fdcan2 controllers.
This includes registers address, clocks and interrupt lines
details.

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
Enable support for FDCAN1 on nucleo_h7s3l8 board. PD0 (RX) and PD1 (TX)
are used for interfacing an external CAN transceiver according to the
breakout connector description in the board's schematic.

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
@sonarqubecloud
Copy link

@cfriedt cfriedt merged commit 7391cfa into zephyrproject-rtos:main Sep 16, 2025
34 of 36 checks passed
@TD-JBL TD-JBL deleted the h7rs_fdcan branch September 17, 2025 05:45
TD-JBL added a commit to JB-Lighting/zephyr that referenced this pull request Oct 14, 2025
Fix wrong heading type in index.rst introduced with PR zephyrproject-rtos#95388

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
TD-JBL added a commit to JB-Lighting/zephyr that referenced this pull request Oct 15, 2025
Fix wrong heading type in index.rst introduced with PR zephyrproject-rtos#95388

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
TD-JBL added a commit to JB-Lighting/zephyr that referenced this pull request Oct 16, 2025
Fix wrong heading type in index.rst introduced with PR zephyrproject-rtos#95388

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
jhedberg pushed a commit that referenced this pull request Oct 17, 2025
Fix wrong heading type in index.rst introduced with PR #95388

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
Hardevsinh-Palaniya pushed a commit to Hardevsinh-Palaniya/zephyr that referenced this pull request Oct 24, 2025
Fix wrong heading type in index.rst introduced with PR zephyrproject-rtos#95388

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: STM32 ST Micro STM32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants