Is platformio nrf52 debugger zephyr RTOS aware?

I can create another jlink project that will cause it to be loaded but it’s not a clean approach. Trying it now.

Ah, because debug_tool = custom it does not load the JLink packages.

I forced loading tool-jlink using another project with debug_tool=jlink and now the custom server finds the exe file. It does have an error though during the debugger start:

J
LinkARM.dll V7.50a (DLL compiled Jul  8 2021 18:16:52)

Command line: -singlerun -if SWD -select USB -device nRF52832
_xxAA -port 2331 -rtos GDBServer/RTOSPlugin_Zephyr
-----GDB
Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Termi
nal I/O port:             2333
Accept remote connection:
      localhost only
Generate logfile:
off
Verify download:               off
Init regs on s
tart:            off
Silent mode:
  off
Single run mode:               on
Target connection timeout:     0 ms
-
-----J-Link related settings------
J-Link Host interface:         USB
J-Link
script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 nRF52832_xxAA
Target in
terface:              SWD
Target interface speed:        4000kHz
Target endian:                 little
C
onnecting to J-Link...
J
-Link is connected.
F
irmware: J-Link EDU Mini V1 compiled Nov  2 2021 11:12:01
Hardware: V1.00
S/N: 801041412
Feature(s): FlashBP, GDB
C
hecking target voltage...
Target voltage: 3.30 V
L
istening on TCP/IP port 2331
Connecting to target...
undefinedC:\Users\user\.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
C
onnected to target
Waiting for GDB connection...
Reading symbols from c:\projects\ble_stepper_monitor\repo\platformio\.pio\build\nrf52_dk\firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = custom
PlatformIO: Initializing remote target...
C
onnected to 127.0.0.1
R
eading all registers
R
ead 4 bytes @ address 0x31FFF04E (Data = 0x00000000)
R
ead 2 bytes @ address 0x31FFF04E (Data = 0x0000)
0x31fff04e in ?? ()
L
oading RTOS plugin: GDBServer/RTOSPlugin_Zephyr...
R
TOS plugin (API v1.1) loaded successfully
RTOS plugin: Loaded
R
eceived symbol: _kernel (0x20000774)
Received symbol: _kernel_openocd_offsets (0x00005074)
Received symbol: z_sys_post_kernel (0x200007B3)
All manda
tory symbols successfully loaded.
W
ARNING: Unsupported remote command "init"
.pioinit:14: Error in sourced command file:
Target does not support this command.

Ugh yes, it uses different init commands for the JLink server… Those would have to be added with debug_init_cmds

A way cleaner way would be to just use the fixed platform and remove all debug_... configurations.

platform = https://github.com/maxgerhardt/platform-nordicnrf52.git#patch-4

I am trying now your patch-4 link. It takes some time to load. Will report here latter today how it worked.

In any case, I think that that pull request will be the simplest solution from user perspective. No need to deal with custom server and such and platformio is aware of the dependency on the jlink tool.

It doesn’t seem to work. I was trying this platformio.ini:

[env:nrf52_dk]
;platform = nordicnrf52
platform = https://github.com/maxgerhardt/platform-nordicnrf52.git#patch-4
board = nrf52_dk
framework = zephyr
build_type = debug

And wasgetting this error when I try to build

Processing nrf52_dk (platform: https://github.com/maxgerhardt/platform-nordicnrf52.git#patch-4; board: nrf52_dk; framework: zephyr)
-------------------------------------------------------------------------------------------------------------------------------------------------------------Platform Manager: nordicnrf52 @ 9.3.0+sha.d085d79 is already installed
Error: Unknown development platform 'PackageItem <path=C:\Users\user\.platformio\platforms\nordicnrf52 metadata=PackageMetaData <type=platform name=nordicnrf52 version=9.3.0+sha.d085d79 spec={'owner': None, 'id': None, 'name': 'platform-nordicnrf52', 'requirements': None, 'url': 'git+https://github.com/maxgerhardt/platform-nordicnrf52.git#patch-4'}'
The terminal process "C:\Users\user\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.