Skip to content
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
31 changes: 8 additions & 23 deletions boards/lilygo/ttgo_lora32/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ of the Lilygo TTGO LoRa32 board.
+------------------+-------------------------------------------------------------------------+
| Power Switch | Sliding power switch. |
+------------------+-------------------------------------------------------------------------+
| LCD screen | Built-in OLED display \(`SSD1306`_, 0.96", 128x64 px\) controlled |
| OLED display | Built-in OLED display \(`SSD1306`_, 0.96", 128x64 px\) controlled |
| | by I2C interface |
+------------------+-------------------------------------------------------------------------+
| SX1276/SX1278 | LoRa radio frontend chip, connected via SPI. |
| | Use SX1276 for 433MHz and SX1276 for 868/915/923MHz. |
+------------------+-------------------------------------------------------------------------+
| TF card slot | TF card slot wired to the SD interface of the MCU. |
| TF card slot | TF card slot wired to the SDHC interface of the MCU. |
+------------------+-------------------------------------------------------------------------+


Expand Down Expand Up @@ -195,30 +195,15 @@ message in the monitor:
***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
Hello World! ttgo_lora32

LoRa samples
Code samples
============

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

To build the LoRa transmit sample application using sysbuild use the command:

.. zephyr-app-commands::
:tool: west
:zephyr-app: samples/drivers/lora/send
:board: ttgo_lora32/esp32/procpu
:goals: build
:west-args: --sysbuild
:compact:

To build the LoRa receive sample application using sysbuild use the command:

.. zephyr-app-commands::
:tool: west
:zephyr-app: samples/drivers/lora/receive
:board: ttgo_lora32/esp32/procpu
:goals: build
:west-args: --sysbuild
:compact:
* :zephyr:code-sample:`lora-send`
* :zephyr:code-sample:`lora-receive`
* :zephyr:code-sample:`fs`
* :zephyr:code-sample:`character-frame-buffer`

Debugging
*********
Expand Down
8 changes: 7 additions & 1 deletion boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,11 @@
output-high;
};
};

sdhc0_default: sdhc0_default {
group1 {
pinmux = <SDHC0_CD_GPIO34>;
bias-pull-up;
output-high;
};
};
};
1 change: 1 addition & 0 deletions boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_appcpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ testing:
- cmsis_rtos
- jwt
- zdsp
- sdhc
vendor: lilygo
27 changes: 27 additions & 0 deletions boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
uart-0 = &uart0;
i2c-0 = &i2c0;
watchdog0 = &wdt0;
sdhc0 = &sdhc1;
lora0 = &lora0;
};

Expand All @@ -28,6 +29,7 @@
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,display = &ssd1306_128x64;
zephyr,sdhc = &sdhc1;
};

leds {
Expand Down Expand Up @@ -121,6 +123,31 @@
status = "okay";
};

&sdhc {
sdhc1: sdhc@1 {
status = "okay";

pinctrl-0 = <&sdhc0_default>;
pinctrl-names = "default";
power-delay-ms = <100>;
max-bus-freq = <52000000>;
bus-width = <4>;

clk-pin = <14>;
cmd-pin = <15>;
d0-pin = <2>;
d1-pin = <4>;
d2-pin = <12>;
d3-pin = <13>;

mmc {
compatible = "zephyr,sdmmc-disk";
disk-name = "SD";
status = "okay";
};
};
};

&flash0 {
status = "okay";
partitions {
Expand Down
1 change: 1 addition & 0 deletions boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ supported:
- display
- lora
- nvs
- sdhc
testing:
ignore_tags:
- net
Expand Down
3 changes: 3 additions & 0 deletions boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ CONFIG_UART_CONSOLE=y

CONFIG_GPIO=y
CONFIG_I2C=y

# the following config is required to support chips of revision 1
CONFIG_ESP32_USE_UNSUPPORTED_REVISION=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment on why this is needed (if this is needed?). This way it's not only clearer to the user but also helps knowing when we might be able to remove it in the future

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a minimum, makes this a different (and first) commit, similar to 956edd1 since my understanding is that it is an unrelated (but needed) change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw i was not suggesting to add a comment to the git commit (although it's not a bad idea to do it too :) ) but rather right in the defconfig file so that people understand where this is coming from. BTW I am not sure this really belongs to the defconfig as this is not something that should be modifiable, no? Shouldn't it be selected in the Kconfig file instead? cc @sylvioalves

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says "unsupported revision" - at least my board uses this version of the chip.
Maybe newer boards (it's still in production) use a newer version.
I'm not sure this setting has any impact when selected for a chip revision > 1

I added a comment and also trimmed the commit log line length.

Copy link
Contributor

@sylvioalves sylvioalves Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config ESP32_USE_UNSUPPORTED_REVISION
	bool "Use unsupported ESP32 revision (Rev 0/1)"
	help
	  ESP32 SoC has multiple revisions, some of which are not supported by the current
	  implementation, as such as REV0 and REV1. In case those revisions are required,
	  set this option to enable support for them. Note that this is not recommended and
	  may lead to unexpected behavior.

rev0 and rev1 ESP32 SocS (old versions) have rom bugs that we haven't and will not address. So if the board uses such old chip revision, this config must be set.

Loading