1.. zephyr:board:: adafruit_feather_m0_lora
2
3Overview
4********
5
6The Adafruit Feather M0 Lora is a thin, light ARM development
7boards with an onboard battery connector and charger for 3.7 V lithium
8polymer batteries, charging status indicator and user LEDs, native USB
9connector, 20 I/O pins, and a LoRa radio module from Semtech.
10
11Hardware
12********
13
14- ATSAMD21G18A ARM Cortex-M0+ processor at 48 MHz
15- 32.768 kHz crystal oscillator
16- 256 KiB flash memory and 32 KiB of RAM
17- Battery connector and charger for 3.7 V lithium polymer batteries
18- Charging indicator LED
19- User LED
20- Reset button
21- Native USB port
22- SX127x LoRa radio
23
24Supported Features
25==================
26
27.. zephyr:board-supported-hw::
28
29Connections and IOs
30===================
31
32The `Adafruit Feather M0 with LoRa radio module Learn site`_ has detailed
33information about the board including `pinouts`_ and the `schematic`_.
34
35System Clock
36============
37
38The SAMD21 MCU is configured to use the 32.768 kHz external oscillator
39with the on-chip PLL generating the 48 MHz system clock.
40
41Serial Port
42===========
43
44The SAMD21 MCU has 6 SERCOM based USARTs.  On the Adafruit Feather M0
45with LoRa, SERCOM0 is the Zephyr console and is available on pins 0
46(RX) and 1 (TX).
47
48I2C Port
49========
50
51The SAMD21 MCU has 6 SERCOM based USARTs.  On the Adafruit Feather M0
52with LoRa, SERCOM3 is available on pin 20 (SDA) and pin 21 (SCL).
53
54SPI Port
55========
56
57The SAMD21 MCU has 6 SERCOM based SPIs.  On the Adafruit Feather M0
58with LoRa, SERCOM4 is available on pin 22 (MISO), pin 23 (MOSI), and
59pin 24 (SCK).
60
61USB Device Port
62===============
63
64The SAMD21 MCU has a USB device port that can be used to communicate
65with a host PC.  See the :zephyr:code-sample-category:`usb` sample applications for
66more, such as the :zephyr:code-sample:`usb-cdc-acm` sample which sets up a virtual
67serial port that echos characters back to the host PC.
68
69LoRa Radio
70==========
71The Semtech SX127x radio chip on the Adafruit Feather M0 with LoRa
72is attached to the SPI port (SERCOM4). Depending on the hardware
73version, 433MHz or 900MHz is supported.
74
75Programming and Debugging
76*************************
77
78The Adafruit Feather M0 with LoRa ships with a BOSSA compatible
79SAM-BA bootloader.  The bootloader can be entered by quickly tapping
80the reset button twice.
81
82Flashing
83========
84
85#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample application:
86
87   .. zephyr-app-commands::
88      :zephyr-app: samples/hello_world
89      :board: adafruit_feather_m0_lora
90      :goals: build
91      :compact:
92
93#. Connect the Adafruit Feather M0 with LoRa to your host computer
94   using USB
95
96#. Connect a 3.3 V USB to serial adapter to the board and to the
97   host.  See the `Serial Port`_ section above for the board's pin
98   connections.
99
100#. Run your favorite terminal program to listen for output. Under Linux the
101   terminal should be :code:`/dev/ttyACM0`. For example:
102
103   .. code-block:: console
104
105      $ minicom -D /dev/ttyACM0 -o
106
107   The -o option tells minicom not to send the modem initialization
108   string. Connection should be configured as follows:
109
110   - Speed: 115200
111   - Data: 8 bits
112   - Parity: None
113   - Stop bits: 1
114
115#. Tap the reset button twice quickly to enter bootloader mode
116
117#. Flash the image:
118
119   .. zephyr-app-commands::
120      :zephyr-app: samples/hello_world
121      :board: adafruit_feather_m0_lora
122      :goals: flash
123      :compact:
124
125   You should see "Hello World! adafruit_feather_m0_lora" in your terminal.
126
127References
128**********
129
130.. target-notes::
131
132.. _Adafruit Feather M0 with LoRa radio module Learn site:
133    https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module
134
135.. _pinouts:
136    https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module/pinouts
137
138.. _schematic:
139    https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module/downloads
140