Skip to content

Troubleshooting

Daniel Kampert edited this page Aug 24, 2024 · 3 revisions

Troubleshooting

Table of Contents

Debugging crashes

Coredump

Use following command to decode a coredump on a FW build locally on same computer. By passing the --build_dir, we can guess both the .elf and toolchain path.

west coredump --coredump_file cb.txt --build_dir app/<build_folder>

Use when FW has been for example downloaded from GitHub, then toolchain and .elf file needs to be provided in order to decode the coredump.

west coredump --coredump_file cb.txt --elf app/<build_folder>/zephyr/zephyr.elf --toolchain /home/user/ncs/toolchains/7795df4459/opt/zephyr-sdk

If --coredump_file is omitted, then the coredump will be retreived over RTT logs. Note this requires FW built with logs over RTT enabled. After running below, go to settings -> Other -> Dump coredump over log and rest is automatic.

west coredump --build_dir app/<build_folder>

Known issues

Group policies error when executing the activation script for the virtual environment for Zephyr on Windows

Set the group policies to allow the execution of local scripts when using Windows and a virtual environment for Zephyr. Otherwise the Zephyr installation fails. Open a power shell as administrator and run set-executionpolicy remotesigned to allow the execution of local scripts.

west not found after following the installation guide from Zephyr

  1. Open a new console and check it again to make sure that the environment variables are correctly loaded
  2. If Python is installed on the system partition you need to install west by calling pip3 install west instead of pip3 install -U west

No connection with J-Link possible in Dev-Container

  1. Make sure that the firmware on the programmer is the same as in the Segger software bundle version 7.94b
  2. Otherwise install the tools with version 7.94b first
  3. Use J-Link Configurator to update the firmware of your programmer
  4. Make sure that you have attached the programmer with WSL
$ usbipd wsl list

BUSID  VID:PID    DEVICE                                                        STATE
...
12-1   1366:0105  JLink CDC UART Port (COM22), J-Link driver                    Not attached
...

$ usbipd wsl attach --busid 12-1

You can test the connection by running /opt/SEGGER/JLink/JLinkExe -autoconnect 1 -device Cortex-m33 -if swd -speed 4000 in a terminal of the development container.

Module pylink has no attribute JLink when running west upload_fs

A wrong Python module is installed. Please run

pip uninstall pylink
pip install pylink-square

Additional references