Troubleshooting

Fedora packages

In case, I need to change these packages later:

  1. Equivalent of apt install pkg-config libgtk2.0-dev bridge-utils device-tree-compiler libncurses-dev -> dnf install pkg-config bridge-utils elfutils uboot-tools dtc libfdisk ncurses-devel
  2. dtc is device-tree-compiler and ncurses-devel is libncurses-dev.
  3. arm-none-eabi-gcc-cs is gcc-arm-none-eabi

Debug errors

The issue you could get is Unable to start debugging. The value of miDebuggerPath is invalid.

I guess this applies to all Linux distributions. They are various ways to make it work... The first issue is that the debugger (gdb) used in pined to a specific version of a specific toolchain. You can see this under .vscode/launch.json, the 2 "miDebuggerPath": "/opt/toolchains/arm-linux-gnueabihf_6.4.1/bin/arm-linux-gnueabihf-gdb".

/opt/toolchains/arm-linux-gnueabihf_6.4.1/bin/arm-linux-gnueabihf-gdb: error while loading
shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

Make sure you have the version 5 not 6 of libncurses ! Issues
During VSCode debugging: arm-linux-gnueabihf-gdb: error while loading shared libraries: libncurses.so.5, same for libpython2.7.so.1.0 -> dnf install ncurses-compat-libs.i686 ncurses-compat-libs.x86_64 python2.7

Unable to start debugging. Unable to establish a connection to GDB. The following message was written to stderr:
/opt/toolchains/arm-linux-gnueabihf_6.4.1/bin/arm-linux-gnueabihf-gdb: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared
object file: No such file or directory
See Output Window for details.

-> Install python 2.7 and if this command is giving this error, it means the LD_LIBRARY_PATH is probably not configured as mentioned above. Or maybe did you forget to restart your shell ?

/opt/python/2.7/bin/python2.7 --version
/opt/python/2.7/bin/python2.7: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
Copying /tmp/sye_student/usr/out/* into the ramfs filesystem...
init :: non DOS media
Cannot initialize '::'
::: Success
mcopy failed, exiting...
temporary directory is /tmp/so3-rootfs-8OgXI6xC
Deploying boot files into the first partition...
init :: non DOS media
Cannot initialize '::'
::: Success
init :: non DOS media
Cannot initialize '::'
::uEnv.txt: Success
init :: non DOS media
Cannot initialize '::'
::host_time.txt: Success

This error was happening because there were other errors above.

filesystem/create_partitions.sh: line 22: mkfs.vfat: command not found

The mkfs.fat command was missing, the package dosfstools was required.

Last command for Ubuntu under WSL2, only if there is an error on start mentionning MASQUERADE (see why):

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
  1. As we have the --no-install-recommends, mcopy command not found when running ./st -> apt install mtools (https://bugs.launchpad.net/ubuntu/+source/syslinux/+bug/43998)
  2. scripts/qemu-ifup.sh: line 30: ifconfig: command not found -> apt install net-tools
  3. E: Unable to locate package libncurses5:i386 In Docker only...
  4. dnsmasq command not found -> apt install dnsmasq, Fedora already has it.
  5. Debug: arm-linux-gnueabihf-gdb: error while loading shared libraries: libncurses.so.5, https://stackoverflow.com/questions/53450745/message-unable-to-run-arm-none-eabi-gdb-cannot-find-libncurses-so-5

Issues under WSL:

  1. Chain 'MASQUERADE' does not exist -> Maybe issue with nftables used instead of iptables. Issue seems to be solved. https://askubuntu.com/questions/1421466/cant-get-chain-masquerade-to-work-on-wsl2-kernel
  2. qemu-svstem-arm: failed to find romfile "efi-virtio.rom" -> sudo apt install qemu-system in addition to qemu-system-arm.

Manuel Fedora setup

In case the LXUP setup doesnt work...

WARNING: you should see the up-to-date version in sye.yml, the commands below are an unmaintained copy, some DNF packages are missing.

Fedora commands
sudo dnf install -y pkg-config bridge-utils \
    elfutils uboot-tools dtc libfdisk ncurses-devel \
    arm-none-eabi-gcc-cs \
    bison flex \
    qemu-system-arm qemu-system-aarch64 \
    cmake gcc \
    wget

sudo dnf install ncurses-compat-libs.x86_64 # for debug
sudo dnf install python2.7 # for debug, on Fedora 40 and below

On Fedora 41 and above, python 2 is not available in registry anymore, you might try this command

sudo dnf install python2.7 --releasever 40

If it doesn't work (high probability), I automated the installation of Python 2.7 on Fedora 41 in this script: python2.7.sh.

For one specific lab the PDF says you need gdb-multiarch, but on Fedora this package doesn't exist, but actually the standard gdb is working fine on Fedora.

Manuel Ubuntu setup

In case the LXUP setup doesnt work...

WARNING: you should see the up-to-date version in sye.yml, the commands below are an unmaintained copy.

Ubuntu commands

Make sure your system is up-to-date

sudo apt update && sudo apt upgrade
sudo dpkg --add-architecture i386
sudo apt update
sudo apt --no-install-recommends install -y libc6:i386 libstdc++6:i386 \
    lib32z1-dev zlib1g:i386 pkg-config libgtk2.0-dev bridge-utils mtools \
    unzip bc elfutils u-boot-tools device-tree-compiler fdisk libncurses-dev \
    bison flex \
    gcc-arm-none-eabi \
    qemu-system qemu-system-arm \
    build-essential cmake net-tools \
    dnsmasq wget iptables dosfstools

echo "deb http://security.ubuntu.com/ubuntu focal-security main universe" | sudo tee /etc/apt/sources.list.d/ubuntu-focal-sources.list
sudo apt update
sudo apt install libncurses5

For one specific lab you might also need sudo apt install gdb-multiarch.

Manual setup for debug

Bash script

Execute this Bash script to download the Linaro toolchain under /opt/toolchains/arm-linux-gnueabihf_6.4.1 from https://releases.linaro.org/components/toolchain/binaries/latest-6/arm-linux-gnueabihf/.