|
| 1 | +.. _96b_nitrogen_board: |
| 2 | + |
| 3 | +96Boards Nitrogen |
| 4 | +################# |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +Zephyr applications use the 96b_nitrogen board configuration to run on the |
| 10 | +96Boards Nitrogen hardware. It provides support for the Nordic Semiconductor |
| 11 | +nRF52832 ARM Cortex-M4F CPU. |
| 12 | + |
| 13 | +.. figure:: img/96b-nitrogen-front.png |
| 14 | + :width: 487px |
| 15 | + :align: center |
| 16 | + :alt: 96Boards Nitrogen |
| 17 | + |
| 18 | + 96Boards Nitrogen |
| 19 | + |
| 20 | +More information about the board can be found at the `seeed BLE Nitrogen`_ |
| 21 | +website. The `Nordic Semiconductor Infocenter`_ contains the processor's |
| 22 | +information and the datasheet. |
| 23 | + |
| 24 | +Hardware |
| 25 | +******** |
| 26 | + |
| 27 | +96Boards Nitrogen provides the following hardware components: |
| 28 | + |
| 29 | +- nRF52832 microcontroller with 512kB Flash, 64kB RAM |
| 30 | +- ARM®32-bit Cortex®-M4 CPU with FPU |
| 31 | +- Bluetooth LE |
| 32 | +- NFC |
| 33 | +- LPC11U35 on board SWD debugger |
| 34 | + |
| 35 | + - SWD debugger firmware |
| 36 | + - USB to UART |
| 37 | + - Drag and Drop firmware upgrade |
| 38 | + |
| 39 | +- 7 LEDs |
| 40 | + |
| 41 | + - USR1, BT, PWR, CDC, DAP, MSD, Battery charge |
| 42 | + |
| 43 | +- SWD debug connectors |
| 44 | + |
| 45 | + - nRF52832 SWD connector |
| 46 | + - nRF52832 Uart connector |
| 47 | + |
| 48 | +- On board chip antenna |
| 49 | +- 1.8V work voltage |
| 50 | +- 2x20pin 2.0mm pitch Low speed connector |
| 51 | + |
| 52 | +Supported Features |
| 53 | +================== |
| 54 | + |
| 55 | +The Zephyr 96b_nitrogen board configuration supports the following hardware |
| 56 | +features: |
| 57 | + |
| 58 | ++-----------+------------+--------------------------------------+ |
| 59 | +| Interface | Controller | Driver/Component | |
| 60 | ++===========+============+======================================+ |
| 61 | +| NVIC | on-chip | nested vectored interrupt controller | |
| 62 | ++-----------+------------+--------------------------------------+ |
| 63 | +| RTC | on-chip | system clock | |
| 64 | ++-----------+------------+--------------------------------------+ |
| 65 | +| UART | on-chip | serial port | |
| 66 | ++-----------+------------+--------------------------------------+ |
| 67 | +| GPIO | on-chip | gpio | |
| 68 | ++-----------+------------+--------------------------------------+ |
| 69 | +| FLASH | on-chip | flash | |
| 70 | ++-----------+------------+--------------------------------------+ |
| 71 | +| RADIO | on-chip | bluetooth | |
| 72 | ++-----------+------------+--------------------------------------+ |
| 73 | +| RTT | on-chip | console | |
| 74 | ++-----------+------------+--------------------------------------+ |
| 75 | + |
| 76 | +Other hardware features are not supported by the Zephyr kernel. |
| 77 | +See `Nordic Semiconductor Infocenter`_ for a complete list of nRF52-based |
| 78 | +board hardware features. |
| 79 | + |
| 80 | +The default configuration can be found in the defconfig file: |
| 81 | + |
| 82 | + ``boards/arm/96b_nitrogen/96b_nitrogen_defconfig`` |
| 83 | + |
| 84 | +Pin Mapping |
| 85 | +=========== |
| 86 | + |
| 87 | +LED |
| 88 | +--- |
| 89 | + |
| 90 | +- LED1 / User LED (green) = P0.29 |
| 91 | +- LED2 / BT LED (blue) = P0.28 |
| 92 | + |
| 93 | +Push buttons |
| 94 | +------------ |
| 95 | + |
| 96 | +- BUTTON = SW1 = P0.27 |
| 97 | + |
| 98 | +External Connectors |
| 99 | +------------------- |
| 100 | + |
| 101 | +Low Speed Header |
| 102 | + |
| 103 | ++--------+-------------+----------------------+ |
| 104 | +| PIN # | Signal Name | nRF52832 Functions | |
| 105 | ++========+=============+======================+ |
| 106 | +| 1 | GND | GND | |
| 107 | ++--------+-------------+----------------------+ |
| 108 | +| 3 | UART CTS | P.014 / TRACEDATA[3] | |
| 109 | ++--------+-------------+----------------------+ |
| 110 | +| 5 | UART TX | P0.13 | |
| 111 | ++--------+-------------+----------------------+ |
| 112 | +| 7 | UART RX | P0.15 / TRACEDATA[2] | |
| 113 | ++--------+-------------+----------------------+ |
| 114 | +| 9 | UART RTS | P0.12 | |
| 115 | ++--------+-------------+----------------------+ |
| 116 | +| 11 | UART TX | P0.13 | |
| 117 | ++--------+-------------+----------------------+ |
| 118 | +| 13 | UART RX | P0.15 / TRACEDATA[2] | |
| 119 | ++--------+-------------+----------------------+ |
| 120 | +| 15 | P0.22 | P0.22 | |
| 121 | ++--------+-------------+----------------------+ |
| 122 | +| 17 | P0.20 | P0.20 | |
| 123 | ++--------+-------------+----------------------+ |
| 124 | +| 19 | N/A | N/A | |
| 125 | ++--------+-------------+----------------------+ |
| 126 | +| 21 | N/A | N/A | |
| 127 | ++--------+-------------+----------------------+ |
| 128 | +| 23 | P0.02 | P0.02 | |
| 129 | ++--------+-------------+----------------------+ |
| 130 | +| 25 | P0.04 | P0.04 | |
| 131 | ++--------+-------------+----------------------+ |
| 132 | +| 27 | P0.06 | P0.06 | |
| 133 | ++--------+-------------+----------------------+ |
| 134 | +| 29 | P0.08 | P0.08 | |
| 135 | ++--------+-------------+----------------------+ |
| 136 | +| 31 | P0.16 | P0.16 | |
| 137 | ++--------+-------------+----------------------+ |
| 138 | +| 33 | P0.18 | P0.18 | |
| 139 | ++--------+-------------+----------------------+ |
| 140 | +| 35 | VCC | | |
| 141 | ++--------+-------------+----------------------+ |
| 142 | +| 37 | USB5V | | |
| 143 | ++--------+-------------+----------------------+ |
| 144 | +| 39 | GND | GND | |
| 145 | ++--------+-------------+----------------------+ |
| 146 | + |
| 147 | ++--------+-------------+----------------------+ |
| 148 | +| PIN # | Signal Name | nRF52832 Functions | |
| 149 | ++========+=============+======================+ |
| 150 | +| 2 | GND | GND | |
| 151 | ++--------+-------------+----------------------+ |
| 152 | +| 4 | PWR BTN | | |
| 153 | ++--------+-------------+----------------------+ |
| 154 | +| 6 | RST BTN | P0.21 / RESET | |
| 155 | ++--------+-------------+----------------------+ |
| 156 | +| 8 | P0.26 | P0.26 | |
| 157 | ++--------+-------------+----------------------+ |
| 158 | +| 10 | P0.25 | P0.25 | |
| 159 | ++--------+-------------+----------------------+ |
| 160 | +| 12 | P0.24 | P0.24 | |
| 161 | ++--------+-------------+----------------------+ |
| 162 | +| 14 | P0.23 | P0.23 | |
| 163 | ++--------+-------------+----------------------+ |
| 164 | +| 16 | N/A | N/A | |
| 165 | ++--------+-------------+----------------------+ |
| 166 | +| 18 | N/A | PC7 | |
| 167 | ++--------+-------------+----------------------+ |
| 168 | +| 20 | N/A | PC9 | |
| 169 | ++--------+-------------+----------------------+ |
| 170 | +| 22 | N/A | PB8 | |
| 171 | ++--------+-------------+----------------------+ |
| 172 | +| 24 | P0.03 | P0.03 | |
| 173 | ++--------+-------------+----------------------+ |
| 174 | +| 26 | P0.05 | P0.05 | |
| 175 | ++--------+-------------+----------------------+ |
| 176 | +| 28 | P0.07 | P0.07 | |
| 177 | ++--------+-------------+----------------------+ |
| 178 | +| 30 | P0.11 | P0.11 | |
| 179 | ++--------+-------------+----------------------+ |
| 180 | +| 32 | P0.17 | P0.17 | |
| 181 | ++--------+-------------+----------------------+ |
| 182 | +| 34 | P0.19 | P0.19 | |
| 183 | ++--------+-------------+----------------------+ |
| 184 | +| 36 | NC | | |
| 185 | ++--------+-------------+----------------------+ |
| 186 | +| 38 | NC | | |
| 187 | ++--------+-------------+----------------------+ |
| 188 | +| 40 | GND | GND | |
| 189 | ++--------+-------------+----------------------+ |
| 190 | + |
| 191 | +System Clock |
| 192 | +============ |
| 193 | + |
| 194 | +nRF52 has two external oscillators. The frequency of the slow clock is |
| 195 | +32.768 kHz. The frequency of the main clock is 32 MHz. |
| 196 | + |
| 197 | +Flashing Zephyr onto 96Boards Nitrogen |
| 198 | +************************************** |
| 199 | + |
| 200 | +The 96Boards Nitrogen board can be flashed via the `CMSIS DAP`_ interface, |
| 201 | +which is provided by the micro USB interface to the LPC11U35 chip. |
| 202 | + |
| 203 | +Using the CMSIS-DAP interface, the board can be flashed via the USB storage |
| 204 | +interface (drag-and-drop) and also via `pyOCD`_. |
| 205 | + |
| 206 | +Installing pyOCD |
| 207 | +================ |
| 208 | + |
| 209 | +The latest stable version of `pyOCD`_ can be installed via pip as follows: |
| 210 | + |
| 211 | +.. code-block:: console |
| 212 | +
|
| 213 | + $ pip install --pre -U pyocd |
| 214 | +
|
| 215 | +To install the latest development version (master branch), do the following: |
| 216 | + |
| 217 | +.. code-block:: console |
| 218 | +
|
| 219 | + $ pip install --pre -U git+https://github.com/mbedmicro/pyOCD.git#egg=pyOCD |
| 220 | +
|
| 221 | +You can then verify that your board is detected by pyOCD by running: |
| 222 | + |
| 223 | +.. code-block:: console |
| 224 | +
|
| 225 | + $ pyocd-flashtool -l |
| 226 | +
|
| 227 | +Common Errors |
| 228 | +------------- |
| 229 | + |
| 230 | +No connected boards |
| 231 | +------------------- |
| 232 | + |
| 233 | +If you don't use sudo when invoking pyocd-flashtool, you might get any of the |
| 234 | +following errors: |
| 235 | + |
| 236 | +.. code-block:: console |
| 237 | +
|
| 238 | + No available boards are connected |
| 239 | +
|
| 240 | +.. code-block:: console |
| 241 | +
|
| 242 | + No connected boards |
| 243 | +
|
| 244 | +.. code-block:: console |
| 245 | +
|
| 246 | + Error: There is no board connected. |
| 247 | +
|
| 248 | +To fix the permission issue, simply add the following udev rule for the |
| 249 | +NXP LPC1768 interface: |
| 250 | + |
| 251 | +.. code-block:: console |
| 252 | +
|
| 253 | + $ echo 'ATTR{idProduct}=="0204", ATTR{idVendor}=="0d28", MODE="0666", GROUP="plugdev"' > /etc/udev/rules.d/50-cmsis-dap.rules |
| 254 | +
|
| 255 | +Finally, unplug and plug the board again. |
| 256 | + |
| 257 | +ValueError: The device has no langid |
| 258 | +------------------------------------ |
| 259 | + |
| 260 | +As described by `pyOCD issue 259`_, you might get the |
| 261 | +:code:`ValueError: The device has no langid` error when not running |
| 262 | +pyOCD as root (e.g. sudo). |
| 263 | + |
| 264 | +To fix the above error, add the udev rule shown in the previous section |
| 265 | +and install a more recent version of pyOCD. |
| 266 | + |
| 267 | +Flashing an Application to 96Boards Nitrogen |
| 268 | +============================================ |
| 269 | + |
| 270 | +The sample application :ref:`hello_world` is being used in this tutorial: |
| 271 | + |
| 272 | +.. code-block:: console |
| 273 | +
|
| 274 | + $<zephyr_root_path>/samples/hello_world |
| 275 | +
|
| 276 | +To build the Zephyr kernel and application, enter: |
| 277 | + |
| 278 | +.. code-block:: console |
| 279 | +
|
| 280 | + $ cd <zephyr_root_path> |
| 281 | + $ source zephyr-env.sh |
| 282 | + $ cd $ZEPHYR_BASE/samples/hello_world/ |
| 283 | + $ make BOARD=96b_nitrogen |
| 284 | +
|
| 285 | +Connect the micro-USB cable to the 96Boards Nitrogen and to your computer. |
| 286 | + |
| 287 | +Erase the flash memory in the nRF52832: |
| 288 | + |
| 289 | +.. code-block:: console |
| 290 | +
|
| 291 | + $ pyocd-flashtool -d debug -t nrf52 -ce |
| 292 | +
|
| 293 | +Flash the application using the pyocd-flashtool tool: |
| 294 | + |
| 295 | +.. code-block:: console |
| 296 | +
|
| 297 | + $ pyocd-flashtool -d debug -t nrf52 outdir/96b_nitrogen/zephyr.hex |
| 298 | +
|
| 299 | +Run your favorite terminal program to listen for output. |
| 300 | + |
| 301 | +.. code-block:: console |
| 302 | +
|
| 303 | + $ minicom -D <tty_device> -b 115200 |
| 304 | +
|
| 305 | +Replace :code:`<tty_device>` with the port where the board 96Boards Nitrogen |
| 306 | +can be found. For example, under Linux, :code:`/dev/ttyACM0`. |
| 307 | +The ``-b`` option sets baud rate ignoring the value from config. |
| 308 | + |
| 309 | +Press the Reset button and you should see the the following message in your |
| 310 | +terminal: |
| 311 | + |
| 312 | +.. code-block:: console |
| 313 | +
|
| 314 | + Hello World! arm |
| 315 | +
|
| 316 | +Debugging with GDB |
| 317 | +================== |
| 318 | + |
| 319 | +To debug Zephyr with GDB launch the GDB server on a terminal: |
| 320 | + |
| 321 | +.. code-block:: console |
| 322 | +
|
| 323 | + $ pyocd-gdbserver |
| 324 | +
|
| 325 | +and then launch GDB against the .elf file you built: |
| 326 | + |
| 327 | +.. code-block:: console |
| 328 | +
|
| 329 | + $ arm-none-eabi-gdb outdir/96b_nitrogen/zephyr.elf |
| 330 | +
|
| 331 | +And finally connect GDB to the GDB Server: |
| 332 | + |
| 333 | +.. code-block:: console |
| 334 | +
|
| 335 | + (gdb) target remote localhost:3333 |
| 336 | +
|
| 337 | +.. _pyOCD: |
| 338 | + https://github.com/mbedmicro/pyOCD |
| 339 | + |
| 340 | +.. _CMSIS DAP: |
| 341 | + https://developer.mbed.org/handbook/CMSIS-DAP |
| 342 | + |
| 343 | +.. _Nordic Semiconductor Infocenter: |
| 344 | + http://infocenter.nordicsemi.com/ |
| 345 | + |
| 346 | +.. _seeed BLE Nitrogen: |
| 347 | + http://wiki.seeed.cc/BLE_Nitrogen/ |
| 348 | + |
| 349 | +.. _pyOCD issue 259: |
| 350 | + https://github.com/mbedmicro/pyOCD/issues/259 |
0 commit comments