Skip to content

boards: Support Teensy Micromod #88502

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

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boards/pjrc/teensy4/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#

if BOARD_TEENSY40 || BOARD_TEENSY41
if BOARD_TEENSY40 || BOARD_TEENSY41 || BOARD_TEENSYMM

config BUILD_OUTPUT_HEX
bool
Expand Down
9 changes: 9 additions & 0 deletions boards/pjrc/teensy4/Kconfig.teensymm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2020, Bernhard Kraemer
# Copyright 2024 NXP
#
# SPDX-License-Identifier: Apache-2.0
#

config BOARD_TEENSYMM
select SOC_PART_NUMBER_MIMXRT1062DVL6A
6 changes: 4 additions & 2 deletions boards/pjrc/teensy4/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
board_set_flasher_ifnset(teensy)

if(CONFIG_BOARD_TEENSY40)
board_runner_args(teensy "--mcu=TEENSY40")
board_runner_args(teensy "--mcu=TEENSY40")
elseif(CONFIG_BOARD_TEENSYMM)
board_runner_args(teensy "--mcu=TEENSY_MICROMOD")
else()
board_runner_args(teensy "--mcu=TEENSY41")
board_runner_args(teensy "--mcu=TEENSY41")
endif()

include(${ZEPHYR_BASE}/boards/common/teensy.board.cmake)
5 changes: 5 additions & 0 deletions boards/pjrc/teensy4/board.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ boards:
vendor: pjrc
socs:
- name: mimxrt1062
- name: teensymm
full_name: Teensy MicroMod
vendor: pjrc
socs:
- name: mimxrt1062
Binary file added boards/pjrc/teensy4/doc/img/teensymm.webp
Binary file not shown.
173 changes: 167 additions & 6 deletions boards/pjrc/teensy4/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ programming is done via the USB port.

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

.. group-tab:: Sparkfun Teensy Micromod

.. figure:: img/teensymm.webp
:align: center
:alt: TEENSYMM

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

Hardware
********

Expand Down Expand Up @@ -56,6 +64,17 @@ Hardware

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

.. group-tab:: Sparkfun Teensy Micromod

- MIMXRT1062DVJ6A MCU (600 MHz, 1024 KB on-chip memory)
- 128 Mbit QSPI Flash
- User LED
- USB 2.0 host connector
- USB 2.0 OTG connector
- TF socket for SD card

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

For more information, check the `i.MX RT1060 Datasheet`_.

Supported Features
Expand Down Expand Up @@ -188,7 +207,7 @@ Pin mappings from Teensy to MIMXRT1062 SoC.
| 33 | EMC_07 | GPIO4_7 |
+-----+------------+-------------------------------------+

Only Teensy 4.0:
Only Teensy 4.0 and Teensy Micromod:

+-----+------------+-------------------------------------+
| 34 | SD_B0_03 | GPIO3_15 |
Expand All @@ -204,6 +223,22 @@ Only Teensy 4.0:
| 39 | SD_B0_04 | GPIO3_16 |
+-----+------------+-------------------------------------+

Only Teensy Micromod

+-----+------------+-------------------------------------+
| 40 | B0_04 | GPIO2_4 / I2C2 SCL |
+-----+------------+-------------------------------------+
| 41 | B0_05 | GPIO2_5 / I2C2 SDA |
+-----+------------+-------------------------------------+
| 42 | B0_06 | GPIO2_6 |
+-----+------------+-------------------------------------+
| 43 | B0_07 | GPIO2_7 |
+-----+------------+-------------------------------------+
| 44 | B0_08 | GPIO2_8 / UART3 TX |
+-----+------------+-------------------------------------+
| 45 | B0_09 | GPIO2_9 / UART3 RX |
+-----+------------+-------------------------------------+

Only Teensy 4.1:

+-----+------------+-------------------------------------+
Expand All @@ -221,18 +256,124 @@ Only Teensy 4.1:
+-----+------------+-------------------------------------+
| 40 | AD_B1_04 | GPIO1_20 |
+-----+------------+-------------------------------------+
| 41 | AD_B1_05 | GPIO1_21 |
+-----+------------+-------------------------------------+
| 41 | AD_B1_05 | GPIO1_21 / UART3_RX |
+-----+------------+-------------------------------------+

Pin mappings from Teensy Micromod pins to MIMXRT1062 SoC.

Teensy Micromod only:

+-----+-----+------+------------+-----------------------------------+
|MMOD | MMC | Pin | Pad ID | Usage |
+=====+=====+======+============+===================================+
| 8 | 16 | 27 | AD_B1_15 | <gpio1 31> / SPI3_SCK |
+-----+-----+------+------------+-----------------------------------+
| 10 | 2 | 4 | EMC_06 | <gpio4 6> |
+-----+-----+------+------------+-----------------------------------+
| 12 | | 18 | AD_B1_01 | <gpio1 17> / I2C1_SDA |
+-----+-----+------+------------+-----------------------------------+
| 14 | | 19 | AD_B1_00 | <gpio1 16> / I2C1_SCL |
+-----+-----+------+------------+-----------------------------------+
| 16 | 4 | 29 | EMC_31 | <gpio4 31> / UART7_TX |
+-----+-----+------+------------+-----------------------------------+
| 17 | | 1 | AD_B0_02 | <gpio1 2> / UART6_TX / CAN2_TX |
+-----+-----+------+------------+-----------------------------------+
| 18 | 3 | 5 | EMC_08 | <gpio4 8> |
+-----+-----+------+------------+-----------------------------------+
| 19 | | 0 | AD_B0_03 | <gpio1 3> / UART6_RX / CAN2_RX |
+-----+-----+------+------------+-----------------------------------+
| 20 | | 16 | AD_B1_07 | <gpio1 23> / UART3_RX / I2C3_SCL |
+-----+-----+------+------------+-----------------------------------+
| 22 | | 17 | AD_B1_06 | <gpio1 22> / UART3_TX / I2C3_SDA |
+-----+-----+------+------------+-----------------------------------+
| 32 | | 3 | EMC_05 | <gpio4 5> |
+-----+-----+------+------------+-----------------------------------+
| 34 | 0 | 14 | AD_B1_02 | <gpio1 18> / UART2_TX |
+-----+-----+------+------------+-----------------------------------+
| 38 | 1 | 15 | AD_B1_03 | <gpio1 19> / UART2_RX |
+-----+-----+------+------------+-----------------------------------+
| 4 | | 28 | EMC_32 | <gpio3 18> / UART7_RX |
+-----+-----+------+------------+-----------------------------------+
| 40 | 5 | 40 | B0_04 | <gpio2 04> / I2C2 SCL |
+-----+-----+------+------------+-----------------------------------+
| 41 | | 30 | EMC_37 | <gpio3 23> / CAN3_RX |
+-----+-----+------+------------+-----------------------------------+
| 42 | 6 | 41 | B0_05 | <gpio2 05> / I2C2 SDA |
+-----+-----+------+------------+-----------------------------------+
| 43 | | 31 | EMC_36 | <gpio3 22> / CAN3_TX |
+-----+-----+------+------------+-----------------------------------+
| 44 | 7 | 42 | B0_06 | <gpio2 06> |
+-----+-----+------+------------+-----------------------------------+
| 46 | 8 | 43 | B0_07 | <gpio2 07> |
+-----+-----+------+------------+-----------------------------------+
| 47 | | 2 | EMC_04 | <gpio4 4> |
+-----+-----+------+------------+-----------------------------------+
| 48 | 9 | 44 | B0_08 | <gpio2 08> / UART3 TX |
+-----+-----+------+------------+-----------------------------------+
| 49 | | 22 | AD_B1_08 | <gpio1 24> / CAN1_TX |
+-----+-----+------+------------+-----------------------------------+
| 50 | | 21 | AD_B1_11 | <gpio1 27> / UART8_RX |
+-----+-----+------+------------+-----------------------------------+
| 51 | | 25 | AD_B0_13 | <gpio1 13> / UART1_RX / I2C4_SDA |
+-----+-----+------+------------+-----------------------------------+
| 52 | | 20 | AD_B1_10 | <gpio1 26> / UART8_TX |
+-----+-----+------+------------+-----------------------------------+
| 53 | | 24 | AD_B0_12 | <gpio1 12> / UART1_TX / I2C4_SCL |
+-----+-----+------+------------+-----------------------------------+
| 54 | | 8 | B1_00 | <gpio2 16> / UART4_TX |
+-----+-----+------+------------+-----------------------------------+
| 55 | 17 | 10 | B0_00 | <gpio2 0> |
+-----+-----+------+------------+-----------------------------------+
| 56 | | 7 | B1_01 | <gpio2 17> / UART4_RX |
+-----+-----+------+------------+-----------------------------------+
| 57 | | 13 | B0_03 | <gpio2 3> / LED |
+-----+-----+------+------------+-----------------------------------+
| 58 | | 23 | AD_B1_09 | <gpio1 25> / CAN1_RX |
+-----+-----+------+------------+-----------------------------------+
| 59 | | 11 | B0_02 | <gpio2 2> |
+-----+-----+------+------------+-----------------------------------+
| 60 | | 36 | SD_B0_01 | <gpio3 13> |
+-----+-----+------+------------+-----------------------------------+
| 61 | | 12 | B0_01 | <gpio2 1> |
+-----+-----+------+------------+-----------------------------------+
| 62 | | 37 | SD_B0_00 | <gpio3 12> |
+-----+-----+------+------------+-----------------------------------+
| 63 | 15 | 33 | EMC_07 | <gpio4 7> |
+-----+-----+------+------------+-----------------------------------+
| 64 | | 35 | SD_B0_02 | <gpio3 14> |
+-----+-----+------+------------+-----------------------------------+
| 65 | 14 | 32 | B0_12 | <gpio2 12> |
+-----+-----+------+------------+-----------------------------------+
| 66 | | 34 | SD_B0_03 | <gpio3 15> |
+-----+-----+------+------------+-----------------------------------+
| 67 | 13 | 26 | AD_B1_14 | <gpio1 30> / SPI3_MOSI |
+-----+-----+------+------------+-----------------------------------+
| 68 | | 38 | SD_B0_05 | <gpio3 16> |
+-----+-----+------+------------+-----------------------------------+
| 69 | 12 | 9 | B0_11 | <gpio2 11> |
+-----+-----+------+------------+-----------------------------------+
| 70 | | 39 | SD_B0_04 | <gpio3 17> |
+-----+-----+------+------------+-----------------------------------+
| 71 | 11 | 6 | B0_10 | <gpio2 10> |
+-----+-----+------+------------+-----------------------------------+
| 73 | 10 | 45 | B0_09 | <gpio2 09> / UART3 RX |
+-----+-----+------+------------+-----------------------------------+

MMOD = Physical Micromod pin number
MMC = Zephyr micromod_header connector pin number
Pin = Arduino Pin number
Pad ID = MIMXRT1062 pad id
Usage = Some usages of the pin

Programming and Debugging
*************************

Flashing
========

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.
The Teensy 4.0 and Teensy 4.1 and Micromod 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.

Expand All @@ -254,6 +395,14 @@ but does not support debugging the device.
:goals: build
:compact:

.. group-tab:: Teensy Micromod

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

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

#. Tap the reset button to enter bootloader mode.
Expand All @@ -279,6 +428,15 @@ but does not support debugging the device.
:goals: flash
:compact:

.. group-tab:: Teensy Micromod

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


#. You should see the orange LED blink.

Configuring a Console
Expand Down Expand Up @@ -335,5 +493,8 @@ References
.. _Teensy 4.1 Ethernet Kit:
https://www.pjrc.com/store/ethernet_kit.html

.. _Teensy Micromod Website:
https://www.sparkfun.com/sparkfun-micromod-teensy-processor.html

.. _i.MX RT1060 Datasheet:
https://www.nxp.com/docs/en/nxp/data-sheets/IMXRT1060CEC.pdf
13 changes: 13 additions & 0 deletions boards/pjrc/teensy4/teensy4-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@
};
};

/* LPI2C2 SCL, SDA on Teensy-Micromod-Pins 40/41 */
pinmux_lpi2c2: pinmux_lpi2c2 {
group0 {
pinmux = <&iomuxc_gpio_b0_04_lpi2c2_scl>,
<&iomuxc_gpio_b0_05_lpi2c2_sda>;
drive-strength = "r0-6";
drive-open-drain;
slew-rate = "slow";
nxp,speed = "100-mhz";
input-enable;
};
};

/* LPI2C3 SCL, SDA on Teensy-Pins 16/17 */
pinmux_lpi2c3: pinmux_lpi2c3 {
group0 {
Expand Down
81 changes: 81 additions & 0 deletions boards/pjrc/teensy4/teensymm.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (c) 2020, Bernhard Kraemer
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "teensy40.dts"

/ {
model = "PJRC TEENSY Micromod board";

chosen {
zephyr,flash-controller = &w25q128jvxgim;
zephyr,flash = &w25q128jvxgim;
};

micromod_header: connector {
compatible = "sparkfun,micromod-gpio";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio1 18 0>, /* A0 MMOD 34 */
<1 0 &gpio1 19 0>, /* A1 MMOD 38 */
<2 0 &gpio4 6 0>, /* D0 MMOD 10 */
<3 0 &gpio4 8 0>, /* D1/CAM_TRIG MMOD 18 */
<4 0 &gpio4 31 0>, /* I2C_INT# MMOD 16 */
<5 0 &gpio2 4 0>, /* G0/BUS0 MMOD 40 */
<6 0 &gpio2 5 0>, /* G1/BUS1 MMOD 42 */
<7 0 &gpio2 6 0>, /* G2/BUS2 MMOD 44 */
<8 0 &gpio2 7 0>, /* G3/BUS3 MMOD 46 */
<9 0 &gpio2 8 0>, /* G4/BUS4 MMOD 48 */
<10 0 &gpio2 9 0>, /* G5/BUS5 MMOD 73 */
<11 0 &gpio2 10 0>, /* G6/BUS6 MMOD 71 */
<12 0 &gpio2 11 0>, /* G7/BUS7 MMOD 69 */
<13 0 &gpio1 30 0>, /* G8 MMOD 67 */
<14 0 &gpio2 12 0>, /* G9/ADC_D-/ MMOD 65 */
<15 0 &gpio4 7 0>, /* G10/ADC_D+ MMOD 63 */
<16 0 &gpio1 31 0>, /* G11/SWO MMOD 8 */
<17 0 &gpio2 0 0>; /* SPI_CS MMOD 55 */
};
};

/delete-node/ &w25q16jvuxim;
&flexspi {
status = "okay";
reg = <0x402a8000 0x4000>, <0x60000000 DT_SIZE_M(8)>;

/* WINBOND flash memory*/
w25q128jvxgim: w25q128jvxgim@0 {
compatible = "nxp,imx-flexspi-nor";
size = <DT_SIZE_M(16 * 8)>;
reg = <0>;
spi-max-frequency = <DT_FREQ_M(133)>;
status = "okay";
jedec-id = [ef 70 18];

erase-block-size = <4096>;
write-block-size = <1>;
};
};

&lpi2c2 {
pinctrl-0 = <&pinmux_lpi2c2>;
pinctrl-names = "default";
};

&usdhc1 {
no-1-8-v;
pinctrl-0 = <&pinmux_usdhc1>;
pinctrl-1 = <&pinmux_usdhc1_slow>;
pinctrl-2 = <&pinmux_usdhc1_med>;
pinctrl-3 = <&pinmux_usdhc1_fast>;
pinctrl-names = "default", "slow", "med", "fast";
};

// Sparkfun Micromod compatible pins
micromod_1_uart: &lpuart6 {};
micromod_2_uart: &lpuart3 {};
micromod_0_i2c: &lpi2c1 {};
micromod_1_i2c: &lpi2c4 {};
micromod_0_spi: &lpspi4 {};
Loading