1.. zephyr:board:: b_l072z_lrwan1
2
3Overview
4********
5
6This Discovery kit features an all-in-one open module CMWX1ZZABZ-091 (by Murata).
7The module is powered by an STM32L072CZ and an SX1276 transceiver.
8
9This kit provides:
10
11- CMWX1ZZABZ-091 LoRa* / Sigfox* module (Murata)
12
13        - Embedded ultra-low-power STM32L072CZ Series MCUs, based on
14          Arm* Cortex* -M0+ core, with 192 Kbytes of Flash
15          memory, 20 Kbytes of RAM, 6 Kbytes of EEPROM
16        - Frequency range: 860 MHz - 930 MHz
17        - USB 2.0 FS
18        - 4-channel,12-bit ADC, 2xDAC
19        - 6-bit timers, LP-UART, I2C and SPI
20        - Embedded SX1276 transceiver
21        - LoRa* , FSK, GFSK, MSK, GMSK and OOK modulations (+ Sigfox* compatibility)
22        - +14 dBm or +20 dBm selectable output power
23        - 157 dB maximum link budget
24        - Programmable bit rate up to 300 kbit/s
25        - High sensitivity: down to -137 dBm
26        - Bullet-proof front end: IIP3 = -12.5 dBm
27        - 89 dB blocking immunity
28        - Low Rx current of 10 mA, 200 nA register retention
29        - Fully integrated synthesizer with a resolution of 61 Hz
30        - Built-in bit synchronizer for clock recovery
31        - Sync word recognition
32        - Preamble detection
33        - 127 dB+ dynamic range RSSI
34
35- SMA and U.FL RF interface connectors
36- Including 50 ohm SMA RF antenna
37- On-board ST-LINK/V2-1 supporting USB re-enumeration capability
38
39- USB ST-LINK functions:
40- Board power supply:
41
42        - Through USB bus or external VIN/3.3 V supply voltage or batteries
43- 3xAAA-type-battery holder for standalone operation
44- 7 LEDs:
45
46        - 4 general-purpose LEDs
47        - A 5 V-power LED
48        - An ST-LINK-communication LED
49        - A fault-power LED
50        - 2 push-buttons (user and reset)
51- Arduino* Uno V3 connectors
52
53More information about the board can be found at the `B-L072Z-LRWAN1 website`_.
54
55Hardware
56********
57
58The STM32L072CZ SoC provides the following hardware IPs:
59
60- Ultra-low-power (down to 0.29 µA Standby mode and 93 uA/MHz run mode)
61- Core: ARM* 32-bit Cortex*-M0+ CPU, frequency up to 32 MHz
62- Clock Sources:
63
64        - 1 to 32 MHz crystal oscillator
65        - 32 kHz crystal oscillator for RTC (LSE)
66        - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%)
67        - Internal low-power 37 kHz RC ( |plusminus| 5%)
68        - Internal multispeed low-power 65 kHz to 4.2 MHz RC
69- RTC with HW calendar, alarms and calibration
70- Up to 24 capacitive sensing channels: support touchkey, linear and rotary touch sensors
71- 11x timers:
72
73        - 2x 16-bit with up to 4 channels
74        - 2x 16-bit with up to 2 channels
75        - 1x 16-bit ultra-low-power timer
76        - 1x SysTick
77        - 1x RTC
78        - 2x 16-bit basic for DAC
79        - 2x watchdogs (independent/window)
80- Up to 84 fast I/Os, most 5 V-tolerant.
81- Memories
82
83        - Up to 192 KB Flash, 2 banks read-while-write, proprietary code readout protection
84        - Up to 20 KB of SRAM
85        - External memory interface for static memories supporting SRAM, PSRAM, NOR and NAND memories
86- Rich analog peripherals (independent supply)
87
88        - 1x 12-bit ADC 1.14 MSPS
89        - 2x 12-bit DAC
90        - 2x ultra-low-power comparators
91- 11x communication interfaces
92
93        - USB 2.0 full-speed device, LPM and BCD
94        - 3x I2C FM+(1 Mbit/s), SMBus/PMBus
95        - 4x USARTs (ISO 7816, LIN, IrDA, modem)
96        - 6x SPIs (4x SPIs with the Quad SPI)
97- 7-channel DMA controller
98- True random number generator
99- CRC calculation unit, 96-bit unique ID
100- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell*
101
102
103More information about STM32L072CZ can be found here:
104
105- `STM32L072CZ on www.st.com`_
106- `STM32L0x2 reference manual`_
107
108Supported Features
109==================
110
111.. zephyr:board-supported-hw::
112
113Connections and IOs
114===================
115
116B-L072Z-LRWAN1 Discovery kit has GPIO controllers. These controllers are responsible for pin muxing,
117input/output, pull-up, etc.
118
119Available pins:
120---------------
121
122For detailed information about available pins please refer to `B-L072Z-LRWAN1 website`_.
123
124Default Zephyr Peripheral Mapping:
125----------------------------------
126
127- UART_1_TX/RX: PA9/PA10 (Arduino Serial)
128- UART_2_TX/RX: PA2/PA3 (ST-Link Virtual COM Port)
129- SPI1 NSS/SCK/MISO/MOSI: PA15/PB3/PA6/PA7 (Semtech SX1276 LoRa* Transceiver)
130- SPI2 NSS/SCK/MISO/MOSI: PB12/PB13/PB14/PB15 (Arduino SPI)
131- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
132
133System Clock
134------------
135
136B-L072Z-LRWAN1 Discovery board System Clock is at 32MHz.
137
138Serial Port
139-----------
140
141B-L072Z-LRWAN1 Discovery board has 2 U(S)ARTs. The Zephyr console output is assigned to UART2.
142Default settings are 115200 8N1.
143
144USB device
145----------
146
147B-L072Z-LRWAN1 Discovery board has 1 USB device controller. However,
148the USB data lines are not connected to the MCU by default. To connect
149the USB data lines to the MCU, short solder bridges SB15 and SB16.
150
151Programming and Debugging
152*************************
153
154B-L072Z-LRWAN1 Discovery board includes an ST-LINK/V2-1 embedded debug tool interface.
155
156Applications for the ``b_l072z_lrwan1`` board configuration can be built and
157flashed in the usual way (see :ref:`build_an_application` and
158:ref:`application_run` for more details).
159
160Flashing
161========
162
163The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
164so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
165
166Alternatively, OpenOCD or JLink can also be used to flash the board using
167the ``--runner`` (or ``-r``) option:
168
169.. code-block:: console
170
171   $ west flash --runner openocd
172   $ west flash --runner jlink
173
174Flashing an application to B-L072Z-LRWAN1 Discovery board
175---------------------------------------------------------
176
177Here is an example for the :zephyr:code-sample:`hello_world` application.
178
179Connect the B-L072Z-LRWAN1 Discovery board to a STLinkV2 to your host computer using the USB port, then
180run a serial host program to connect with your board. For example:
181
182.. code-block:: console
183
184   $ minicom -D /dev/ttyACM0
185
186Then build and flash the application:
187
188.. zephyr-app-commands::
189   :zephyr-app: samples/hello_world
190   :board: b_l072z_lrwan1
191   :goals: build flash
192
193You should see the following message on the console:
194
195.. code-block:: console
196
197   $ Hello World! arm
198
199Debugging
200=========
201
202You can debug an application in the usual way.  Here is an example for the
203:zephyr:code-sample:`hello_world` application.
204
205.. zephyr-app-commands::
206   :zephyr-app: samples/hello_world
207   :board: b_l072z_lrwan1
208   :maybe-skip-config:
209   :goals: debug
210
211.. _B-L072Z-LRWAN1 website:
212   https://www.st.com/en/evaluation-tools/b-l072z-lrwan1.html
213
214.. _STM32L072CZ on www.st.com:
215   https://www.st.com/en/microcontrollers/stm32l072cz.html
216
217.. _STM32L0x2 reference manual:
218   https://www.st.com/resource/en/reference_manual/DM00108281.pdf
219
220.. _STM32CubeProgrammer:
221   https://www.st.com/en/development-tools/stm32cubeprog.html
222