Skip to content

Commit

Permalink
boards: teensy4: Update board documentation
Browse files Browse the repository at this point in the history
- insert various additional information content
- use tabs to distinguish board versions
- west flash is now usable for flashing
- show steps for using USB-console
- move images to img subfolder

Bugfix in hardware description file:
Shell and console was mapped to same UART. Remove shell from this port.

Signed-off-by: Bernhard Krämer <[email protected]>
  • Loading branch information
Bernhard Krämer committed Sep 23, 2024
1 parent 23eca63 commit 1040ef9
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 65 deletions.
File renamed without changes
File renamed without changes
251 changes: 187 additions & 64 deletions boards/pjrc/teensy4/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,98 @@ PJRC TEENSY 4

Overview
********

The Teensy is a complete USB-based microcontroller development system, in a
very small footprint, capable of implementing many types of projects. All
programming is done via the USB port.

.. tabs::

.. group-tab:: Teensy 4.0

.. figure:: teensy40.jpg
:align: center
:alt: TEENSY40
.. figure:: img/teensy40.jpg
:align: center
:alt: TEENSY40

TEENSY40 (Credit: https://www.pjrc.com)
(Credit: https://www.pjrc.com)

.. figure:: teensy41.jpg
:align: center
:alt: TEENSY41
.. group-tab:: Teensy 4.1

TEENSY41 (Credit: https://www.pjrc.com)
.. figure:: img/teensy41.jpg
:align: center
:alt: TEENSY41

(Credit: https://www.pjrc.com)

Hardware
********

Teensy 4.0:
.. tabs::

.. group-tab:: Teensy 4.0

- MIMXRT1062DVL6A MCU (600 MHz, 1024 KB on-chip memory)
- 16 Mbit QSPI Flash
- LED
- USB 2.0 host connector
- MIMXRT1062DVL6A MCU (600 MHz, 1024 KB on-chip memory)
- 16 Mbit QSPI Flash
- User LED
- USB 2.0 host connector

Teensy 4.1:
See the `Teensy 4.0 Website`_ for a complete hardware description.

- MIMXRT1062DVJ6A MCU (600 MHz, 1024 KB on-chip memory)
- 64 Mbit QSPI Flash
- LED
- USB 2.0 host connector
- USB 2.0 OTG connector
- 10/100 Mbit/s Ethernet PHY
- TF socket for SD card
.. group-tab:: Teensy 4.1

See the `Teensy 4.0 Website`_ for a complete hardware description.
- MIMXRT1062DVJ6A MCU (600 MHz, 1024 KB on-chip memory)
- 64 Mbit QSPI Flash
- User LED
- USB 2.0 host connector
- USB 2.0 OTG connector
- 10/100 Mbit/s Ethernet transceiver
- TF socket for SD card

To connect an Ethernet cable, additional `Teensy 4.1 Ethernet Kit`_ is required.

See the `Teensy 4.1 Website`_ for a complete hardware description.

Supported Features
==================

The teensy40 board configuration supports the following hardware
The Teensy 4.0 board configuration supports the following hardware
features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| SYSTICK | on-chip | systick |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port-polling; |
| | | serial port-interrupt |
+-----------+------------+-------------------------------------+
| USB | on-chip | USB device |
+-----------+------------+-------------------------------------+

The default configuration can be found in
:zephyr_file:`boards/pjrc/teensy4/teensy40_defconfig`

The teensy41 board configuration supports additional hardware
+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| ADC | on-chip | adc |
+-----------+------------+----------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+----------------------+
| FLASH | on-chip | flash |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| I2C | on-chip | i2c |
+-----------+------------+----------------------+
| I2S | on-chip | i2s |
+-----------+------------+----------------------+
| NVIC | on-chip | arch/arm |
+-----------+------------+----------------------+
| PWM | on-chip | pwm |
+-----------+------------+----------------------+
| RTC | on-chip | system clock |
+-----------+------------+----------------------+
| SPI | on-chip | spi |
+-----------+------------+----------------------+
| CAN | on-chip | can |
+-----------+------------+----------------------+
| UART | on-chip | serial |
+-----------+------------+----------------------+
| USB | on-chip | usb |
+-----------+------------+----------------------+
| TRNG | on-chip | entropy |
+-----------+------------+----------------------+
| WDT | on-chip | watchdog |
+-----------+------------+----------------------+

The Teensy 4.1 board configuration supports additional hardware
features:

+-----------+------------+-------------------------------------+
Expand All @@ -81,10 +107,7 @@ features:
| ENET | on-chip | ethernet |
+-----------+------------+-------------------------------------+

The default configuration can be found in
:zephyr_file:`boards/pjrc/teensy4/teensy41_defconfig`

Other hardware features are not currently supported by the port.
Other hardware features have not been enabled yet for this board.

Connections and IOs
===================
Expand Down Expand Up @@ -204,30 +227,133 @@ Programming and Debugging

Flashing
========
Build applications as usual (see :ref:`build_an_application` for more details).

Flash hex-file with the documented tools:
Both the Teensy 4.0 and Teensy 4.1 ship with a dedicated bootloader chip,
which supports flashing using USB. This allows easy flashing of new images,
but does not support debugging the device.

#. Build the Zephyr kernel and the :zephyr:code-sample:`blinky` sample application.

.. tabs::

.. group-tab:: Teensy 4.0

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: teensy40
:goals: build
:compact:

.. group-tab:: Teensy 4.1

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: teensy41
:goals: build
:compact:

#. Connect the board to your host computer using USB.

#. Tap the reset button to enter bootloader mode.
Red LED blinks.

#. Flash the image.

.. tabs::

.. _Teensy flash tools:
https://www.pjrc.com/teensy/loader.html
.. group-tab:: Teensy 4.0

Debugging
=========
Console output is mapped to teensy pins 0 (RX1) and 1 (TX1). Connect a usb-to-serial adapter
to use this serial console. Use the following settings with your serial terminal of choice (minicom, putty,
etc.):
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: teensy40
:goals: flash
:compact:

- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1
.. group-tab:: Teensy 4.1

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: teensy41
:goals: flash
:compact:

#. You should see the orange LED blink.

Configuring a Console
=====================

.. tabs::

.. group-tab:: UART-Console

By default console output is mapped to teensy pins 0 (RX1) and 1 (TX1). Connect a usb-to-serial adapter
to use this serial console. Use the following settings with your serial terminal of choice (minicom, putty,
etc.):

- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1

.. group-tab:: USB-Console

By mapping the console output to USB, a usb-to-serial adapter is no longer required.
This needs the following steps:

#. Add these lines to the ``prj.conf`` file.

.. code-block:: kconfig
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_CDC_ACM=y
#. Add a overlay file to project, e.g. ``teensy41.overlay``.

.. code-block:: devicetree
/ {
chosen {
zephyr,console = &cdc_acm_uart0;
};
};
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
#. Extend application ``main.c``.

.. code-block::
#include <zephyr/usb/usb_device.h>
...
usb_enable(NULL);
#. After application startup a serial device named like
``tty.usbmodem14201 - ZEPHYR`` should appear on your host computer.
You can use e.g. ``Serial Monitor`` plugin for VScode to monitor.

References
**********

`Teensy Schematics`_

`i.MX RT1060 Website`_

`i.MX RT1060 Datasheet`_


.. _Teensy 4.0 Website:
https://www.pjrc.com/store/teensy40.html

.. _Teensy 4.1 Website:
https://www.pjrc.com/store/teensy41.html

.. _Teensy 4.1 Ethernet Kit:
https://www.pjrc.com/store/ethernet_kit.html

.. _Teensy Schematics:
https://www.pjrc.com/teensy/schematic.html

Expand All @@ -236,6 +362,3 @@ References

.. _i.MX RT1060 Datasheet:
https://www.nxp.com/docs/en/nxp/data-sheets/IMXRT1060CEC.pdf

.. _i.MX RT1060 Reference Manual:
https://www.nxp.com/webapp/Download?colCode=IMXRT1060RM
1 change: 0 additions & 1 deletion boards/pjrc/teensy4/teensy40.dts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
zephyr,itcm = &itcm;
zephyr,dtcm = &dtcm;
zephyr,console = &lpuart6; /* Teensy Pins 0(RX1) 1(TX1) */
zephyr,shell-uart = &lpuart6;
zephyr,canbus = &flexcan1; /* Teensy Pins 23(CRX1) 22(CTX1) */
};

Expand Down

0 comments on commit 1040ef9

Please sign in to comment.