|
| 1 | +.. zephyr:board:: ttgo_toiplus |
| 2 | +
|
| 3 | +Overview |
| 4 | +******** |
| 5 | + |
| 6 | +Lilygo TTGO T-OI-PLUS is an mini IoT development board based on |
| 7 | +Espressif's ESP32-C3 WiFi/Bluetooth dual-mode chip. |
| 8 | + |
| 9 | +It features the following integrated components: |
| 10 | + |
| 11 | +- ESP32-C3 SoC (RISC-V 160MHz single core, 400KB SRAM, Wi-Fi, Bluetooth) |
| 12 | +- on board Grove connector |
| 13 | +- USB-C connector for power and communication (on board serial) |
| 14 | +- optional 18340 Li-ion battery holder |
| 15 | +- LED |
| 16 | + |
| 17 | +Functional Description |
| 18 | +********************** |
| 19 | +This board is based on the ESP32-C3 with 4MB of flash, WiFi and BLE support. It |
| 20 | +has an USB-C port for programming and debugging, integrated battery charging |
| 21 | +and an Grove connector. |
| 22 | + |
| 23 | +Connections and IOs |
| 24 | +=================== |
| 25 | + |
| 26 | +.. zephyr:board-supported-hw:: |
| 27 | +
|
| 28 | +(Note: the above UART interface also supports connecting through USB.) |
| 29 | + |
| 30 | +Start Application Development |
| 31 | +***************************** |
| 32 | + |
| 33 | +Before powering up your Lilygo TTGO T-OI-PLUS, please make sure that the board is in good |
| 34 | +condition with no obvious signs of damage. |
| 35 | + |
| 36 | +System requirements |
| 37 | +******************* |
| 38 | + |
| 39 | +Prerequisites |
| 40 | +============= |
| 41 | + |
| 42 | +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command |
| 43 | +below to retrieve those files. |
| 44 | + |
| 45 | +.. code-block:: console |
| 46 | +
|
| 47 | + west blobs fetch hal_espressif |
| 48 | +
|
| 49 | +.. note:: |
| 50 | + |
| 51 | + It is recommended running the command above after :file:`west update`. |
| 52 | + |
| 53 | +Building & Flashing |
| 54 | +******************* |
| 55 | + |
| 56 | +Simple boot |
| 57 | +=========== |
| 58 | + |
| 59 | +The board could be loaded using the single binary image, without 2nd stage bootloader. |
| 60 | +It is the default option when building the application without additional configuration. |
| 61 | + |
| 62 | +.. note:: |
| 63 | + |
| 64 | + Simple boot does not provide any security features nor OTA updates. |
| 65 | + |
| 66 | +MCUboot bootloader |
| 67 | +================== |
| 68 | + |
| 69 | +User may choose to use MCUboot bootloader instead. In that case the bootloader |
| 70 | +must be built (and flashed) at least once. |
| 71 | + |
| 72 | +There are two options to be used when building an application: |
| 73 | + |
| 74 | +1. Sysbuild |
| 75 | +2. Manual build |
| 76 | + |
| 77 | +.. note:: |
| 78 | + |
| 79 | + User can select the MCUboot bootloader by adding the following line |
| 80 | + to the board default configuration file. |
| 81 | + |
| 82 | + .. code:: cfg |
| 83 | +
|
| 84 | + CONFIG_BOOTLOADER_MCUBOOT=y |
| 85 | +
|
| 86 | +Sysbuild |
| 87 | +======== |
| 88 | + |
| 89 | +The sysbuild makes possible to build and flash all necessary images needed to |
| 90 | +bootstrap the board with the ESP32-C3 SoC. |
| 91 | + |
| 92 | +To build the sample application using sysbuild use the command: |
| 93 | + |
| 94 | +.. zephyr-app-commands:: |
| 95 | + :tool: west |
| 96 | + :zephyr-app: samples/hello_world |
| 97 | + :board: ttgo_toiplus |
| 98 | + :goals: build |
| 99 | + :west-args: --sysbuild |
| 100 | + :compact: |
| 101 | + |
| 102 | +By default, the ESP32-C3 sysbuild creates bootloader (MCUboot) and application |
| 103 | +images. But it can be configured to create other kind of images. |
| 104 | + |
| 105 | +Build directory structure created by sysbuild is different from traditional |
| 106 | +Zephyr build. Output is structured by the domain subdirectories: |
| 107 | + |
| 108 | +.. code-block:: |
| 109 | +
|
| 110 | + build/ |
| 111 | + ├── hello_world |
| 112 | + │ └── zephyr |
| 113 | + │ ├── zephyr.elf |
| 114 | + │ └── zephyr.bin |
| 115 | + ├── mcuboot |
| 116 | + │ └── zephyr |
| 117 | + │ ├── zephyr.elf |
| 118 | + │ └── zephyr.bin |
| 119 | + └── domains.yaml |
| 120 | +
|
| 121 | +.. note:: |
| 122 | + |
| 123 | + With ``--sysbuild`` option the bootloader will be re-build and re-flash |
| 124 | + every time the pristine build is used. |
| 125 | + |
| 126 | +For more information about the system build please read the :ref:`sysbuild` documentation. |
| 127 | + |
| 128 | +Manual build |
| 129 | +============ |
| 130 | + |
| 131 | +During the development cycle, it is intended to build & flash as quickly possible. |
| 132 | +For that reason, images can be built one at a time using traditional build. |
| 133 | + |
| 134 | +The instructions following are relevant for both manual build and sysbuild. |
| 135 | +The only difference is the structure of the build directory. |
| 136 | + |
| 137 | +.. note:: |
| 138 | + |
| 139 | + Remember that bootloader (MCUboot) needs to be flash at least once. |
| 140 | + |
| 141 | +Build and flash applications as usual (see :ref:`build_an_application` and |
| 142 | +:ref:`application_run` for more details). |
| 143 | + |
| 144 | +.. zephyr-app-commands:: |
| 145 | + :zephyr-app: samples/hello_world |
| 146 | + :board: ttgo_toiplus |
| 147 | + :goals: build |
| 148 | + |
| 149 | +The usual ``flash`` target will work with the ``ttgo_toiplus`` board target. |
| 150 | +Here is an example for the :zephyr:code-sample:`hello_world` application. |
| 151 | + |
| 152 | +.. zephyr-app-commands:: |
| 153 | + :zephyr-app: samples/hello_world |
| 154 | + :board: ttgo_toiplus |
| 155 | + :goals: flash |
| 156 | + |
| 157 | +You can also open the serial monitor using the following command: |
| 158 | + |
| 159 | +.. code-block:: shell |
| 160 | +
|
| 161 | + west espressif monitor |
| 162 | +
|
| 163 | +After the board has automatically reset and booted, you should see the following |
| 164 | +message in the monitor: |
| 165 | + |
| 166 | +.. code-block:: console |
| 167 | +
|
| 168 | + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** |
| 169 | + Hello World! ttgo_toiplus |
| 170 | +
|
| 171 | +Sample applications |
| 172 | +=================== |
| 173 | + |
| 174 | +The following samples will run out of the box on the TTGO T-OI-PLUS board. |
| 175 | + |
| 176 | +To build the blinky sample: |
| 177 | + |
| 178 | +.. zephyr-app-commands:: |
| 179 | + :tool: west |
| 180 | + :zephyr-app: samples/basic/blinky |
| 181 | + :board: ttgo_toiplus |
| 182 | + :goals: build |
| 183 | + |
| 184 | +To build the bluetooth beacon sample: |
| 185 | + |
| 186 | +.. zephyr-app-commands:: |
| 187 | + :tool: west |
| 188 | + :zephyr-app: samples/bluetooth/beacon |
| 189 | + :board: ttgo_toiplus |
| 190 | + :goals: build |
| 191 | + |
| 192 | + |
| 193 | +Related Documents |
| 194 | +***************** |
| 195 | +.. _`Lilygo TTGO T-OI-PLUS schematic`: https://github.com/Xinyuan-LilyGO/LilyGo-T-OI-PLUS/blob/main/schematic/T-OI_PLUS_Schematic.pdf |
| 196 | +.. _`Lilygo github repo`: https://github.com/Xinyuan-LilyGO |
| 197 | +.. _`Espressif ESP32-C3 datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf |
| 198 | +.. _`Espressif ESP32-C3 technical reference manual`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf |
| 199 | +.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases |
0 commit comments