Skip to content

Commit e7c3434

Browse files
lfeltenaescolar
authored andcommitted
boards: lilygo: ttgo_lora32: enable SDHC support
device tree: enable support for the SDHC controller to use the micro SD card slot documentation: - added instructions for SD card and OLED samples - added links to code samples defconfig: added CONFIG_ESP32_USE_UNSUPPORTED_REVISION=y to ttgo_lora32_esp32_procpu_defconfig The chip on the board is a ESP32 chip revision 1. The board will not boot, it displays the following warning at boot: I (35) boot: chip revision: v1.0 E (38) boot: You are using ESP32 chip revision (1) that is unsupported. While it may work, it could cause unexpected behavior or issues. E (50) boot: Proceeding with this ESP32 chip revision is not recommended unless you fully understand the potential risk and limitations. E (62) boot: If you choose to continue, please enable the 'CONFIG_ESP32_USE_UNSUPPORTED_REVISION' in your project configuration. E (73) boot: HW init failed, aborting In order to prevent a boot loop, CONFIG_ESP32_USE_UNSUPPORTED_REVISION=y was added to the defconfig. Signed-off-by: Lothar Felten <[email protected]>
1 parent 58df253 commit e7c3434

File tree

6 files changed

+47
-24
lines changed

6 files changed

+47
-24
lines changed

boards/lilygo/ttgo_lora32/doc/index.rst

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ of the Lilygo TTGO LoRa32 board.
3939
+------------------+-------------------------------------------------------------------------+
4040
| Power Switch | Sliding power switch. |
4141
+------------------+-------------------------------------------------------------------------+
42-
| LCD screen | Built-in OLED display \(`SSD1306`_, 0.96", 128x64 px\) controlled |
42+
| OLED display | Built-in OLED display \(`SSD1306`_, 0.96", 128x64 px\) controlled |
4343
| | by I2C interface |
4444
+------------------+-------------------------------------------------------------------------+
4545
| SX1276/SX1278 | LoRa radio frontend chip, connected via SPI. |
4646
| | Use SX1276 for 433MHz and SX1276 for 868/915/923MHz. |
4747
+------------------+-------------------------------------------------------------------------+
48-
| TF card slot | TF card slot wired to the SD interface of the MCU. |
48+
| TF card slot | TF card slot wired to the SDHC interface of the MCU. |
4949
+------------------+-------------------------------------------------------------------------+
5050

5151

@@ -195,30 +195,15 @@ message in the monitor:
195195
***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
196196
Hello World! ttgo_lora32
197197
198-
LoRa samples
198+
Code samples
199199
============
200200

201-
There are two LoRa samples that will work out of the box with this board.
201+
The following sample applications will work out of the box with this board:
202202

203-
To build the LoRa transmit sample application using sysbuild use the command:
204-
205-
.. zephyr-app-commands::
206-
:tool: west
207-
:zephyr-app: samples/drivers/lora/send
208-
:board: ttgo_lora32/esp32/procpu
209-
:goals: build
210-
:west-args: --sysbuild
211-
:compact:
212-
213-
To build the LoRa receive sample application using sysbuild use the command:
214-
215-
.. zephyr-app-commands::
216-
:tool: west
217-
:zephyr-app: samples/drivers/lora/receive
218-
:board: ttgo_lora32/esp32/procpu
219-
:goals: build
220-
:west-args: --sysbuild
221-
:compact:
203+
* :zephyr:code-sample:`lora-send`
204+
* :zephyr:code-sample:`lora-receive`
205+
* :zephyr:code-sample:`fs`
206+
* :zephyr:code-sample:`character-frame-buffer`
222207

223208
Debugging
224209
*********

boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,11 @@
4141
output-high;
4242
};
4343
};
44-
44+
sdhc0_default: sdhc0_default {
45+
group1 {
46+
pinmux = <SDHC0_CD_GPIO34>;
47+
bias-pull-up;
48+
output-high;
49+
};
50+
};
4551
};

boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_appcpu.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ testing:
2424
- cmsis_rtos
2525
- jwt
2626
- zdsp
27+
- sdhc
2728
vendor: lilygo

boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
uart-0 = &uart0;
1919
i2c-0 = &i2c0;
2020
watchdog0 = &wdt0;
21+
sdhc0 = &sdhc1;
2122
lora0 = &lora0;
2223
};
2324

@@ -28,6 +29,7 @@
2829
zephyr,flash = &flash0;
2930
zephyr,code-partition = &slot0_partition;
3031
zephyr,display = &ssd1306_128x64;
32+
zephyr,sdhc = &sdhc1;
3133
};
3234

3335
leds {
@@ -121,6 +123,31 @@
121123
status = "okay";
122124
};
123125

126+
&sdhc {
127+
sdhc1: sdhc@1 {
128+
status = "okay";
129+
130+
pinctrl-0 = <&sdhc0_default>;
131+
pinctrl-names = "default";
132+
power-delay-ms = <100>;
133+
max-bus-freq = <52000000>;
134+
bus-width = <4>;
135+
136+
clk-pin = <14>;
137+
cmd-pin = <15>;
138+
d0-pin = <2>;
139+
d1-pin = <4>;
140+
d2-pin = <12>;
141+
d3-pin = <13>;
142+
143+
mmc {
144+
compatible = "zephyr,sdmmc-disk";
145+
disk-name = "SD";
146+
status = "okay";
147+
};
148+
};
149+
};
150+
124151
&flash0 {
125152
status = "okay";
126153
partitions {

boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ supported:
1414
- display
1515
- lora
1616
- nvs
17+
- sdhc
1718
testing:
1819
ignore_tags:
1920
- net

boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ CONFIG_UART_CONSOLE=y
88

99
CONFIG_GPIO=y
1010
CONFIG_I2C=y
11+
12+
# the following config is required to support chips of revision 1
13+
CONFIG_ESP32_USE_UNSUPPORTED_REVISION=y

0 commit comments

Comments
 (0)