diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index a3272c770cc83..5285cceecedc2 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1273,9 +1273,11 @@ Documentation Infrastructure: collaborators: - alexanderwachter - martinjaeger + - rexut - str4t0m files: - boards/shields/mcp2515/ + - boards/shields/mikroe_can_fd_6_click/ - boards/shields/tcan4550evm/ - doc/connectivity/canbus/ - doc/hardware/peripherals/can/ diff --git a/boards/shields/mikroe_can_fd_6_click/Kconfig.shield b/boards/shields/mikroe_can_fd_6_click/Kconfig.shield new file mode 100644 index 0000000000000..c7ca8fe663e9d --- /dev/null +++ b/boards/shields/mikroe_can_fd_6_click/Kconfig.shield @@ -0,0 +1,6 @@ +# Copyright (c) 2025 Navimatix GmbH +# Copyright (c) 2025 TiaC Systems +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_MIKROE_CAN_FD_6_CLICK + def_bool $(shields_list_contains,mikroe_can_fd_6_click) diff --git a/boards/shields/mikroe_can_fd_6_click/doc/canfd6_click.webp b/boards/shields/mikroe_can_fd_6_click/doc/canfd6_click.webp new file mode 100644 index 0000000000000..55c3c41f126fa Binary files /dev/null and b/boards/shields/mikroe_can_fd_6_click/doc/canfd6_click.webp differ diff --git a/boards/shields/mikroe_can_fd_6_click/doc/index.rst b/boards/shields/mikroe_can_fd_6_click/doc/index.rst new file mode 100644 index 0000000000000..91a421270e907 --- /dev/null +++ b/boards/shields/mikroe_can_fd_6_click/doc/index.rst @@ -0,0 +1,69 @@ +.. _mikroe_can_fd_6_click_shield: + +MikroElektronika CAN FD 6 Click +############################### + +Overview +-------- + +The CAN FD 6 Click shield has a `TI TCAN4550-Q1`_ automotive system +basis chip (SBC) with integrated CAN FD controller via a SPI interface +and a integrated high-speed CAN FD transceiver with up to 5 Mbps. + +More information about the shield can be found at +`Mikroe CAN FD 6 click`_. + +.. figure:: canfd6_click.webp + :align: center + :alt: MikroElektronika CAN FD 6 Click + + MikroElektronika CAN FD 6 Click (Credit: MikroElektronika) + +Requirements +************ + +The shield uses a mikroBUS interface. The target board must define the +``mikrobus_spi`` and ``mikrobus_header`` node labels (see :ref:`shields` +for more details). The target board must also support level triggered +interrupts and SPI clock frequency of up to 18 MHz. + +Programming +*********** + +Set ``--shield mikroe_can_fd_6_click`` when you invoke ``west build``, +for example: + +.. zephyr-app-commands:: + :zephyr-app: tests/drivers/can/api + :board: mikroe_stm32_m4_clicker + :shield: mikroe_can_fd_6_click + :goals: build flash + :gen-args: -DCONFIG_ZTEST_TEST_DELAY_MS=15 + +.. note:: + + Under certain circumstances, e.g., when using the Zephyr console via + USB (CDC-ACM class), the execution of Zephyr tests should be slowed + down artificially by a few milliseconds. This requires applying + ``-DCONFIG_ZTEST_TEST_DELAY_MS=15``, as shown above. + +Also the :ref:`arduino_uno_click` can be used if a board only has a +suitable Arduino UNO R3 header. Include ``--shield arduino_uno_click`` +when you invoke ``west build`` with this mikroBUS shield. For example: + +.. zephyr-app-commands:: + :zephyr-app: tests/drivers/can/api + :board: nucleo_f767zi + :shield: arduino_uno_click,mikroe_can_fd_6_click + :goals: build flash + +References +********** + +.. target-notes:: + +.. _Mikroe CAN FD 6 click: + https://www.mikroe.com/can-fd-6-click + +.. _TI TCAN4550-Q1: + https://www.ti.com/product/TCAN4550-Q1 diff --git a/boards/shields/mikroe_can_fd_6_click/mikroe_can_fd_6_click.overlay b/boards/shields/mikroe_can_fd_6_click/mikroe_can_fd_6_click.overlay new file mode 100644 index 0000000000000..b467e682dac6d --- /dev/null +++ b/boards/shields/mikroe_can_fd_6_click/mikroe_can_fd_6_click.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Navimatix GmbH + * Copyright (c) 2025 TiaC Systems + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + chosen { + zephyr,canbus = &tcan4x5x_mikroe_can_fd_6_click; + }; +}; + +&mikrobus_spi { + status = "okay"; + cs-gpios = <&mikrobus_header 2 GPIO_ACTIVE_LOW>; + + tcan4x5x_mikroe_can_fd_6_click: can@0 { + compatible = "ti,tcan4x5x"; + reg = <0>; + spi-max-frequency = <18000000>; + status = "okay"; + + clock-frequency = <40000000>; + device-state-gpios = <&mikrobus_header 0 GPIO_ACTIVE_HIGH>; + device-wake-gpios = <&mikrobus_header 6 GPIO_ACTIVE_HIGH>; + reset-gpios = <&mikrobus_header 1 GPIO_ACTIVE_HIGH>; + int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>; + bosch,mram-cfg = <0x0 15 15 7 7 0 10 10>; + + can-transceiver { + max-bitrate = <8000000>; + }; + }; +}; diff --git a/boards/shields/mikroe_can_fd_6_click/shield.yml b/boards/shields/mikroe_can_fd_6_click/shield.yml new file mode 100644 index 0000000000000..6842f00b487a3 --- /dev/null +++ b/boards/shields/mikroe_can_fd_6_click/shield.yml @@ -0,0 +1,6 @@ +shield: + name: mikroe_can_fd_6_click + full_name: CAN FD 6 Click + vendor: mikroe + supported_features: + - can diff --git a/tests/drivers/build_all/can/testcase.yaml b/tests/drivers/build_all/can/testcase.yaml index a536ef43ac4f7..d4e0ace41f457 100644 --- a/tests/drivers/build_all/can/testcase.yaml +++ b/tests/drivers/build_all/can/testcase.yaml @@ -16,6 +16,9 @@ tests: - arduino_gpio extra_args: SHIELD=tcan4550evm platform_allow: frdm_k64f + drivers.can.build_all.tcan4x5x.mikrobus: + extra_args: SHIELD=mikroe_can_fd_6_click + platform_allow: mikroe_stm32_m4_clicker drivers.can.build_all.mcp251xfd: extra_args: SHIELD=mikroe_mcp2518fd_click platform_allow: lpcxpresso55s28