Error: Could not find the package with 'platformio/tool-jlink

Starting to use platformio on a pi4. Project compiles okay, but during upload got:
Error: Could not find the package with ‘platformio/tool-jlink @ ^1.63208.0’

On a raspberry pi4, vscode 1.50.1, platformio IDE 2.1.3,
mcu Nordic nrf52832, board EBYTE E73-TBM-01 V1.0
probe: J-Link edu mini (same error with a J-Link clone)

platformio.ini:
[env:nrf52_dk]
platform = nordicnrf52
board = nrf52_dk
framework = mbed
debug_tool = jlink
upload_protocol = jlink
platform_packages =
toolchain-gccarmnoneeabi@~1.90301.0

A “pio update” did not help.
JLinkExe on the command line uploads hex files fine.
Had similar error message that was resolved with:
platform_packages =
toolchain-gccarmnoneeabi@~1.90301.0
That solution did not work for platformio/tool-jlink@~1.63208.0

Same project compiles, uploads, and runs on ubuntu 20.04.1 with vscode 1.50.1, platformio IDE 2.1.3

The tool-jlink package is not available for the ARM64 or ARMv6l / ARM32 architecture, at least in PlatformIO repositories (Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog). Only Mac/Windows/Linux on x86/x64. Same also goes for the alternative tool-nrfjprog that I would have otherwise recommended.

Segger lists “J-Link Software and Documentation pack for Linux ARM, DEB installer, 64-bit” (and 32-bit) as being available on their website, so it’s possible to create this package. What is the output of uname -a for the Pi?

“”"
pi@pi3a ~/nrf52/blink_mbed $ uname -a
Linux pi3a 5.4.51-v7l+ #1327 SMP Thu Jul 23 11:04:39 BST 2020 armv7l GNU/Linux
(my hostname is pi3a, but it really is a pi4b)

That was a quick response. Thanks!
“”"

Please try the following platformio.ini

[env:nrf52_dk]
platform = nordicnrf52
board = nrf52_dk
framework = mbed
debug_tool = jlink
upload_protocol = jlink
platform_packages =
   toolchain-gccarmnoneeabi@~1.90301.0
   tool-jlink@https://github.com/maxgerhardt/pio-tool-jlink-arm32.git

and report any errors.

Your change causes upload to be successfully and program runs, but debug fails with the old error:
Error: Could not find the package with ‘platformio/tool-jlink @ ^1.63208.0’ requirements for your system ‘linux_armv7l’
The terminal process “platformio ‘debug’” terminated with exit code: 1.

It could be a related problem that both compilation and compilation+upload are very slow (3 min on pi4, 40 sec on ubuntu) even when nothing has been changed. There is little output - as if the comparison of *.cpp to *.o is being done very slowly. Possibly related is the ide edit panel shows a problem with #include <mbed.h> although compilation succeeds.

Try upgrading to the latest development core (pio upgrade --dev) and see if the problem still occurs. How are you starting the debugging on the Pi? In a VSCode GUI? Does that have the latest extension version? (If it has, can you also try this on version 2.1.0 of the extension, and not the latest)?

Using the latest development core gave the same results.
Upload works, but debugging (on pi4 in vscode GUI, platformio ext. 2.1.3) fails with:
Dialog box comes up: "Errors exist after running preLaunchTask ‘undefined’
And in the task output:
Error: Could not find the package with ‘platformio/tool-jlink @ ^1.63208.0’ requirements for your system ‘linux_armv7l’
The terminal process “platformio ‘debug’” terminated with exit code: 1.

PACKAGES:

  • framework-mbed 6.60200.200722 (6.2.0)
  • tool-bossac-nordicnrf52 1.10866.191129 (1.8.66)
  • tool-jlink 1.65200.0+sha.77c4df2
  • tool-openocd 2.1000.200630 (10.0)
  • tool-sreccat 1.164.0 (1.64)
  • toolchain-gccarmnoneeabi 1.90301.200702 (9.3.1)
    Collecting mbed sources…

Platformio ext 2.1.0 gave same error. Doesn’t “pio upgrade --dev” totally change the platformio actual version???

Editor still shows problem with include mbed.h, but compiles okay.(???)

Still needs the platform-jlink in platform_packages:

platform_packages =
   toolchain-gccarmnoneeabi@~1.90301.0
   tool-jlink@https://github.com/maxgerhardt/pio-tool-jlink-arm32.git

The VSCode extension is separate from the used core. Just the core is upgrade with pio upgrade --dev.

It seems to me that the pio debug doesn’t care about platform_package overrides then and still wants to use the original version, dictated by the platform.json of the platform. In that case there are 2 paths available:

The second route is cleaner though. @ivankravets, can you publish the package for that? (Original segger .tgz in link first post)

1 Like

@valeros, please publish J-Link tool for ARM into the registry.

@accra I’ve publihsed JLink for linux_armv7l, so you should be able to debug your project now.

Debugger now works! That was fixed very quickly. All on a pi4, mbed, nrf52832 on a EBYTE E73-TBM-01 V1.0 board.
Thanks.

I do have problems with long delays - stopping then restarting debugger (7 minutes), recompiling ( 3 minutes) even when there are no changes. I will cleanout everything and start from scratch to get a better idea if it just my setup that is is messed up.

I’ve also noticed that restarting the debugger will recompile the project in debug mode, even if no changes occur; In case of running on a Pi, that’s extra punishing of course. I’m marking this thread as solved since the package is now published and debugging is possible.