1.. zephyr:board:: wio_terminal 2 3Overview 4******** 5 6The Wio Terminal is a small (72 mm x 57 mm x 12 mm) and powerful ARM board with 7wireless connectivity (2.4G/5G dual-band Wi-Fi and BLE 5.0), LCD display, 8USB C port, FPC connector, microSD card slot, Raspberry Pi compatible 40-pins 9header and 2 Grove connectors. 10 11Hardware 12******** 13 14- ATSAMD51P19 ARM Cortex-M4F processor at 120 MHz 15- 512 KiB flash memory and 192 KiB of RAM 16- 4 MiB external flash 17- MicroSD card slot 18- RTL8720DN 2.4G/5G Dual Bands Wireless and BLE5.0 Combo Module 19- 2.4inch LCD display 20- LIS3DH accelerometer 21- Microphone 1.0V-10V -42dB 22- Speaker ≥78dB @10cm 4000Hz 23- Light Sensor 400-1050nm 24- Infrared Emitter 940nm 25- GPIO 40 pin (Raspberry Pi compatible) 26- 2x Grove connectors 27- 1x user LED 28- 3x user buttons 29- 5-way user button 30- Power/Reset/Boot mode switch 31- Native USB port 32 33Supported Features 34================== 35 36The wio_terminal board configuration supports the following hardware features: 37 38.. list-table:: 39 :header-rows: 1 40 41 * - Interface 42 - Controller 43 - Driver / Component 44 * - NVIC 45 - on-chip 46 - Nested vector interrupt controller 47 * - Flash 48 - on-chip 49 - Can be used with LittleFS to store files 50 * - SYSTICK 51 - on-chip 52 - Systick 53 * - WDT 54 - on-chip 55 - Watchdog 56 * - GPIO 57 - on-chip 58 - I/O ports 59 * - USART 60 - on-chip 61 - Serial port 62 * - I2C 63 - on-chip 64 - Inter-Integrated Circuit 65 * - SPI 66 - on-chip 67 - Serial Peripheral Interface port 68 * - TRNG 69 - on-chip 70 - True Random Number Generator 71 * - HWINFO 72 - on-chip 73 - Unique 128 bit serial number 74 * - RTC 75 - on-chip 76 - Real-Time Counter 77 * - USB 78 - on-chip 79 - USB device 80 * - PWM 81 - on-chip 82 - PWM 83 84Other hardware features are not currently supported by Zephyr. 85 86The default configuration can be found in the Kconfig file 87:zephyr_file:`boards/seeed/wio_terminal/wio_terminal_defconfig`. 88 89Zephyr can use the default Cortex-M SYSTICK timer or the SAM0 specific RTC. 90To use the RTC, set :kconfig:option:`CONFIG_CORTEX_M_SYSTICK=n` and set 91:kconfig:option:`CONFIG_SYS_CLOCK_TICKS_PER_SEC` to no more than 32 kHZ divided 92by 7, i.e. no more than 4500. 93 94Connections and IOs 95=================== 96 97The `Wio Terminal Getting started guide`_ has detailed information about the 98board including `pinouts`_ and its `schematics`_. 99 100System Clock 101============ 102 103The SAMD51 MCU is configured to use the 32.768 kHz internal oscillator with the 104on-chip PLL generating the 120 MHz system clock. 105 106Serial Port 107=========== 108 109Zephyr console output is available using the USB connector, which is used to 110make the console available on PC as USB CDC class. 111 112USB Device Port 113=============== 114 115The SAMD51 MCU has a USB device port that can be used to communicate with a 116host PC. See the :zephyr:code-sample-category:`usb` sample applications for more, such as the 117:zephyr:code-sample:`usb-cdc-acm` sample which sets up a virtual serial port that echos 118characters back to the host PC. 119 120Programming and Debugging 121************************* 122 123The Wio Terminal ships with an UF2 bootloader that is BOSSA compatible. The 124bootloader can be entered by quickly tapping the reset button twice. 125 126The UF2 file is generated when building the application, and it is possible to 127use it to flash the target. Enter the bootloader by quickly sliding the power 128button twice, and copy the UF2 file to the USB mass storage device. The device 129reboots on the new firmware after the UF2 file has finished transferring. 130 131Flashing 132======== 133 134#. Build the Zephyr kernel and the :code:`button` sample application: 135 136 .. zephyr-app-commands:: 137 :zephyr-app: samples/basic/button 138 :board: wio_terminal 139 :goals: build 140 :compact: 141 142#. Swipe the reset/power button down twice quickly to enter bootloader mode 143 144#. Flash the image: 145 146 .. zephyr-app-commands:: 147 :zephyr-app: samples/basic/button 148 :board: wio_terminal 149 :goals: flash 150 :compact: 151 152 You should see the blue (user) LED flashing whenever you press the third 153 (counting from the top left) user button at the top of the Wio Terminal. 154 155Debugging 156========= 157 158In addition to the built-in bootloader, the Wio Terminal can be flashed and 159debugged using an SWD probe such as the Segger J-Link. 160 161#. Solder cables to the :code:`SWCLK`, :code:`SWDIO`, :code:`RESET`, 162 :code:`GND`, and :code:`3V3` pins. See `Test with SWD`_ for more 163 information. 164 165#. Connect the board to the probe by connecting the :code:`SWCLK`, 166 :code:`SWDIO`, :code:`RESET`, :code:`GND`, and :code:`3V3` pins on the 167 Wio Terminal to the :code:`SWCLK`, :code:`SWDIO`, :code:`RESET`, 168 :code:`GND`, and :code:`VTref` pins on the `J-Link`_. 169 170#. Flash the image: 171 172 .. zephyr-app-commands:: 173 :zephyr-app: samples/basic/button 174 :board: wio_terminal 175 :goals: flash 176 :flash-args: -r openocd 177 :compact: 178 179#. Start debugging: 180 181 .. zephyr-app-commands:: 182 :zephyr-app: samples/basic/button 183 :board: wio_terminal 184 :goals: debug 185 :compact: 186 187References 188********** 189 190.. target-notes:: 191 192.. _Wio Terminal Getting started guide: 193 https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/ 194 195.. _pinouts: 196 https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/#pinout-diagram 197 198.. _schematics: 199 https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/#resources 200 201.. _Test with SWD: 202 https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/#test-with-swd 203 204.. _J-Link: 205 https://www.segger.com/products/debug-probes/j-link/technology/interface-description/ 206