Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Issue with debugging against Arduino Nano Matter with core 2.0.0 #59

Open
rei-vilo opened this issue Jun 10, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@rei-vilo
Copy link

rei-vilo commented Jun 10, 2024

Hardware

Arduino Nano Matter

Core version

2.0.0

Arduino IDE version

2.3.2

Operating system

Debian 12 Gnome

Radio stack variant

No radio

OpenThread Border Router device (if using Matter)

No response

Issue description

Follows #4 but with Arduino Nano Matter on core 2.0.0.

The Arduino IDE fails to launch openocd. However, the same command works fine on terminal window.

Could the AppImage suffers from an issue similar to FlatPack as in arduino/arduino-ide#2115

Thank you!

Serial output

Waiting for gdb server to start...[2024-06-10T21:19:40.774Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
/home/reivilo/.arduino15/packages/SiliconLabs/tools/openocd/0.12.0-arduino1-static/bin/openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /home/reivilo/Projets/Arduino/Blink_debug_Nano_Matter -f /tmp/.mount_Arduin6YEOpv/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl -f interface/cmsis-dap.cfg -f target/efm32s2_g23.cfg
[2024-06-10T21:19:40.807Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

RTT output (if using Matter)

No response

Minimal reproducer code

Blink example

@rei-vilo rei-vilo added the bug Something isn't working label Jun 10, 2024
@facchinm
Copy link
Contributor

facchinm commented Jun 12, 2024

@silabs-bozont the output I'm getting from the IDE is

Cortex-Debug: VSCode debugger extension version 1.5.1 git(be7d3c8+dirty). Usaage info: https://github.com/Marus/cortex-debug#usage
Reading symbols from /ssd/Arduino15/packages/SiliconLabs/tools/gcc-arm-none-eabi/12.2.rel1/bin/arm-none-eabi-objdump --syms -C -h -w /tmp/arduino/sketches/6A7EE24BD65EAE7B9A9F904436390BEB/Blink.ino.elf
Reading symbols from /ssd/Arduino15/packages/SiliconLabs/tools/gcc-arm-none-eabi/12.2.rel1/bin/arm-none-eabi-nm --defined-only -S -l -C -p /tmp/arduino/sketches/6A7EE24BD65EAE7B9A9F904436390BEB/Blink.ino.elf
Launching GDB: /ssd/Arduino15/packages/SiliconLabs/tools/gcc-arm-none-eabi/12.2.rel1/bin/arm-none-eabi-gdb -q --interpreter=mi2 /tmp/arduino/sketches/6A7EE24BD65EAE7B9A9F904436390BEB/Blink.ino.elf
    IMPORTANT: Set "showDevDebugOutput": "raw" in "launch.json" to see verbose GDB transactions here. Very helpful to debug issues or report problems
Launching gdb-server: /ssd/Arduino15/packages/SiliconLabs/tools/openocd/0.12.0-arduino1-static/bin/openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /tmp/.arduinoIDE-unsaved2024512-2307540-f7vu6o.3g6ib/Blink -f /tmp/.mount_arduin385hJx/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl -f interface/cmsis-dap.cfg -f target/efm32s2_g23.cfg
    Please check TERMINAL tab (gdb-server) for output from /ssd/Arduino15/packages/SiliconLabs/tools/openocd/0.12.0-arduino1-static/bin/openocd
Could not find platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/local/bld-tools/bld-tools-virtual-env/bin/python'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x0000793f90b19c00 (most recent call first):
Error: Unable to start GDB. Make sure you can start gdb from the command-line and run
    any command like "echo hello". If you cannot, it is most likely because "libncurses5" is not installed.
Finished reading symbols from objdump: Time: 76 ms
OpenOCD: GDB Server Quit Unexpectedly. See gdb-server output for more details.
GDB never responded to an interrupt request. Trying to end session anyways
Finished reading symbols from nm: Time: 2413 ms

so it might indeed be related with the version of gdb we are shipping in the toolchain.

@rei-vilo can you check if it's the same in your system? The get the debug console you can click on the "terminal" icon next to the "gear" icon in the debug view

@rei-vilo
Copy link
Author

Sure, the output from the IDE is

Waiting for gdb server to start...[2024-06-12T11:31:29.365Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
/home/reivilo/.arduino15/packages/SiliconLabs/tools/openocd/0.12.0-arduino1-static/bin/openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /home/reivilo/Projets/Arduino/Blink_copy_20240109222257 -f /tmp/.mount_Arduin4TnFKr/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl -f interface/cmsis-dap.cfg -f target/efm32s2_g23.cfg
[2024-06-12T11:31:29.389Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

Adding the debug_custom.json file from the procedure Debugging on the Arduino Nano Matter throws the same error message.

Waiting for gdb server to start...[2024-06-12T11:48:30.744Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
/home/reivilo/.arduino15/packages/SiliconLabs/tools/openocd/0.12.0-arduino1-static/bin/openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /home/reivilo/Projets/Arduino/Blink_copy_20240109222257 -f /tmp/.mount_ArduinvUiANZ/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl -f interface/cmsis-dap.cfg -f target/efm32s2_g23.cfg
[2024-06-12T11:48:30.788Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

Trying a second time raises this error message. Is there a utility still running in the background?

Capture d’écran du 2024-06-12 13-36-23

However, the same command from the terminal succeeds.

$ /home/reivilo/.arduino15/packages/SiliconLabs/tools/openocd/0.12.0-arduino1-static/bin/openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /home/reivilo/Projets/Arduino/Blink_copy_20240109222257 -f /tmp/.mount_ArduinvUiANZ/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl -f interface/cmsis-dap.cfg -f target/efm32s2_g23.cfg
Open On-Chip Debugger 0.12.0+dev-01514-g21fa2de70 (2024-02-07-19:19)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
CDRTOSConfigure
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
efm32s2_dci_read_se_status
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2341:0x0072, serial=EE54D8AC
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Serial# = EE54D8AC
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x6ba02477
Info : [efm32s2.cpu] Cortex-M33 r0p4 processor detected
Info : [efm32s2.cpu] target has 8 breakpoints, 4 watchpoints
Info : [efm32s2.cpu] Examination succeed
Info : starting gdb server for efm32s2.cpu on 50000
Info : Listening on port 50000 for gdb connections

Environment

$ uname -a
Linux NUC-12 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants