Debugging nucleo/discovery boards: jlink not found

Hi, I’m regularly using JLink firmware instead of STLink V2/V2-1 on many Discovery and lately Nucleo boards, mainly STM32F4 series, as it is much more capable than stock firmware. It is freely available from Segger. Is there a way to define jlink gdb-based debugger for these boards?

My guess is that ~/.platformio/platforms/ststm32/boards/*.json should contain the new definition, but could not find the appropriate setup.

Thanks,

Lubos

Hi,

Sure, we can add new debug tool. What is your board for a test?

Hi Ivan,

As far as I’m concerned, STM32 Discovery boards (F4, L1, F152, F030), plus Nucleo F446RE would suffice. Having that option for all STLink-based boards could be helpful for others as well, because JLink firmware is universal.

EDIT: I can test your modification immediately using F4 or F446 mentioned above.
EDIT 2: ST-LINK On-Board

Thanks in advance,

Lubos

Update: I made some progress.

After installing Segger GDB install package for my OS (.deb) and connecting Nucleo-F446RE board, the following command line makes GDB identify the part and wait for commands:

$ JLinkGDBServer -device STM32F446RE -if SWD
SEGGER J-Link GDB Server V6.12e Command Line Version

JLinkARM.dll V6.12e (DLL compiled Jan  6 2017 17:21:51)

GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      yes
Generate logfile:              off
Verify download:               off
Init regs on start:            off
Silent mode:                   off
Single run mode:               off
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:                 STM32F446RE
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link STLink V21 compiled Dec 21 2016 15:10:59
Hardware: V1.00
S/N: 776042930
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...

The tool mentions DLL but still, this is Debian GNU/Linux.

We have just released new PIO Core+ v0.8.11 with a support for custom debugging configuration. Please run pio update command.

See

Custom build feature for custom JLink GDB server as documented above prints an error in Atom:
Error launching PIO Debugger
Error: Flushed due to previous errors.

The result is the same for both setups.
Any idea on how to get more verbose output?

Environment:

  1. Ubuntu 16.04 amd64, Nucleo-F446RE with JLink firmware
  2. Windows 7 amd64, JLink JLink Nucleo-F446RE with JLink firmware

Thanks

Thanks a lot! Example has been updated