|
| 1 | +.. zephyr:board:: twatch_s3 |
| 2 | +
|
| 3 | +Overview |
| 4 | +******** |
| 5 | + |
| 6 | +LILYGO T-Watch S3 is an ESP32-S3 based smartwatch with the following features: |
| 7 | + |
| 8 | +- ESP32-S3-R8 chip |
| 9 | + |
| 10 | + - Dual core Xtensa LX-7 up to 240MHz |
| 11 | + - 8 MB of integrated PSRAM |
| 12 | + - Bluetooth LE v5.0 |
| 13 | + - Wi-Fi 802.11 b/g/n |
| 14 | + |
| 15 | +- 16 MB external QSPI flash (Winbond W25Q128JWPIQ) |
| 16 | +- Power Management Unit (X-Powers AXP2101) which provides |
| 17 | + |
| 18 | + - Regulators (DC-DCs and LDOs) |
| 19 | + - Battery charging |
| 20 | + - Fuel gauge |
| 21 | + |
| 22 | +- 470 mAh battery |
| 23 | +- RTC (NXP PCF8563) |
| 24 | +- Haptic (Texas Instruments DRV2605) |
| 25 | +- Accelerometer (Bosch BMA423) |
| 26 | +- 240x240 pixels LCD with touchscreen |
| 27 | + |
| 28 | + - ST7789V LCD Controller |
| 29 | + - Focaltech FT5336 touch sensor |
| 30 | + |
| 31 | +- Microphone (Knowles SPM1423HM4H-B) |
| 32 | +- LoRA radio (Semtech SX1262) |
| 33 | +- Audio amplifier (Maxim MAX98357A) |
| 34 | + |
| 35 | +The board features a single micro USB connector which can be used for serial |
| 36 | +flashing, debugging and console thanks to the integrated JTAG support in the |
| 37 | +chip. |
| 38 | + |
| 39 | +It does not have any GPIO that can easily be connected to something external. |
| 40 | +There is only 1 physical button which is connected to the PMU and it's used |
| 41 | +to turn on/off the device. |
| 42 | + |
| 43 | +Supported Features |
| 44 | +================== |
| 45 | + |
| 46 | +.. zephyr:board-supported-hw:: |
| 47 | +
|
| 48 | +Building & Flashing |
| 49 | +******************* |
| 50 | + |
| 51 | +Prerequisites |
| 52 | +============= |
| 53 | + |
| 54 | +Espressif HAL requires WiFi and Bluetooth binary blobs in order to work. Run the command |
| 55 | +below to retrieve those files. |
| 56 | + |
| 57 | +.. code-block:: console |
| 58 | +
|
| 59 | + west blobs fetch hal_espressif |
| 60 | +
|
| 61 | +.. note:: |
| 62 | + |
| 63 | + It is recommended running the command above after :file:`west update`. |
| 64 | + |
| 65 | +Simple boot |
| 66 | +=========== |
| 67 | + |
| 68 | +The board could be loaded using a single binary image, without 2nd stage bootloader. |
| 69 | +It is the default option when building the application without additional configuration. |
| 70 | + |
| 71 | +.. note:: |
| 72 | + |
| 73 | + Simple boot does not provide any security features nor OTA updates. |
| 74 | + |
| 75 | +MCUboot bootloader |
| 76 | +================== |
| 77 | + |
| 78 | +User may choose to use MCUboot bootloader instead. In that case the bootloader |
| 79 | +must be built (and flashed) at least once. |
| 80 | + |
| 81 | +There are two options to be used when building an application: |
| 82 | + |
| 83 | +1. Sysbuild |
| 84 | +2. Manual build |
| 85 | + |
| 86 | +.. note:: |
| 87 | + |
| 88 | + User can select the MCUboot bootloader by adding the following line |
| 89 | + to the board default configuration file. |
| 90 | + |
| 91 | + .. code-block:: cfg |
| 92 | +
|
| 93 | + CONFIG_BOOTLOADER_MCUBOOT=y |
| 94 | +
|
| 95 | +Sysbuild |
| 96 | +-------- |
| 97 | + |
| 98 | +The sysbuild makes it possible to build and flash all necessary images needed to |
| 99 | +bootstrap the board with the ESP32 SoC. |
| 100 | + |
| 101 | +To build the sample application using sysbuild, use the command: |
| 102 | + |
| 103 | +.. zephyr-app-commands:: |
| 104 | + :tool: west |
| 105 | + :zephyr-app: samples/hello_world |
| 106 | + :board: twatch_s3/esp32s3/procpu |
| 107 | + :goals: build |
| 108 | + :west-args: --sysbuild |
| 109 | + :compact: |
| 110 | + |
| 111 | +By default, the ESP32-S3 sysbuild creates bootloader (MCUboot) and application |
| 112 | +images. But it can be configured to create other kind of images. |
| 113 | + |
| 114 | +Build directory structure created by sysbuild is different from traditional |
| 115 | +Zephyr build. Output is structured by the domain subdirectories: |
| 116 | + |
| 117 | +.. code-block:: |
| 118 | +
|
| 119 | + build/ |
| 120 | + ├── hello_world |
| 121 | + │ └── zephyr |
| 122 | + │ ├── zephyr.elf |
| 123 | + │ └── zephyr.bin |
| 124 | + ├── mcuboot |
| 125 | + │ └── zephyr |
| 126 | + │ ├── zephyr.elf |
| 127 | + │ └── zephyr.bin |
| 128 | + └── domains.yaml |
| 129 | +
|
| 130 | +.. note:: |
| 131 | + |
| 132 | + With ``--sysbuild`` option the bootloader will be re-built and re-flashed |
| 133 | + every time the pristine build is used. |
| 134 | + |
| 135 | +For more information about the system build please read the :ref:`sysbuild` documentation. |
| 136 | + |
| 137 | +Manual build |
| 138 | +------------ |
| 139 | + |
| 140 | +During the development cycle, it is intended to build & flash as quickly as possible. |
| 141 | +For that reason, images can be built one at a time using traditional build. |
| 142 | + |
| 143 | +The instructions following are relevant for both manual build and sysbuild. |
| 144 | +The only difference is the structure of the build directory. |
| 145 | + |
| 146 | +.. note:: |
| 147 | + |
| 148 | + Remember that bootloader (MCUboot) needs to be flashed at least once. |
| 149 | + |
| 150 | +Build and flash applications as usual (see :ref:`build_an_application` and |
| 151 | +:ref:`application_run` for more details). |
| 152 | + |
| 153 | +.. zephyr-app-commands:: |
| 154 | + :zephyr-app: samples/hello_world |
| 155 | + :board: twatch_s3/esp32s3/procpu |
| 156 | + :goals: build |
| 157 | + |
| 158 | +The usual ``flash`` target will work with the ``twatch_s3`` board target |
| 159 | +configuration. Here is an example for the :zephyr:code-sample:`hello_world` |
| 160 | +application. |
| 161 | + |
| 162 | +.. zephyr-app-commands:: |
| 163 | + :zephyr-app: samples/hello_world |
| 164 | + :board: twatch_s3/esp32s3/procpu |
| 165 | + :goals: flash |
| 166 | + |
| 167 | +The default baud rate is set to 1500000bps. If experiencing issues when flashing, |
| 168 | +try using different values by using ``--esp-baud-rate <BAUD>`` option during |
| 169 | +``west flash`` (e.g. ``west flash --esp-baud-rate 115200``). |
| 170 | + |
| 171 | +You can also open the serial monitor using the following command: |
| 172 | + |
| 173 | +.. code-block:: shell |
| 174 | +
|
| 175 | + west espressif monitor |
| 176 | +
|
| 177 | +After the board has automatically reset and booted, you should see the following |
| 178 | +message in the monitor: |
| 179 | + |
| 180 | +.. code-block:: console |
| 181 | +
|
| 182 | + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** |
| 183 | + Hello World! twatch_s3/esp32s3/procpu |
| 184 | +
|
| 185 | +References |
| 186 | +********** |
| 187 | + |
| 188 | +.. target-notes:: |
| 189 | + |
| 190 | +.. _`Lilygo Twatch S3 schematic`: https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library/blob/t-watch-s3/schematic/T_WATCH_S3.pdf |
| 191 | +.. _`Lilygo T-Watch S3 repo`: https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library/tree/t-watch-s3 |
| 192 | +.. _`Lilygo T-Watch Deps repo`: https://github.com/Xinyuan-LilyGO/T-Watch-Deps |
| 193 | +.. _`ESP32-S3 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf |
| 194 | +.. _`ESP32-S3 Technical Reference Manual`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf |
| 195 | +.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases |
| 196 | +.. _`JTAG debugging for ESP32-S3`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/jtag-debugging/ |
0 commit comments