1.. zephyr:board:: dragino_nbsn95
2
3Overview
4********
5
6The Dragino NBSN95 NB-IoT Sensor Node for IoT allows users to develop
7applications with NB-IoT connectivity via the Quectel BC95-G.
8Dragino NBSN95 enables a wide diversity of applications by exploiting
9low-power communication, ARM |reg| Cortex |reg|-M0 core-based
10STM32L0 Series features.
11
12This kit provides:
13
14- STM32L072CZ MCU
15- Quectel BC95-G NB-IoT
16- Expansion connectors:
17        - PMOD
18- Li/SOCI2 Unchargable Battery
19- GPIOs exposed via screw terminals on the carrier board
20- Housing
21
22More information about the board can be found at the `Dragino NBSN95 website`_.
23
24Hardware
25********
26
27The STM32L072CZ SoC provides the following hardware IPs:
28
29- Ultra-low-power (down to 0.29 µA Standby mode and 93 uA/MHz run mode)
30- Core: ARM |reg| 32-bit Cortex |reg|-M0+ CPU, frequency up to 32 MHz
31- Clock Sources:
32
33        - 1 to 32 MHz crystal oscillator
34        - 32 kHz crystal oscillator for RTC (LSE)
35        - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%)
36        - Internal low-power 37 kHz RC ( |plusminus| 5%)
37        - Internal multispeed low-power 65 kHz to 4.2 MHz RC
38- RTC with HW calendar, alarms and calibration
39- Up to 24 capacitive sensing channels: support touchkey, linear and rotary touch sensors
40- 11x timers:
41
42        - 2x 16-bit with up to 4 channels
43        - 2x 16-bit with up to 2 channels
44        - 1x 16-bit ultra-low-power timer
45        - 1x SysTick
46        - 1x RTC
47        - 2x 16-bit basic for DAC
48        - 2x watchdogs (independent/window)
49- Up to 84 fast I/Os, most 5 V-tolerant.
50- Memories
51
52        - Up to 192 KB Flash, 2 banks read-while-write, proprietary code readout protection
53        - Up to 20 KB of SRAM
54        - External memory interface for static memories supporting SRAM, PSRAM, NOR and NAND memories
55- Rich analog peripherals (independent supply)
56
57        - 1x 12-bit ADC 1.14 MSPS
58        - 2x 12-bit DAC
59        - 2x ultra-low-power comparators
60- 11x communication interfaces
61
62        - USB OTG 2.0 full-speed, LPM and BCD
63        - 3x I2C FM+(1 Mbit/s), SMBus/PMBus
64        - 4x USARTs (ISO 7816, LIN, IrDA, modem)
65        - 6x SPIs (4x SPIs with the Quad SPI)
66- 7-channel DMA controller
67- True random number generator
68- CRC calculation unit, 96-bit unique ID
69- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell |trade|
70
71
72More information about STM32L072CZ can be found here:
73
74        - `STM32L072CZ on www.st.com`_
75        - `STM32L0x2 reference manual`_
76
77Supported Features
78==================
79
80The Zephyr Dragino NBSN95 board configuration supports the following hardware features:
81
82+-----------+------------+-------------------------------------+
83| Interface | Controller | Driver/Component                    |
84+===========+============+=====================================+
85| UART      | on-chip    | serial port-polling;                |
86|           |            | serial port-interrupt               |
87+-----------+------------+-------------------------------------+
88| PINMUX    | on-chip    | pinmux                              |
89+-----------+------------+-------------------------------------+
90| GPIO      | on-chip    | gpio                                |
91+-----------+------------+-------------------------------------+
92
93Other hardware features are not yet supported on this Zephyr port.
94
95The default configuration can be found in the defconfig file:
96:zephyr_file:`boards/dragino/nbsn95/dragino_nbsn95_defconfig`
97
98
99Connections and IOs
100===================
101
102Dragino NBSN95 Board has GPIO controllers. These controllers are responsible for pin muxing,
103input/output, pull-up, etc.
104
105Available pins:
106---------------
107
108For detailed information about available pins please refer to `Dragino NBSN95 website`_.
109
110Default Zephyr Peripheral Mapping:
111----------------------------------
112
113- UART_1_TX : PB6
114- UART_1_RX : PB7
115- UART_2_TX : PA2
116- UART_2_RX : PA3
117
118System Clock
119------------
120
121Dragino NBSN95 System Clock is at 32MHz,
122
123Serial Port
124-----------
125
126Dragino NBSN95 board has 2 U(S)ARTs. The Zephyr console output is assigned to UART1.
127Default settings are 115200 8N1.
128
129Programming and Debugging
130*************************
131
132Applications for the ``dragino_nbsn95`` board configuration can be built and
133flashed in the usual way (see :ref:`build_an_application` and
134:ref:`application_run` for more details).
135
136Flashing
137========
138
139Dragino NBSN95  board requires an external debugger.
140
141Flashing an application to Dragino NBSN95
142-----------------------------------------
143
144Here is an example for the :zephyr:code-sample:`hello_world` application.
145
146Connect the Dragino NBSN95 to a STLinkV2 to your host computer using the USB port, then
147run a serial host program to connect with your board. For example:
148
149.. code-block:: console
150
151   $ minicom -D /dev/ttyACM0
152
153Then build and flash the application:
154
155.. zephyr-app-commands::
156   :zephyr-app: samples/hello_world
157   :board: dragino_nbsn95
158   :goals: build flash
159
160You should see the following message on the console:
161
162.. code-block:: console
163
164   $ Hello World! dragino_nbsn95
165
166Debugging
167=========
168
169You can debug an application in the usual way.  Here is an example for the
170:zephyr:code-sample:`hello_world` application.
171
172.. zephyr-app-commands::
173   :zephyr-app: samples/hello_world
174   :board: dragino_nbsn95
175   :maybe-skip-config:
176   :goals: debug
177
178.. _Dragino NBSN95 website:
179   https://www.dragino.com/products/nb-iot/item/163-nbsn95.html
180
181.. _STM32L072CZ on www.st.com:
182   https://www.st.com/en/microcontrollers/stm32l072cz.html
183
184.. _STM32L0x2 reference manual:
185   https://www.st.com/resource/en/reference_manual/DM00108281.pdf
186