|
| 1 | +.. zephyr:board:: ttgo_lora32 |
| 2 | + |
| 3 | +Overview |
| 4 | +******** |
| 5 | + |
| 6 | +The Lilygo TTGO LoRa32 is a development board for LoRa applications based on the ESP32-PICO-D4. |
| 7 | + |
| 8 | +It's available in two versions supporting two different frequency ranges and features the following integrated components: |
| 9 | + |
| 10 | +- ESP32-PICO-D4 chip (240MHz dual core, 600 DMIPS, 520KB SRAM, Wi-Fi) |
| 11 | +- SSD1306, 128x64 px, 0.96" screen |
| 12 | +- SX1278 (433MHz) or SX1276 (868/915/923MHz) LoRa radio frontend |
| 13 | +- JST GH 2-pin battery connector |
| 14 | +- TF card slot |
| 15 | + |
| 16 | +Some of the ESP32 I/O pins are accessible on the board's pin headers. |
| 17 | + |
| 18 | +Supported Features |
| 19 | +================== |
| 20 | + |
| 21 | +.. zephyr:board-supported-hw:: |
| 22 | + |
| 23 | +Start Application Development |
| 24 | +***************************** |
| 25 | + |
| 26 | +Before powering up your Lilygo TTGO LoRa32, please make sure that the board is in good |
| 27 | +condition with no obvious signs of damage. |
| 28 | + |
| 29 | +System requirements |
| 30 | +******************* |
| 31 | + |
| 32 | +Prerequisites |
| 33 | +============= |
| 34 | + |
| 35 | +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command |
| 36 | +below to retrieve those files. |
| 37 | + |
| 38 | +.. code-block:: console |
| 39 | + |
| 40 | + west blobs fetch hal_espressif |
| 41 | + |
| 42 | +.. note:: |
| 43 | + |
| 44 | + It is recommended running the command above after :file:`west update`. |
| 45 | + |
| 46 | +Building & Flashing |
| 47 | +******************* |
| 48 | + |
| 49 | +Simple boot |
| 50 | +=========== |
| 51 | + |
| 52 | +The board could be loaded using the single binary image, without 2nd stage bootloader. |
| 53 | +It is the default option when building the application without additional configuration. |
| 54 | + |
| 55 | +.. note:: |
| 56 | + |
| 57 | + Simple boot does not provide any security features nor OTA updates. |
| 58 | + |
| 59 | +MCUboot bootloader |
| 60 | +================== |
| 61 | + |
| 62 | +User may choose to use MCUboot bootloader instead. In that case the bootloader |
| 63 | +must be built (and flashed) at least once. |
| 64 | + |
| 65 | +There are two options to be used when building an application: |
| 66 | + |
| 67 | +1. Sysbuild |
| 68 | +2. Manual build |
| 69 | + |
| 70 | +.. note:: |
| 71 | + |
| 72 | + User can select the MCUboot bootloader by adding the following line |
| 73 | + to the board default configuration file. |
| 74 | + |
| 75 | + .. code-block:: cfg |
| 76 | + |
| 77 | + CONFIG_BOOTLOADER_MCUBOOT=y |
| 78 | + |
| 79 | +Sysbuild |
| 80 | +======== |
| 81 | + |
| 82 | +The sysbuild makes possible to build and flash all necessary images needed to |
| 83 | +bootstrap the board with the ESP32-PICO-D4 SoC. |
| 84 | + |
| 85 | +To build the sample application using sysbuild use the command: |
| 86 | + |
| 87 | +.. zephyr-app-commands:: |
| 88 | + :tool: west |
| 89 | + :zephyr-app: samples/hello_world |
| 90 | + :board: ttgo_lora32/esp32/procpu |
| 91 | + :goals: build |
| 92 | + :west-args: --sysbuild |
| 93 | + :compact: |
| 94 | + |
| 95 | +By default, the ESP32-PICO-D4 sysbuild creates bootloader (MCUboot) and application |
| 96 | +images. But it can be configured to create other kind of images. |
| 97 | + |
| 98 | +Build directory structure created by sysbuild is different from traditional |
| 99 | +Zephyr build. Output is structured by the domain subdirectories: |
| 100 | + |
| 101 | +.. code-block:: |
| 102 | + |
| 103 | + build/ |
| 104 | + ├── hello_world |
| 105 | + │ └── zephyr |
| 106 | + │ ├── zephyr.elf |
| 107 | + │ └── zephyr.bin |
| 108 | + ├── mcuboot |
| 109 | + │ └── zephyr |
| 110 | + │ ├── zephyr.elf |
| 111 | + │ └── zephyr.bin |
| 112 | + └── domains.yaml |
| 113 | + |
| 114 | +.. note:: |
| 115 | + |
| 116 | + With ``--sysbuild`` option the bootloader will be re-build and re-flash |
| 117 | + every time the pristine build is used. |
| 118 | + |
| 119 | +For more information about the system build please read the :ref:`sysbuild` documentation. |
| 120 | + |
| 121 | +Manual build |
| 122 | +============ |
| 123 | + |
| 124 | +During the development cycle, it is intended to build & flash as quickly possible. |
| 125 | +For that reason, images can be built one at a time using traditional build. |
| 126 | + |
| 127 | +The instructions following are relevant for both manual build and sysbuild. |
| 128 | +The only difference is the structure of the build directory. |
| 129 | + |
| 130 | +.. note:: |
| 131 | + |
| 132 | + Remember that bootloader (MCUboot) needs to be flash at least once. |
| 133 | + |
| 134 | +Build and flash applications as usual (see :ref:`build_an_application` and |
| 135 | +:ref:`application_run` for more details). |
| 136 | + |
| 137 | +.. zephyr-app-commands:: |
| 138 | + :zephyr-app: samples/hello_world |
| 139 | + :board: ttgo_lora32/esp32/procpu |
| 140 | + :goals: build |
| 141 | + |
| 142 | +The usual ``flash`` target will work with the ``ttgo_lora32`` board target. |
| 143 | +Here is an example for the :zephyr:code-sample:`hello_world` |
| 144 | +application. |
| 145 | + |
| 146 | +.. zephyr-app-commands:: |
| 147 | + :zephyr-app: samples/hello_world |
| 148 | + :board: ttgo_lora32/esp32/procpu |
| 149 | + :goals: flash |
| 150 | + |
| 151 | +The default baud rate for the Lilygo TTGO LoRa32 is set to 1500000bps. If experiencing issues when flashing, |
| 152 | +try using different values by using ``--esp-baud-rate <BAUD>`` option during |
| 153 | +``west flash`` (e.g. ``west flash --esp-baud-rate 115200``). |
| 154 | + |
| 155 | +You can also open the serial monitor using the following command: |
| 156 | + |
| 157 | +.. code-block:: shell |
| 158 | + |
| 159 | + west espressif monitor |
| 160 | + |
| 161 | +After the board has automatically reset and booted, you should see the following |
| 162 | +message in the monitor: |
| 163 | + |
| 164 | +.. code-block:: console |
| 165 | + |
| 166 | + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** |
| 167 | + Hello World! ttgo_lora32 |
| 168 | + |
| 169 | +Code samples |
| 170 | +============ |
| 171 | + |
| 172 | +The following sample applications will work out of the box with this board: |
| 173 | + |
| 174 | +* :zephyr:code-sample:`lora-send` |
| 175 | +* :zephyr:code-sample:`lora-receive` |
| 176 | +* :zephyr:code-sample:`fs` |
| 177 | +* :zephyr:code-sample:`character-frame-buffer` |
| 178 | + |
| 179 | +Debugging |
| 180 | +********* |
| 181 | + |
| 182 | +Lilygo TTGO LoRa32 debugging is not supported due to pinout limitations. |
| 183 | + |
| 184 | +Related Documents |
| 185 | +***************** |
| 186 | +- `Lilygo TTGO LoRa32 schematic <https://github.com/Xinyuan-LilyGO/LilyGo-LoRa-Series/blob/master/schematic/T3_V1.6.1.pdf>`_ (PDF) |
| 187 | +- `Lilygo TTGO LoRa32 documentation <https://www.lilygo.cc/products/lora3>`_ |
| 188 | +- `Lilygo github repo <https://github.com/Xinyuan-LilyGo>`_ |
| 189 | +- `ESP32-PICO-D4 Datasheet <https://www.espressif.com/sites/default/files/documentation/esp32-pico-d4_datasheet_en.pdf>`_ (PDF) |
| 190 | +- `ESP32 Datasheet <https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf>`_ (PDF) |
| 191 | +- `ESP32 Hardware Reference <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/index.html>`_ |
| 192 | +- `SX127x Datasheet <https://www.semtech.com/products/wireless-rf/lora-connect/sx1276#documentation>`_ |
| 193 | +- `SSD1306 Datasheet <https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf>`_ (PDF) |
0 commit comments