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
36.. zephyr:board-supported-hw::
37
38Zephyr can use the default Cortex-M SYSTICK timer or the SAM0 specific RTC.
39To use the RTC, set :kconfig:option:`CONFIG_CORTEX_M_SYSTICK=n` and set
40:kconfig:option:`CONFIG_SYS_CLOCK_TICKS_PER_SEC` to no more than 32 kHZ divided
41by 7, i.e. no more than 4500.
42
43Connections and IOs
44===================
45
46The `Wio Terminal Getting started guide`_ has detailed information about the
47board including `pinouts`_ and its `schematics`_.
48
49System Clock
50============
51
52The SAMD51 MCU is configured to use the 32.768 kHz internal oscillator with the
53on-chip PLL generating the 120 MHz system clock.
54
55Serial Port
56===========
57
58Zephyr console output is available using the USB connector, which is used to
59make the console available on PC as USB CDC class.
60
61USB Device Port
62===============
63
64The SAMD51 MCU has a USB device port that can be used to communicate with a
65host PC.  See the :zephyr:code-sample-category:`usb` sample applications for more, such as the
66:zephyr:code-sample:`usb-cdc-acm` sample which sets up a virtual serial port that echos
67characters back to the host PC.
68
69Programming and Debugging
70*************************
71
72The Wio Terminal ships with an UF2 bootloader that is BOSSA compatible. The
73bootloader can be entered by quickly tapping the reset button twice.
74
75The UF2 file is generated when building the application, and it is possible to
76use it to flash the target. Enter the bootloader by quickly sliding the power
77button twice, and copy the UF2 file to the USB mass storage device. The device
78reboots on the new firmware after the UF2 file has finished transferring.
79
80Flashing
81========
82
83#. Build the Zephyr kernel and the :code:`button` sample application:
84
85   .. zephyr-app-commands::
86      :zephyr-app: samples/basic/button
87      :board: wio_terminal
88      :goals: build
89      :compact:
90
91#. Swipe the reset/power button down twice quickly to enter bootloader mode
92
93#. Flash the image:
94
95   .. zephyr-app-commands::
96      :zephyr-app: samples/basic/button
97      :board: wio_terminal
98      :goals: flash
99      :compact:
100
101   You should see the blue (user) LED flashing whenever you press the third
102   (counting from the top left) user button at the top of the Wio Terminal.
103
104Debugging
105=========
106
107In addition to the built-in bootloader, the Wio Terminal can be flashed and
108debugged using an SWD probe such as the Segger J-Link.
109
110#.  Solder cables to the :code:`SWCLK`, :code:`SWDIO`, :code:`RESET`,
111    :code:`GND`, and :code:`3V3` pins. See `Test with SWD`_ for more
112    information.
113
114#. Connect the board to the probe by connecting the :code:`SWCLK`,
115   :code:`SWDIO`, :code:`RESET`, :code:`GND`, and :code:`3V3` pins on the
116   Wio Terminal to the :code:`SWCLK`, :code:`SWDIO`, :code:`RESET`,
117   :code:`GND`, and :code:`VTref` pins on the `J-Link`_.
118
119#. Flash the image:
120
121   .. zephyr-app-commands::
122      :zephyr-app: samples/basic/button
123      :board: wio_terminal
124      :goals: flash
125      :flash-args: -r openocd
126      :compact:
127
128#. Start debugging:
129
130   .. zephyr-app-commands::
131      :zephyr-app: samples/basic/button
132      :board: wio_terminal
133      :goals: debug
134      :compact:
135
136References
137**********
138
139.. target-notes::
140
141.. _Wio Terminal Getting started guide:
142   https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/
143
144.. _pinouts:
145    https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/#pinout-diagram
146
147.. _schematics:
148    https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/#resources
149
150.. _Test with SWD:
151    https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/#test-with-swd
152
153.. _J-Link:
154    https://www.segger.com/products/debug-probes/j-link/technology/interface-description/
155