doc: Expand info about troubleshooting ModemManager

Expand information about the ModemManager issues (spurious AT commands)
and instructions on adding Segger USB devices to the ModemManager
blacklist.

Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Iván Sánchez Ortega 2018-02-13 17:09:42 +01:00 committed by Anas Nashif
parent b7862eb832
commit e618608fca

View file

@ -57,7 +57,7 @@ to install the Segger J-Link Software and the nRF5x Command-Line Tools, follow t
.. code-block:: console
$ nrfjprog --eraseall -f nrf5<x>
nrfjprog --eraseall -f nrf5<x>
Where ``<x>`` is either 1 for nRF51-based boards or 2 for nRF52-based boards
@ -65,7 +65,7 @@ Where ``<x>`` is either 1 for nRF51-based boards or 2 for nRF52-based boards
.. code-block:: console
$ nrfjprog --program outdir/<board>/zephyr.hex -f nrf5<x>
nrfjprog --program outdir/<board>/zephyr.hex -f nrf5<x>
Where: ``<board>`` is the board name you used in the BOARD directive when building (for example nrf52_pca10040)
and ``<x>`` is either 1 for nRF51-based boards or 2 for nRF52-based boards
@ -74,7 +74,7 @@ and ``<x>`` is either 1 for nRF51-based boards or 2 for nRF52-based boards
.. code-block:: console
$ nrfjprog --reset -f nrf5<x>
nrfjprog --reset -f nrf5<x>
Where ``<x>`` is either 1 for nRF51-based boards or 2 for nRF52-based boards
@ -98,17 +98,32 @@ The serial port will appear as ``/dev/ttyACMx``. By default the port is not acce
Type the command below to add your user to the dialout group to give it access to the serial port.
Note that re-login is required for this to take effect.
.. code-block:: console
.. code-block:: bash
$ sudo usermod -a -G dialout <username>
sudo usermod -a -G dialout `whoami`
To avoid it being taken by the Modem Manager for a few seconds when you plug the board in:
Recent versions of `ModemManager send AT commands to TTY-like devices`_; this
includes Nordic development kits. This will prevent you from using the serial
port for a few seconds, and can make your application misbehave if it reads
data from the UART. Before running your application, you might want to
temporarily disable ModemManager by running these commands:
.. code-block:: console
.. code-block:: bash
systemctl stop ModemManager.service
systemctl disable ModemManager.service
You can also `blacklist Segger devices by editing udev rules`_ so ModemManager
ignores them, by running:
.. code-block:: bash
sudo sh -c 'echo "ATTRS{idVendor}==\"1366\", ENV{ID_MM_DEVICE_IGNORE}=\"1\" " \
>> /etc/udev/rules.d/99-segger-modemmanager-blacklist.rules'
sudo service udev restart
A fix for this is expected in ModemManager 1.8 and new firmware for the Segger IMCUs.
Apple macOS (OS X)
==================
@ -131,7 +146,7 @@ To avoid this, you can simply disable the Mass Storage Device by opening:
And then typing the following:
.. code-block:: console
.. code-block:: bat
MSDDisable
@ -149,7 +164,7 @@ which can be very useful if the UART (through USB CDC ACM) is already being used
a purpose different than logging (such as HCI traffic in the hci_uart application).
To use RTT, you will first need to enable it by adding the following lines in your ``.conf`` file:
.. code-block:: console
.. code-block:: text
CONFIG_HAS_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
@ -228,6 +243,9 @@ References
.. _Segger Ozone: https://www.segger.com/ozone.html
.. _Segger Ozone Download: https://www.segger.com/downloads/jlink#Ozone
.. _ModemManager send AT commands to TTY-like devices: https://bugs.freedesktop.org/show_bug.cgi?id=85007
.. _blacklist Segger devices by editing udev rules: http://www.at91.com/linux4sam/bin/view/Linux4SAM/SoftwareTools#Device_or_resource_busy_dev_ttyA
.. _nRF52 DK website: http://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF52-DK
.. _Nordic Semiconductor Infocenter: http://infocenter.nordicsemi.com/
.. _J-Link Software and documentation pack: https://www.segger.com/jlink-software.html