Debugging sifive-welcome with FreedomStudio- on Ubuntu 22.04.2 LTS

Hello world,

i am trying to get the sample sifive-welcome project running with FreedomStudio- on Ubuntu 22.04.2 LTS. I remember it a bit easier last time i tried. But now I am stuck. (It works better under Windows, but I want to use Ubuntu) These are the steps, i was using:

  1. Download the Getting Started Guide (Thanks for the 2023 update)
  2. Download Freedom Studio for Linux and the toolchain files from the Official SiFive Hifive 1 Rev B Product Website
  3. Extract FreedomStudio- as root to /usr/share/sifive/FreedomStudio-4.18.0
  4. Extract sifive-freedom-tools-2020.12-ubuntu.tar.gz files and delete&replace the corresponding folders in the FreedomStudio-4.18.0/SiFive/ folder
  5. export PATH=PATH=/usr/share/sifive/FreedomStudio-4.18.0/SiFive/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin:$PATH
  6. export RISCV_PATH=/usr/share/sifive/FreedomStudio-4.18.0/SiFive
  7. edit workspace folder in, chmod +x and execute it
  8. The IDE starts. I want to create a new Freedom E SDK Project. I select my sifive-hifive1-revb target and sifive-welcome exaple program and connect my device. I also want to create an OpenOCD debug launch configuration and click Finish. The project gets created, but nothing it doesn’t auto create the debug launch config. Building and debugging doesn’t work (no error messages, nothing happens)
  9. I select right-click “Create in project root”. This is the output:
# This file is generated.  Do not edit this file.
# You lose your edits the next time it is generated.
export PATH=/usr/share/sifive/FreedomStudio-4.18.0/SiFive/sdk-utilities-1.0.1-2020.12.1-x86_64-linux-ubuntu14:/usr/share/sifive/FreedomStudio-4.18.0/SiFive/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin:$PATH
export FREEDOM_STUDIO_INSTALL_PATH=/usr/share/sifive/FreedomStudio-4.18.0
export FREEDOM_STUDIO_TOOLCHAIN_PATH=/usr/share/sifive/FreedomStudio-4.18.0/SiFive/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin
export FREEDOM_STUDIO_PROJECT_NAME=sifive_welcome
export FREEDOM_STUDIO_PROJECT_PATH=/root/workspace/riscv/sifive_welcome
export FREEDOM_STUDIO_OPENOCD_PATH=/usr/share/sifive/FreedomStudio-4.18.0/SiFive/riscv-openocd-0.10.0-2020.12.1-x86_64-linux-ubuntu14/bin
export FREEDOM_STUDIO_QEMU=qemu-system-riscv32
export FREEDOM_STUDIO_QEMU_PATH=/usr/share/sifive/FreedomStudio-4.18.0/SiFive/riscv-qemu-5.1.0-2020.08.1-x86_64-linux-ubuntu14/bin
export FREEDOM_STUDIO_TRACE_DECODER_PATH=/usr/share/sifive/FreedomStudio-4.18.0/SiFive/trace-decoder-0.10.6-2021.04.0
export FREEDOM_STUDIO_GDB=riscv64-unknown-elf-gdb
export FREEDOM_SDK_TOOLS_PATH=/usr/share/sifive/FreedomStudio-4.18.0/SiFive/sdk-utilities-1.0.1-2020.12.1-x86_64-linux-ubuntu14
export BSP_DIR=/root/workspace/riscv/sifive_welcome/bsp
export METAL_SOURCE_PATH=/root/workspace/riscv/sifive_welcome/freedom-metal
export FREEDOM_E_SDK_VENV_PATH=/root/workspace/riscv/sifive_welcome/venv
  1. After chmod +x and executing this file I can now build the project and get the sifive-welcome.elf file.
  2. I still have no debug config. So I create one by myself. The built elf file gets preselected, which is fine. On the Debugger tab, I select /usr/share/sifive/FreedomStudio-4.18.0/SiFive/riscv-openocd-0.10.0-2020.12.1-x86_64-linux-ubuntu14/share/openocd/scripts/board/sifive-hifive1-revb.cfg as OpenOCD config script, because it was empty.
  3. It seems, I can now debug the application., but here are still some issues.

a. When debugging I get the error: No source available for “(gdb[1].proc[42000].threadGroup[i1],gdb[1].proc[42000].OSthread[1]).thread[1].frame[0]”
b. Connecting to /dev/TTYACM0 shows no line breaks even when “Translating incoming line terminators …” is checked

                  SIFIVE, INC.

                                                                            5555                   5555
                       5555                     5555
                                                            5555                       5555
         5555       5555555555555555555555
                                                5555       555555555555555555555555
                                                                                        5555                             5555
                                        5555                               5555
                                                                                  5555                                 5555
                                    5555555555555555555555555555          55555
                                                                                  55555           555555555           55555
                                       55555           55555           55555
                                                                                   55555           5           55555
                                    55555                   55555
                                                                            55555               55555
                         55555           55555
                                                             55555       55555
                                                                                               55555   55555

                       Welcome to SiFive!

Beyond that, I have issues with debugging in general with Freedom Studio. The Resume/Terminate button are always active after one terminated debug session. Even when not debugging but they are unresponsive. I need to restart the IDE. In Segger Embedded Studio I can attach/detach the probe.

Thanks for reading. It helped me to get it running halfways eventually.

Sorry, I am a total newb. If you have some hints, how to learn debugging/disassemble riscv/arm processors, please let me know.

Best regards