PlatformIO Community

Debugger not starting

Hello, I’m trying to get debugging working for a nRF52 based board, but when I start the debugger via the PIO Debug option from the dropdown it just compiles the firmware and doesn’t do anything afterwards (it only shows an infinite loading bar in the debug/run side panel).

My platformio.ini is this:

[env:rak8211_nb]
platform = nordicnrf52
board = nrf52_dk
framework = zephyr
board_build.mcu = nrf52832

upload_protocol = custom
upload_command = $PROJECT_PACKAGES_DIR/tool-openocd/bin/openocd -f $PROJECT_PACKAGES_DIR/tool-openocd/scripts/board/nordic_nrf52_ftx232.cfg -c init -c "reset init" -c halt -c "program {$SOURCE} verify" -c reset -c exit
debug_tool = custom
debug_server = $PROJECT_PACKAGES_DIR/tool-openocd/bin/openocd -d -f $PROJECT_PACKAGES_DIR/tool-openocd/scripts/board/nordic_nrf52_ftx232.cfg

I’m using a FTDI FT2232HL based board to connect to a RAKwireless RAK8211-NB and uploading the firmware works just fine.

Am I missing something to get the openocd gdb server running and connected? According to the Debug Console tab it never runs my custom openocd commands.

Debug Console log
Processing rak8211_nb (platform: nordicnrf52; board: nrf52_dk; framework: zephyr)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nrf52_dk.html
PLATFORM: Nordic nRF52 (6.0.0) > Nordic nRF52-DK
HARDWARE: NRF52832 64MHz, 64KB RAM, 512KB Flash
DEBUG: Current (custom) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
PACKAGES:
 - framework-zephyr 2.20400.201210 (2.4.0)
 - framework-zephyr-canopennode 0.0.0-alpha+sha.468d350028
 - framework-zephyr-civetweb 0.0.0-alpha+sha.99129c5efc
 - framework-zephyr-cmsis 0.0.0-alpha+sha.542b2296e6
 - framework-zephyr-fatfs 0.0.0-alpha+sha.13697783bf
 - framework-zephyr-hal-nordic 0.0.0-alpha+sha.d8a6ea9695
 - framework-zephyr-hal-st 0.0.0-alpha+sha.5b3ec3e182
 - framework-zephyr-libmetal 0.0.0-alpha+sha.0b23894a04
 - framework-zephyr-littlefs 0.0.0-alpha+sha.9e4498d1c7
 - framework-zephyr-loramac-node 0.0.0-alpha+sha.3f545d76a2
 - framework-zephyr-lvgl 0.0.0-alpha+sha.928b61c7c8
 - framework-zephyr-mbedtls 0.0.0-alpha+sha.aef137b1af
 - framework-zephyr-mcuboot 0.0.0-alpha+sha.a5d79cf8cc
 - framework-zephyr-mcumgr 0.0.0-alpha+sha.5051f9d900
 - framework-zephyr-mipi-sys-t 0.0.0-alpha+sha.957d46bc3c
 - framework-zephyr-open-amp 0.0.0-alpha+sha.724f7e2a45
 - framework-zephyr-openthread 0.0.0-alpha+sha.07f430dac6
 - framework-zephyr-segger 0.0.0-alpha+sha.874d9e9696
 - framework-zephyr-tinycbor 0.0.0-alpha+sha.40daca97b4
 - framework-zephyr-tinycrypt 0.0.0-alpha+sha.3e9a49d267
 - framework-zephyr-trusted-firmware-m 0.0.0-alpha+sha.143df67555
 - tool-cmake 3.16.4
 - tool-dtc 1.4.7
 - tool-ninja 1.9.0
 - tool-sreccat 1.164.0 (1.64)
 - toolchain-gccarmnoneeabi 1.80201.190214 (8.2.1)
Reading CMake configuration...
Parsing system calls...
Generating syscall files
Generating KObject files...
Validating driver...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Compiling .pio\build\rak8211_nb\offsets\zephyr\arch\arm\core\offsets\offsets.c.o
Compiling .pio\build\rak8211_nb\zephyr_final\zephyr\misc\empty_file.c.o
Generating header file with offsets .pio\build\rak8211_nb\zephyr\include\generated\offsets.h
Archiving .pio\build\rak8211_nb\zephyr\liboffsets.a
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\fatal.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdlib\strtol.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__host\zephyr\subsys\bluetooth\host\hci_core.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\heap.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\subsys\logging\log_msg.c.o
Compiling .pio\build\rak8211_nb\soc__arm__common__cortex_m\zephyr\soc\arm\common\cortex_m\arm_mpu_regions.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\fatal.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\isr_wrapper.S.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\crc16_sw.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\subsys\logging\log_core.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\string\string.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\init.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m\zephyr\arch\arch\arm\core\aarch32\cortex_m\reset.S.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\heap-validate.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdlib\strtoul.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\rb.c.o
Compiling .pio\build\rak8211_nb\soc__arm__nordic_nrf__nrf52\zephyr\soc\arm\nordic_nrf\nrf52\power.c.o
Archiving .pio\build\rak8211_nb\zephyr\soc\arm\common\cortex_m\libsoc__arm__common__cortex_m.a
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\msg_q.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\subsys\logging\log_backend_rtt.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\ull_adv.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\string\strncasecmp.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m__mpu\zephyr\arch\arch\arm\core\aarch32\cortex_m\mpu\arm_core_mpu.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m\zephyr\arch\arch\arm\core\aarch32\cortex_m\fault_s.S.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\irq_manage.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\drivers\timer\nrf_rtc_timer.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\mempool.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\hex.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\kheap.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m\zephyr\arch\arch\arm\core\aarch32\cortex_m\exc_exit.S.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__host\zephyr\subsys\bluetooth\host\uuid.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\work_q.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\time\gmtime.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\hci\nordic\hci_vendor.c.o
Compiling .pio\build\rak8211_nb\lib__posix\zephyr\lib\posix\nanosleep.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\mem_slab.c.o
Compiling .pio\build\rak8211_nb\..__-hal-nordic\modules\framework-zephyr-hal-nordic\nrfx\drivers\src\nrfx_clock.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\dec.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\nordic\lll\lll_clock.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdout\stdout_console.c.o
Compiling .pio\build\rak8211_nb\subsys__random\zephyr\subsys\random\rand32_entropy_device.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\subsys\logging\log_list.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\nordic\hal\nrf5\ticker.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\printk.c.o
Compiling .pio\build\rak8211_nb\soc__arm__nordic_nrf__nrf52\zephyr\soc\arm\nordic_nrf\nrf52\soc.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m\zephyr\arch\arch\arm\core\aarch32\cortex_m\scb.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\poll.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\timeout.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\crc32_sw.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\soc\arm\nordic_nrf\validate_base_addresses.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\string\strspn.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\idle.c.o
Compiling .pio\build\rak8211_nb\isr_tables\zephyr\arch\common\isr_tables.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\nmi_on_reset.S.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\nordic\hal\nrf5\ecb.c.o
Archiving .pio\build\rak8211_nb\zephyr\subsys\random\libsubsys__random.a
Compiling .pio\build\rak8211_nb\zephyr\zephyr\configs.c.o
Compiling .pio\build\rak8211_nb\zephyr\framework-zephyr-segger\rtt\SEGGER_RTT_zephyr.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\subsys\logging\log_output.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\ll_tx_pwr.c.o
Archiving .pio\build\rak8211_nb\zephyr\soc\arm\nordic_nrf\nrf52\libsoc__arm__nordic_nrf__nrf52.a
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\nordic\lll\lll.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\device.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m\zephyr\arch\arch\arm\core\aarch32\cortex_m\thread_abort.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\system_work_q.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\work_q.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\nordic\hal\nrf5\mayfly.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ticker\ticker.c.o
Archiving .pio\build\rak8211_nb\zephyr\arch\common\libisr_tables.a
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\mailbox.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\thread_abort.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\fdtable.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\subsys\power\power.c.o
Compiling .pio\build\rak8211_nb\zephyr\framework-zephyr-segger\rtt\SEGGER_RTT.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\soc\arm\nordic_nrf\validate_enabled_instances.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\ull_filter.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\util\memq.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\util\mayfly.c.o
Compiling .pio\build\rak8211_nb\drivers__entropy\zephyr\drivers\entropy\entropy_nrf5.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m\zephyr\arch\arch\arm\core\aarch32\cortex_m\vector_table.S.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdlib\exit.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\drivers\timer\sys_clock_init.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\thread_entry.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\ll_addr.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\string\strstr.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\errno.c.o
Compiling .pio\build\rak8211_nb\..__-hal-nordic\modules\framework-zephyr-hal-nordic\nrfx_glue.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\crc8_sw.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\drivers\clock_control\clock_control_nrf.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\nordic\hal\nrf5\cntr.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\util\mem.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\timer.c.o
Generating linker script .pio\build\rak8211_nb\zephyr\linker.cmd
Archiving .pio\build\rak8211_nb\zephyr\drivers\entropy\libdrivers__entropy.a
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\nordic\lll\lll_adv.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\sem.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdout\fprintf.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\queue.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m__mpu\zephyr\arch\arch\arm\core\aarch32\cortex_m\mpu\arm_mpu.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m\zephyr\arch\arch\arm\core\aarch32\cortex_m\irq_init.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\thread.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\swap_helper.S.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\stack.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\hci\hci.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__host\zephyr\subsys\bluetooth\host\hci_common.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\onoff.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\pipes.c.o
Compiling .pio\build\rak8211_nb\arch__common\zephyr\arch\common\sw_isr_common.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32__cortex_m\zephyr\arch\arch\arm\core\aarch32\cortex_m\fault.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\version.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\thread.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\subsys\net\lib\utils\addr_utils.c.o
Compiling .pio\build\rak8211_nb\drivers__gpio\zephyr\drivers\gpio\gpio_nrfx.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\prep_c.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdlib\bsearch.c.o
Archiving .pio\build\rak8211_nb\zephyr\arch\common\libarch__common.a
Compiling .pio\build\rak8211_nb\src\main.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\mempool.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__common\zephyr\subsys\bluetooth\common\dummy.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\ull.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\util\util.c.o
Archiving .pio\build\rak8211_nb\zephyr\subsys\bluetooth\host\libsubsys__bluetooth__host.a
Archiving .pio\build\rak8211_nb\zephyr\arch\arch\arm\core\aarch32\cortex_m\mpu\libarch__arm__core__aarch32__cortex_m__mpu.a
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\mutex.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\cpu_idle.S.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\crc7_sw.c.o
Compiling .pio\build\rak8211_nb\zephyr_prebuilt\zephyr\misc\empty_file.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\hci\hci_driver.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__common\zephyr\subsys\bluetooth\common\log.c.o
Compiling .pio\build\rak8211_nb\lib__posix\zephyr\lib\posix\pthread_common.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdout\sprintf.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdlib\atoi.c.o
Generating final linker script .pio\build\rak8211_nb\zephyr\linker_pass_final.cmd
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\sched.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\swap.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\smp.c.o
Archiving .pio\build\rak8211_nb\zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\ll_sw\nordic\hal\nrf5\radio\radio.c.o
Archiving .pio\build\rak8211_nb\zephyr\drivers\gpio\libdrivers__gpio.a
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\notify.c.o
Compiling .pio\build\rak8211_nb\arch__arm__core__aarch32\zephyr\arch\arch\arm\core\aarch32\nmi.c.o
Compiling .pio\build\rak8211_nb\kernel\zephyr\kernel\sem.c.o
Compiling .pio\build\rak8211_nb\lib__libc__minimal\zephyr\lib\libc\minimal\source\stdlib\malloc.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\prf.c.o
Compiling .pio\build\rak8211_nb\zephyr\zephyr\subsys\power\policy\policy_residency.c.o
Compiling .pio\build\rak8211_nb\subsys__net\zephyr\subsys\net\buf.c.o
Archiving .pio\build\rak8211_nb\zephyr\subsys\bluetooth\common\libsubsys__bluetooth__common.a
Compiling .pio\build\rak8211_nb\..__-hal-nordic\modules\framework-zephyr-hal-nordic\nrfx\mdk\system_nrf52.c.o
Archiving .pio\build\rak8211_nb\zephyr\lib\posix\liblib__posix.a
Compiling .pio\build\rak8211_nb\zephyr\zephyr\lib\os\timeutil.c.o
Compiling .pio\build\rak8211_nb\subsys__bluetooth__controller\zephyr\subsys\bluetooth\controller\crypto\crypto.c.o
Archiving .pio\build\rak8211_nb\zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
Archiving .pio\build\rak8211_nb\zephyr\lib\libc\minimal\liblib__libc__minimal.a
Archiving .pio\build\rak8211_nb\zephyr\libzephyr.a
Archiving .pio\build\rak8211_nb\modules\framework-zephyr-hal-nordic\lib..__framework-zephyr-hal-nordic.a
Archiving .pio\build\rak8211_nb\zephyr\kernel\libkernel.a
Archiving .pio\build\rak8211_nb\zephyr\subsys\bluetooth\controller\libsubsys__bluetooth__controller.a
Archiving .pio\build\rak8211_nb\zephyr\subsys\net\libsubsys__net.a
Linking .pio\build\rak8211_nb\firmware-pre.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       66428 B       512 KB     12.67%
            SRAM:       16003 B        64 KB     24.42%
        IDT_LIST:         120 B         2 KB      5.86%
Generating ISR list .pio\build\rak8211_nb\zephyr\isrList.bin
Generating ISR table .pio\build\rak8211_nb\zephyr\isr_tables.c
Compiling .pio\build\rak8211_nb\zephyr_final\zephyr\isr_tables.c.o
Linking .pio\build\rak8211_nb\firmware.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       66428 B       512 KB     12.67%
            SRAM:       16003 B        64 KB     24.42%
        IDT_LIST:          0 GB         2 KB      0.00%
Building .pio\build\rak8211_nb\firmware.hex
Checking size .pio\build\rak8211_nb\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  24.1% (used 15796 bytes from 65536 bytes)
Flash: [=         ]  12.4% (used 64802 bytes from 524288 bytes)
========================= [SUCCESS] Took 9.89 seconds =========================

I’ve noticed that sometimes it takes quite a whole for the openOCD invocation to happen. Have you waited for like, 5 minutes?

The docs only describe the style that separates each argument in its new line… Well if upload_command works like that, then I guess it works like that, too

What’s the output when manually run

$PROJECT_PACKAGES_DIR/tool-openocd/bin/openocd -d -f $PROJECT_PACKAGES_DIR/tool-openocd/scripts/board/nordic_nrf52_ftx232.cfg

in a command terminal (with adapted paths)?

Also I’d suggest to explicitly add

debug_port = localhost:3333

to the platformio.ini since that’s where openOCD should start the gdb server.

I just tried waiting for ~15 minutes but nothing happened (and it didn’t seem like it was doing anything in the background according to the CPU usage). Is there any reason it would wait before executing the debug_server command?

I tried that first but at least for the upload command it only used the first line and not all of them for some reason, so I just went with all in one line…

When I run the command directly it starts as expected on port 3333, just like you said:

xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:29)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : FTDI SWD mode enabled
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections

It just seems like it doesn’t even try (or silently fails) to execute the command. Is there maybe anything I have to change in the VSCode launch.json file? (afaik that file is autogenerated though)

Hm I had the idea of running debugging in the commandline to see more output but that doesn’t look good either (https://github.com/platformio/platformio-core/issues/3793)

The thing is there should be some output, even if it’s failing. I’m e.g. testing with a STM32 Bluepill config but no connected STLink, and launching debugging gives

grafik

And on the commandline output

grafik

All that good debug output.

Is there also no output with the “skip Pre-Debug” Debugging option?

grafik

And then click on that play button.

With the skip Pre-Debug option it looks the same:

Q_2rpiqY

Even when I disconnect the board there are no errors…

I noticed that the project name is missing after the name of those options, does that mean anything?

CHh9XaJj

It should not, I just have multiple projects in my workspace, thus the needed distinction.

One obversation I just had was that when just using the platformio.ini

[env:rak8211_nb]
platform = nordicnrf52
board = nrf52_dk
framework = zephyr
board_build.mcu = nrf52832

upload_protocol = custom
upload_command = $PROJECT_PACKAGES_DIR/tool-openocd/bin/openocd -f $PROJECT_PACKAGES_DIR/tool-openocd/scripts/board/nordic_nrf52_ftx232.cfg -c init -c "reset init" -c halt -c "program {$SOURCE} verify" -c reset -c exit

(to get the default JLink debug method) and starting PIO debug, I did get some output, after being away from the computer for… half an hour? Don’t quite remember.

grafik

Obviously something is wrong there…

1 Like

I’ve opened issue https://github.com/platformio/platform-nordicnrf52/issues/102 since I’m out of ideas.

1 Like