For more details on Nitrogen 96 board, refer https://www.96boards.org/documentation/iot/nitrogen/.
For more details on Nitrogen 96 board, refer https://www.96boards.org/documentation/iot/nitrogen/.
Flashing Zephyr onto 96Boards Nitrogen
Installing pyOCD
**************************************
****************
The 96Boards Nitrogen board can be flashed via the `CMSIS DAP interface <https://os.mbed.com/handbook/CMSIS-DAP>`_, which is provided by the micro USB interface to the LPC11U35 chip.
pyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes. It is fully cross-platform, with support for Linux, macOS, and Windows.
Using the CMSIS-DAP interface, the board can be flashed via the USB storage interface (drag-and-drop) and also via `pyOCD <https://github.com/pyocd/pyOCD>`_.
The latest stable version of pyOCD can be installed via `pip <https://pip.pypa.io/en/stable/>`_ as follows:
Installing pyOCD
.. code-block:: console
================
pip install --pre -U pyocd
The latest stable version of pyOCD can be installed via pip as follows:
TTo install the latest prerelease version from the HEAD of the master branch, you can do the following:
You can then verify that your board is detected by pyOCD by running:
You can then verify that your board is detected by pyOCD by running:
...
@@ -94,71 +39,110 @@ You can then verify that your board is detected by pyOCD by running:
...
@@ -94,71 +39,110 @@ You can then verify that your board is detected by pyOCD by running:
pyocd-flashtool -l
pyocd-flashtool -l
Common Errors
*************
No connected boards
Common errors in pyOCD
===================
======================
If you don’t use sudo when invoking pyocd-flashtool, you might get any of the following errors:
* If you do not use sudo when invoking pyocd-flashtool, you might get any of the following errors:
.. code-block:: console
.. code-block:: console
No available boards are connected
No available boards are connected
No connected boards
No connected boards
Error: There is no board connected.
Error: There is no board connected
* Lack of permission gets reported as ValueError (The device has no langid), perform the instructions as suggested in
https://github.com/pyocd/pyOCD/tree/master/udev.
To fix the permission issue, simply add the following udev rule for the NXP LPC1768 interface:
Flashing an Application to 96Boards Nitrogen
********************************************
.. code-block:: console
The 96Boards Nitrogen board can be flashed via the CMSIS DAP interface. CMSIS-DAP provides a standardized way to access the Coresight Debug Access Port (DAP) of an ARM Cortex microcontroller via USB.
Using the CMSIS-DAP interface, the board can be flashed via the USB storage interface (drag-and-drop) and also via pyOCD.
Finally, unplug and plug the board again.
For flashing an application to board **pyocd** must be installed in your system. You can flash Zephyr samples to 96b-nitrogen boards.
ValueError: The device has no langid
To flash the example you built with command e.g.
====================================
As described by `pyOCD issue 259 <https://github.com/pyocd/pyOCD/issues/259>`_, you might get the **ValueError: The device has no langid** error when not running pyOCD as root (e.g. sudo).
.. code-block:: console
96b-nitrogen bitbake zephyr-philosophers
Call similar command with explicit flash usb command:
.. code-block:: console
To fix the above error, add the udev rule shown in the previous section and install a more recent version of pyOCD.
Here is an example for the `Hello World application <https://docs.zephyrproject.org/latest/samples/hello_world/README.html#hello-world>`_.
OpenHarmony can be hosted on top of variety of kernels. Currently supported kernels (a.k.a. OHOS flavours) are Linux, Zephyr and FreeRTOS (experimental).
This requires installing the `pyOCD Debug Host Tools <https://docs.zephyrproject.org/latest/guides/flash_debug/host-tools.html#pyocd-debug-host-tools>`_.
Run your favorite terminal program to listen for output.
MACHINE variable can be set up in conf/local.conf file under build directory or via command line, e.g.:
.. code-block:: console
.. code-block:: console
minicom -D <tty_device> -b 115200
$ MACHINE=<target_machine> bitbake <image-name>
OHOS Zephyr flavour is based on zephyr distribution and supports following images/machines:
Replace **<tty_device>** with the port where the board 96Boards Nitrogen can be found. For example, under Linux, **/dev/ttyACM0**. The **-b** option sets baud rate ignoring the value from config.
* Supported images:
* zephyr-philosophers
Press the Reset button and you should see the the following message in your terminal: