diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 51db64aa7ba..3dd26f34b23 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -713,6 +713,7 @@ Release Notes: - str4t0m files: - boards/shields/mcp2515/ + - boards/shields/tcan4550evm/ - doc/hardware/peripherals/canbus/ - drivers/can/ - drivers/net/canbus.c diff --git a/boards/shields/tcan4550evm/Kconfig.shield b/boards/shields/tcan4550evm/Kconfig.shield new file mode 100644 index 00000000000..f76fffe0bb5 --- /dev/null +++ b/boards/shields/tcan4550evm/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2023 Vestas Wind Systems A/S +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_TCAN4550EVM + def_bool $(shields_list_contains,tcan4550evm) diff --git a/boards/shields/tcan4550evm/doc/index.rst b/boards/shields/tcan4550evm/doc/index.rst new file mode 100644 index 00000000000..73e167dcc49 --- /dev/null +++ b/boards/shields/tcan4550evm/doc/index.rst @@ -0,0 +1,68 @@ +.. _tcan4550evm_shield: + +Texas Instruments TCAN4550EVM +############################# + +Overview +******** + +The Texas Instruments `TCAN4550EVM`_ features a `TI TCAN4550-Q1`_ automotive system basis chip (SBC) +with integrated CAN FD controller & transceiver. + +.. figure:: tcan4550evm.jpg + :align: center + :alt: TCAN4550EVM + + TCAN4550EVM (Credit: Texas Instruments) + +Requirements +************ + +This shield can only be used with a board which provides a configuration for Arduino connectors and +defines node aliases for SPI and GPIO interfaces (see :ref:`shields` for more details). + +.. note:: + + This shield configuration limits the maximum SPI clock frequency to 2MHz although the + TCAN4550-Q1 supports up to 18MHz SPI clock frequency. This is done to accommodate the flywires + usually used for connecting the TCAN4550EVM to the board running Zephyr. + +Pin Assignments +=============== + ++-----------------------+---------------------------------------------+ +| Shield Connector Pin | Function | ++=======================+=============================================+ +| D6 | nWKRQ | ++-----------------------+---------------------------------------------+ +| D7 | WAKE_LV | ++-----------------------+---------------------------------------------+ +| D8 | RESET | ++-----------------------+---------------------------------------------+ +| D9 | nINT | ++-----------------------+---------------------------------------------+ +| D10 | nCS | ++-----------------------+---------------------------------------------+ +| D11 | SDI | ++-----------------------+---------------------------------------------+ +| D12 | SDO | ++-----------------------+---------------------------------------------+ +| D13 | SCLK | ++-----------------------+---------------------------------------------+ + +Programming +*********** + +Set ``-DSHIELD=tcan4550evm`` when you invoke ``west build``. For example: + +.. zephyr-app-commands:: + :zephyr-app: tests/drivers/can/api + :board: frdm_k64f + :shield: tcan4550evm + :goals: build + +.. _TCAN4550EVM: + https://www.ti.com/tool/TCAN4550EVM + +.. _TI TCAN4550-Q1: + https://www.ti.com/product/TCAN4550-Q1 diff --git a/boards/shields/tcan4550evm/doc/tcan4550evm.jpg b/boards/shields/tcan4550evm/doc/tcan4550evm.jpg new file mode 100644 index 00000000000..ba24e9c5d74 Binary files /dev/null and b/boards/shields/tcan4550evm/doc/tcan4550evm.jpg differ diff --git a/boards/shields/tcan4550evm/tcan4550evm.overlay b/boards/shields/tcan4550evm/tcan4550evm.overlay new file mode 100644 index 00000000000..8874dbdffdd --- /dev/null +++ b/boards/shields/tcan4550evm/tcan4550evm.overlay @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Vestas Wind Systems A/S + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + chosen { + zephyr,canbus = &tcan4x5x_tcan4550evm; + }; +}; + +&arduino_spi { + status = "okay"; + cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ + + tcan4x5x_tcan4550evm: can@0 { + compatible = "ti,tcan4x5x"; + reg = <0>; + /* reduced spi-max-frequency to accommodate flywire connections */ + spi-max-frequency = <2000000>; + status = "okay"; + clock-frequency = <40000000>; + device-state-gpios = <&arduino_header 12 GPIO_ACTIVE_HIGH>; /* D6 */ + device-wake-gpios = <&arduino_header 13 GPIO_ACTIVE_HIGH>; /* D7 */ + reset-gpios = <&arduino_header 14 GPIO_ACTIVE_HIGH>; /* D8 */ + int-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */ + bosch,mram-cfg = <0x0 15 15 7 7 0 10 10>; + sjw = <1>; + sjw-data = <1>; + sample-point = <875>; + sample-point-data = <875>; + bus-speed = <125000>; + bus-speed-data = <1000000>; + status = "okay"; + + can-transceiver { + max-bitrate = <8000000>; + }; + }; +};