Skip to content

Commit 2fc73f3

Browse files
committed
boards: "Lilygo TTGO T7 V1.5" initial support
Add support for board "Lilygo TTGO T7 V1.5" Signed-off-by: Tobias Kässer <[email protected]>
1 parent 0348270 commit 2fc73f3

15 files changed

+491
-0
lines changed

boards/lilygo/ttgo_t7v1_5/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2024 Tobias Kässer <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config HEAP_MEM_POOL_ADD_SIZE_BOARD
5+
int
6+
default 4096 if BOARD_TTGO_T7V1_5_ESP32_PROCPU
7+
default 256 if BOARD_TTGO_T7V1_5_ESP32_APPCPU
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
choice BOOTLOADER
5+
default BOOTLOADER_MCUBOOT
6+
endchoice
7+
8+
choice BOOT_SIGNATURE_TYPE
9+
default BOOT_SIGNATURE_TYPE_NONE
10+
endchoice
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2024 Tobias Kässer <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_TTGO_T7V1_5
5+
select SOC_ESP32
6+
select SOC_ESP32_PROCPU if BOARD_TTGO_T7V1_5_ESP32_PROCPU
7+
select SOC_ESP32_APPCPU if BOARD_TTGO_T7V1_5_ESP32_APPCPU
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*")
4+
set(OPENOCD OPENOCD-NOTFOUND)
5+
endif()
6+
find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH)
7+
8+
include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake)
9+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
name: ttgo_t7v1_5
3+
vendor: lilygo
4+
socs:
5+
- name: esp32
58.4 KB
Loading
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
.. zephyr:board:: ttgo_t7v1_5
2+
3+
Overview
4+
********
5+
6+
LILYGO® TTGO T7 Mini32 V1.5 ia an IoT mini development board
7+
based on the Espressif ESP32-WROVER-E module.
8+
9+
It features the following integrated components:
10+
- ESP32 chip (240MHz dual core, 520KB SRAM, Wi-Fi, Bluetooth)
11+
- on board antenna
12+
- Micro-USB connector for power and communication
13+
- JST GH 2-pin battery connector
14+
- LED
15+
16+
Functional Description
17+
**********************
18+
This board is based on the ESP32-WROVER-E module with 4MB of flash (there
19+
are models 16MB as well), WiFi and BLE support. It has a Micro-USB port for
20+
programming and debugging, integrated battery charging and an on-board antenna.
21+
22+
Connections and IOs
23+
===================
24+
25+
The ``ttgo_t7v1_5/esp32/procpu`` board target supports the following hardware features:
26+
27+
+-----------+------------+------------------+
28+
| Interface | Controller | Driver/Component |
29+
+===========+============+==================+
30+
| CPU | ESP32 | arch/xtensa |
31+
+-----------+------------+------------------+
32+
| GPIO | on-chip | gpio_esp32 |
33+
+-----------+------------+------------------+
34+
| UART | on-chip | uart_esp32 |
35+
+-----------+------------+------------------+
36+
| I2C | on-chip | i2c_esp32 |
37+
+-----------+------------+------------------+
38+
| SPI | on-chip | spi_esp32_spim |
39+
+-----------+------------+------------------+
40+
| LoRa | SX1276 | lora_sx127x |
41+
+-----------+------------+------------------+
42+
| WiFi | on-chip | wifi_esp32 |
43+
+-----------+------------+------------------+
44+
| BLE | on-chip | bluetooth_esp32 |
45+
+-----------+------------+------------------+
46+
| Flash | on-chip | flash_esp32 |
47+
+-----------+------------+------------------+
48+
49+
System requirements
50+
*******************
51+
52+
Prerequisites
53+
=============
54+
55+
Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command
56+
below to retrieve those files.
57+
58+
.. code-block:: console
59+
60+
west blobs fetch hal_espressif
61+
62+
.. note::
63+
64+
It is recommended running the command above after :file:`west update`.
65+
66+
Building & Flashing
67+
*******************
68+
69+
Simple boot
70+
===========
71+
72+
The board could be loaded using the single binary image, without 2nd stage bootloader.
73+
It is the default option when building the application without additional configuration.
74+
75+
.. note::
76+
77+
Simple boot does not provide any security features nor OTA updates.
78+
79+
MCUboot bootloader
80+
==================
81+
82+
User may choose to use MCUboot bootloader instead. In that case the bootloader
83+
must be build (and flash) at least once.
84+
85+
There are two options to be used when building an application:
86+
87+
1. Sysbuild
88+
2. Manual build
89+
90+
.. note::
91+
92+
User can select the MCUboot bootloader by adding the following line
93+
to the board default configuration file.
94+
95+
.. code:: cfg
96+
97+
CONFIG_BOOTLOADER_MCUBOOT=y
98+
99+
Sysbuild
100+
========
101+
102+
The sysbuild makes possible to build and flash all necessary images needed to
103+
bootstrap the board with the ESP32 SoC.
104+
105+
To build the sample application using sysbuild use the command:
106+
107+
.. zephyr-app-commands::
108+
:tool: west
109+
:app: samples/hello_world
110+
:board: ttgo_t7v1_5/esp32/procpu
111+
:goals: build
112+
:west-args: --sysbuild
113+
:compact:
114+
115+
By default, the ESP32 sysbuild creates bootloader (MCUboot) and application
116+
images. But it can be configured to create other kind of images.
117+
118+
Build directory structure created by sysbuild is different from traditional
119+
Zephyr build. Output is structured by the domain subdirectories:
120+
121+
.. code-block::
122+
123+
build/
124+
├── hello_world
125+
│   └── zephyr
126+
│   ├── zephyr.elf
127+
│   └── zephyr.bin
128+
├── mcuboot
129+
│ └── zephyr
130+
│ ├── zephyr.elf
131+
│ └── zephyr.bin
132+
└── domains.yaml
133+
134+
.. note::
135+
136+
With ``--sysbuild`` option the bootloader will be re-build and re-flash
137+
every time the pristine build is used.
138+
139+
For more information about the system build please read the :ref:`sysbuild` documentation.
140+
141+
Manual build
142+
============
143+
144+
During the development cycle, it is intended to build & flash as quickly possible.
145+
For that reason, images can be build one at a time using traditional build.
146+
147+
The instructions following are relevant for both manual build and sysbuild.
148+
The only difference is the structure of the build directory.
149+
150+
.. note::
151+
152+
Remember that bootloader (MCUboot) needs to be flash at least once.
153+
154+
Build and flash applications as usual (see :ref:`build_an_application` and
155+
:ref:`application_run` for more details).
156+
157+
.. zephyr-app-commands::
158+
:zephyr-app: samples/hello_world
159+
:board: ttgo_t7v1_5/esp32/procpu
160+
:goals: build
161+
162+
The usual ``flash`` target will work with the ``ttgo_t7v1_5`` board
163+
configuration. Here is an example for the :zephyr:code-sample:`hello_world`
164+
application.
165+
166+
.. zephyr-app-commands::
167+
:zephyr-app: samples/hello_world
168+
:board: ttgo_t7v1_5/esp32/procpu
169+
:goals: flash
170+
171+
The default baud rate for the Lilygo TTGO T7 V1.5 is set to 1500000bps. If experiencing issues when flashing,
172+
try using different values by using ``--esp-baud-rate <BAUD>`` option during
173+
``west flash`` (e.g. ``west flash --esp-baud-rate 115200``).
174+
175+
You can also open the serial monitor using the following command:
176+
177+
.. code-block:: shell
178+
179+
west espressif monitor
180+
181+
After the board has automatically reset and booted, you should see the following
182+
message in the monitor:
183+
184+
.. code-block:: console
185+
186+
***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
187+
Hello World! ttgo_t7v1_5
188+
189+
Sample applications
190+
===================
191+
192+
The following samples will run out of the box on the TTGO T7 V1.5 board.
193+
194+
To build the blinky sample:
195+
196+
.. zephyr-app-commands::
197+
:tool: west
198+
:app: samples/basic/blinky
199+
:board: ttgo_t7v1_5/esp32/procpu
200+
:goals: build
201+
202+
To build the bluetooth beacon sample:
203+
204+
.. zephyr-app-commands::
205+
:tool: west
206+
:app: samples/bluetooth/beacon
207+
:board: ttgo_t7v1_5/esp32/procpu
208+
:goals: build
209+
210+
211+
Related Documents
212+
*****************
213+
.. _`Lilygo TTGO T7-V1.5 schematic`: https://github.com/LilyGO/TTGO-T7-Demo/blob/master/t7_v1.5.pdf
214+
.. _`Lilygo github repo`: https://github.com/LilyGO/TTGO-T7-Demo/tree/master
215+
.. _`Espressif ESP32-WROVER-E datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-wrover-e_esp32-wrover-ie_datasheet_en.pdf
216+
.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set ESP_RTOS none
2+
3+
source [find interface/esp_usb_jtag.cfg]
4+
5+
source [find target/esp32.cfg]
6+
adapter_khz 5000
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2024 Tobias Kässer <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
8+
#include <dt-bindings/pinctrl/esp32-pinctrl.h>
9+
#include <zephyr/dt-bindings/pinctrl/esp32-gpio-sigmap.h>
10+
11+
&pinctrl {
12+
uart0_default: uart0_default {
13+
group1 {
14+
pinmux = <UART0_TX_GPIO1>;
15+
output-high;
16+
};
17+
group2 {
18+
pinmux = <UART0_RX_GPIO3>;
19+
bias-pull-up;
20+
};
21+
};
22+
23+
spim3_default: spim3_default {
24+
group1 {
25+
pinmux = <SPIM3_MISO_GPIO19>,
26+
<SPIM3_SCLK_GPIO18>;
27+
};
28+
/* GPIO5 is CS */
29+
group2 {
30+
pinmux = <SPIM3_MOSI_GPIO23>;
31+
output-low;
32+
};
33+
};
34+
35+
i2c0_default: i2c0_default {
36+
group1 {
37+
pinmux = <I2C1_SDA_GPIO21>,
38+
<I2C1_SCL_GPIO22>;
39+
bias-pull-up;
40+
drive-open-drain;
41+
output-high;
42+
};
43+
};
44+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/dts-v1/;
7+
8+
#include <espressif/esp32/esp32_appcpu.dtsi>
9+
#include <espressif/partitions_0x1000_amp.dtsi>
10+
11+
/ {
12+
model = "ttgo t7 v1.5 APPCPU";
13+
compatible = "espressif,esp32";
14+
15+
chosen {
16+
zephyr,sram = &sram0;
17+
zephyr,ipc_shm = &shm0;
18+
zephyr,ipc = &ipm0;
19+
};
20+
};
21+
22+
&ipm0 {
23+
status = "okay";
24+
};
25+
26+
&trng0 {
27+
status = "okay";
28+
};

0 commit comments

Comments
 (0)