Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards: st: stm32h745i_disco: Use PLL2Q as FDCAN clock source #72821

Merged

Conversation

darkmoon32
Copy link
Contributor

@darkmoon32 darkmoon32 commented May 15, 2024

With this configuration of the device tree, we use 80 MHz as a FDCAN bus clock. This configuration allows to pass the tests.

$ ./zephyr/scripts/twister -p stm32h745i_disco/stm32h745xx/m7 --device-testing --device-serial /dev/ttyACM0 -v -t can
ZEPHYR_BASE unset, using "/media/jurenat/data/zephyrproject/zephyr"
Renaming output directory to /media/jurenat/data/zephyrproject/twister-out.1
INFO    - Using Ninja..
INFO    - Zephyr version: v3.6.0-4042-ge2db06649d88
INFO    - Using 'zephyr' toolchain.
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /media/jurenat/data/zephyrproject/twister-out/testplan.json

Device testing on:

| Platform                        | ID   | Serial device   |
|---------------------------------|------|-----------------|
| stm32h745i_disco/stm32h745xx/m7 |      | /dev/ttyACM0    |

INFO    - JOBS: 16
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - 2590/2605 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/api/drivers.can.api.nxp_s32_canxl.non_rx_fifo SKIPPED (runtime filter)
INFO    - 2591/2605 stm32h745i_disco/stm32h745xx/m7 tests/net/socket/can/net.socket.can                PASSED (device 12.816s)
INFO    - 2592/2605 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/shell/drivers.can.shell          PASSED (device 7.864s)
INFO    - 2593/2605 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/conformance/canbus.isotp.conformance.fd.txdl_64 PASSED (device 13.532s)
INFO    - 2594/2605 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/conformance/canbus.isotp.conformance PASSED (device 12.942s)
INFO    - 2595/2605 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/conformance/canbus.isotp.conformance.fd.txdl_32 PASSED (device 12.602s)
INFO    - 2596/2605 stm32h745i_disco/stm32h745xx/m7 samples/net/sockets/can/sample.net.sockets.can.two_sockets PASSED (device 5.173s)
INFO    - 2597/2605 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/conformance/canbus.isotp.conformance.fd.unused PASSED (device 12.946s)
INFO    - 2598/2605 stm32h745i_disco/stm32h745xx/m7 samples/drivers/can/babbling/sample.drivers.can.babbling PASSED (device 1.875s)
INFO    - 2599/2605 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/api/drivers.can.api              PASSED (device 4.322s)
INFO    - 2600/2605 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/timing/drivers.can.timing        PASSED (device 2.426s)
INFO    - 2601/2605 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/implementation/canbus.isotp.implementation PASSED (device 18.263s)
INFO    - 2602/2605 stm32h745i_disco/stm32h745xx/m7 samples/drivers/can/counter/sample.drivers.can.counter PASSED (device 2.247s)
INFO    - 2603/2605 stm32h745i_disco/stm32h745xx/m7 samples/subsys/canbus/isotp/sample.subsys.canbus.isotp PASSED (device 2.977s)
INFO    - 2604/2605 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/api/drivers.can.api.rtr          PASSED (device 4.113s)
INFO    - 2605/2605 stm32h745i_disco/stm32h745xx/m7 samples/net/sockets/can/sample.net.sockets.can.one_socket PASSED (device 5.167s)

INFO    - 2809 test scenarios (2605 test instances) selected, 2590 configurations skipped (2589 by static filter, 1 at runtime).
INFO    - 15 of 2605 test configurations passed (100.00%), 0 failed, 0 errored, 2590 skipped with 0 warnings in 162.47 seconds
INFO    - In total 251 test cases were executed, 14213 skipped on 1 out of total 2 platforms (50.00%)
INFO    - 15 test configurations executed on platforms, 0 test configurations were only built.

Hardware distribution summary:

| Board                           | ID   |   Counter |
|---------------------------------|------|-----------|
| stm32h745i_disco/stm32h745xx/m7 |      |        15 |
INFO    - Saving reports...
INFO    - Writing JSON report /media/jurenat/data/zephyrproject/twister-out/twister.json
INFO    - Writing xunit report /media/jurenat/data/zephyrproject/twister-out/twister.xml...
INFO    - Writing xunit report /media/jurenat/data/zephyrproject/twister-out/twister_report.xml...
INFO    - Run completed

erwango
erwango previously approved these changes May 16, 2024
Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

64 MHz is an odd clock rate for CAN FD. Is it not possible to use one of the CiA recommended clock rates (20, 40, or 80 MHz)?

FRASTM
FRASTM previously approved these changes May 17, 2024
@darkmoon32
Copy link
Contributor Author

@henrikbrixandersen It can be done with a small change to the clock tree. Should I change it to 80 MHz?

@erwango
Copy link
Member

erwango commented May 17, 2024

@henrikbrixandersen It can be done with a small change to the clock tree. Should I change it to 80 MHz?

When doing so, please check that this won't have impact on other users of the selected domain clock

@darkmoon32
Copy link
Contributor Author

@henrikbrixandersen It can be done with a small change to the clock tree. Should I change it to 80 MHz?

When doing so, please check that this won't have impact on other users of the selected domain clock

I am using CubeMX to validate the clock tree and so far it looks fine, but I will double-check.

@henrikbrixandersen
Copy link
Member

@henrikbrixandersen It can be done with a small change to the clock tree. Should I change it to 80 MHz?

If possible.

With this configuration of the device tree, we use 80 MHz as
a FDCAN bus clock. This configuration allows to pass the tests.

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
@darkmoon32 darkmoon32 dismissed stale reviews from FRASTM, alexanderwachter, and erwango via 70b965f May 17, 2024 08:34
@darkmoon32 darkmoon32 force-pushed the stm32h745i-disco-fix-can-support branch from faf322f to 70b965f Compare May 17, 2024 08:34
@darkmoon32
Copy link
Contributor Author

Rebased and changed clock to 80 MHz.

./zephyr/scripts/twister -p stm32h745i_disco/stm32h745xx/m7 --device-testing --device-serial /dev/ttyACM0 -v -t can
ZEPHYR_BASE unset, using "/media/jurenat/data/zephyrproject/zephyr"
Renaming output directory to /media/jurenat/data/zephyrproject/twister-out.11
INFO    - Using Ninja..
INFO    - Zephyr version: v3.6.0-4136-g420ad8e2c2e5
INFO    - Using 'zephyr' toolchain.
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /media/jurenat/data/zephyrproject/twister-out/testplan.json

Device testing on:

| Platform                        | ID   | Serial device   |
|---------------------------------|------|-----------------|
| stm32h745i_disco/stm32h745xx/m7 |      | /dev/ttyACM0    |

INFO    - JOBS: 16
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - 2591/2606 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/api/drivers.can.api.nxp_s32_canxl.non_rx_fifo SKIPPED (runtime filter)
INFO    - 2592/2606 stm32h745i_disco/stm32h745xx/m7 tests/net/socket/can/net.socket.can                PASSED (device 3.686s)
INFO    - 2593/2606 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/shell/drivers.can.shell          PASSED (device 14.457s)
INFO    - 2594/2606 stm32h745i_disco/stm32h745xx/m7 samples/drivers/can/babbling/sample.drivers.can.babbling PASSED (device 3.811s)
INFO    - 2595/2606 stm32h745i_disco/stm32h745xx/m7 samples/subsys/canbus/isotp/sample.subsys.canbus.isotp PASSED (device 3.033s)
INFO    - 2596/2606 stm32h745i_disco/stm32h745xx/m7 samples/net/sockets/can/sample.net.sockets.can.one_socket PASSED (device 5.196s)
INFO    - 2597/2606 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/conformance/canbus.isotp.conformance.fd.txdl_32 PASSED (device 12.636s)
INFO    - 2598/2606 stm32h745i_disco/stm32h745xx/m7 samples/net/sockets/can/sample.net.sockets.can.two_sockets PASSED (device 5.162s)
INFO    - 2599/2606 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/api/drivers.can.api.rtr          PASSED (device 4.155s)
INFO    - 2600/2606 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/api/drivers.can.api              PASSED (device 4.329s)
INFO    - 2601/2606 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/conformance/canbus.isotp.conformance PASSED (device 12.925s)
INFO    - 2602/2606 stm32h745i_disco/stm32h745xx/m7 tests/drivers/can/timing/drivers.can.timing        PASSED (device 2.421s)
INFO    - 2603/2606 stm32h745i_disco/stm32h745xx/m7 samples/drivers/can/counter/sample.drivers.can.counter PASSED (device 2.258s)
INFO    - 2604/2606 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/conformance/canbus.isotp.conformance.fd.unused PASSED (device 12.948s)
INFO    - 2605/2606 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/conformance/canbus.isotp.conformance.fd.txdl_64 PASSED (device 12.630s)
INFO    - 2606/2606 stm32h745i_disco/stm32h745xx/m7 tests/subsys/canbus/isotp/implementation/canbus.isotp.implementation PASSED (device 18.269s)

INFO    - 2810 test scenarios (2606 test instances) selected, 2591 configurations skipped (2590 by static filter, 1 at runtime).
INFO    - 15 of 2606 test configurations passed (100.00%), 0 failed, 0 errored, 2591 skipped with 0 warnings in 198.60 seconds
INFO    - In total 251 test cases were executed, 14217 skipped on 1 out of total 2 platforms (50.00%)
INFO    - 15 test configurations executed on platforms, 0 test configurations were only built.

Hardware distribution summary:

| Board                           | ID   |   Counter |
|---------------------------------|------|-----------|
| stm32h745i_disco/stm32h745xx/m7 |      |        15 |
INFO    - Saving reports...
INFO    - Writing JSON report /media/jurenat/data/zephyrproject/twister-out/twister.json
INFO    - Writing xunit report /media/jurenat/data/zephyrproject/twister-out/twister.xml...
INFO    - Writing xunit report /media/jurenat/data/zephyrproject/twister-out/twister_report.xml...
INFO    - Run completed

@henrikbrixandersen
Copy link
Member

You can probably enable full bitrate testing for this board, then, similar to https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/drivers/can/timing/boards/stm32h735g_disco.conf

@darkmoon32 darkmoon32 changed the title boards: st: stm32h745i_disco: Use PLL1Q as FDCAN clock source boards: st: stm32h745i_disco: Use PLL2Q as FDCAN clock source May 17, 2024
@erwango
Copy link
Member

erwango commented May 20, 2024

@darkmoon32 Please fix compliance checks

Enable testing of all CiA recommended bitrates on the STM32H745I.

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
@darkmoon32 darkmoon32 force-pushed the stm32h745i-disco-fix-can-support branch from e1875a8 to ef8c390 Compare May 20, 2024 08:43
@darkmoon32
Copy link
Contributor Author

@darkmoon32 Please fix compliance checks

Sure, how about now?

@jhedberg jhedberg merged commit 2fe8e98 into zephyrproject-rtos:main May 20, 2024
22 checks passed
@darkmoon32 darkmoon32 deleted the stm32h745i-disco-fix-can-support branch May 20, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants