Skip to content

Commit

Permalink
boards: shields: add TI TCAN4550 evaluation module
Browse files Browse the repository at this point in the history
Add shield definition for the TI TCAN4550EVM, an evaluation module for the
TI TCAN4x5x CAN controller series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information
henrikbrixandersen authored and carlescufi committed Sep 11, 2023
1 parent 9bd62f1 commit 33167d3
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS.yml
Expand Up @@ -713,6 +713,7 @@ Release Notes:
- str4t0m
files:
- boards/shields/mcp2515/
- boards/shields/tcan4550evm/
- doc/hardware/peripherals/canbus/
- drivers/can/
- drivers/net/canbus.c
Expand Down
5 changes: 5 additions & 0 deletions 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)
68 changes: 68 additions & 0 deletions 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
Binary file added boards/shields/tcan4550evm/doc/tcan4550evm.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions boards/shields/tcan4550evm/tcan4550evm.overlay
@@ -0,0 +1,43 @@
/*
* Copyright (c) 2023 Vestas Wind Systems A/S
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
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>;
};
};
};

0 comments on commit 33167d3

Please sign in to comment.