J-Link is low on memory

Hi,

I’m using an Adafruit Grand Central with a Segger J-Link EDU interface. Aside from timer issues that I’ve mentioned in another thread, I am now seeing a new error The connected J-Link (S/N 801018314) is low on memory. Target connection cannot be established

I read on the Segger support site that this might mean that the J-Link connection was not closed properly.

https://forum.segger.com/index.php/Thread/4998-SOLVED-J-Link-is-low-on-memory/

So my question is “how shall I avoid this situation while using the debugger interface in PlatformIO (running within VSCode)?”

I’ve attached the output from the debug console below.

Thanks in advance.

CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_grandcentral_m4.html
PLATFORM: Atmel SAM 4.5.1 > Adafruit Grand Central M4
HARDWARE: SAMD51P20A 120MHz, 256KB RAM, 1MB Flash
DEBUG: Current (jlink) External (atmel-ice, jlink)
PACKAGES:
 - framework-arduino-samd-adafruit 1.5.14
 - framework-cmsis 1.40500.0 (4.5.0)
 - framework-cmsis-atmel 1.2.0
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 10 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Checking size .pio/build/adafruit_grandcentral_m4/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   1.4% (used 3784 bytes from 262144 bytes)
Flash: [          ]   1.7% (used 18200 bytes from 1048576 bytes)
========================= [SUCCESS] Took 5.95 seconds =========================
SEGGER J-Link GDB Server V6.52
 Command Line Version
JLinkARM.dll V6.52 (DLL compiled Sep 27 2019 17:53:31)
Command line: -singlerun -if SWD -select USB -device ATSAMD51P20 -port 2331
-----GDB Server start settings-----
GDBInit file:                  none
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:               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:                 ATSAMD51P20
Target interface:              SWD
Target interface speed:        4000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link EDU Mini V1 compiled Jul 17 2020 16:25:21
Hardware: V1.00
S/N: 801018314
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...
ERROR: The connected J-Link (S/N 801018314) is low on memory. Target connection cannot be established
ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...
Restoring target state and closing J-Link connection...
Shutting down...
undefinedCould not connect to target.
Please check power, connection and settings.

If there is only every 1 debug session running at max that shouldn’t happen right? In the task manager, do you see any running JLink.exe, or arm-none-eabi-gdb processes before you click the Debug button in VSCode?

Hello Max,

I am running in Linux (actually a Linux guest in VirtualBox on a Win10 host).

I found this thread, which suggests that typing “quit” in the Debug Console might be better than pressing the “stop” (square) button in the debugger button-bar.

https://community.platformio.org/t/jlinkgdbserver-graceful-shutdown/5349

And it does seem to work more reliably after that. I am no longer seeing the “low on memory” message.

If I encounter the issue again, I will run the ps terminal command to see if another GDB process is running.

Thanks.