[Solved]JLink uploading

Trying to upload code to LPC11u68 (mbed framework) using JLinkEXE on Ubuntu 16.

Something wrong with the command line outputted to jlink by Platformio

Configuring upload protocol…
AVAILABLE: blackmagic, jlink, mbed
CURRENT: upload_protocol = jlink
Uploading .pioenvs/debug_jlink/firmware.bin
SEGGER J-Link Commander V6.32h (Compiled Jul 5 2018 18:15:02)
DLL version V6.32h, compiled Jul 5 2018 18:14:58

Unknown command line option base/.pioenvs/debug_jlink/upload.jlink.
*** [upload] Error 1
================================= [ERROR] Took 5.37 seconds =================================
The terminal process terminated with exit code: 1

Is it possible that -CommandScript is missing from the command line? It is almost as if the path to upload.jlink was passed as is to jlinkEXE ?

EDIT: have tested manually executing, connecting and uploading using jlinkexe - it all works

1 Like

What is your current working directory?

$ pwd

Could you provide an output from?

pio run -t upload -v
1 Like

$ pwd

/home/jonne/Documents/PlatformIO/Projects/LPC11U68 base

jonne@ThinkPad-X61:~/Documents/PlatformIO/Projects/LPC11U68 base$ pio run -t upload -v

Processing debug_jlink (upload_protocol: jlink; framework: mbed; debug_tool: custom; platform: nxplpc; board: lpc11u68; debug_server: usr/bin/JLinkGDBServer, -singlerun, -if, SWD, -select, USB, -port, 2331, -device, LPC11U68)

PLATFORM: NXP LPC > LPCXpresso11U68
SYSTEM: LPC11U68 50MHz 36KB RAM (256KB Flash)
DEBUG: CURRENT(custom) ON-BOARD(cmsis-dap) EXTERNAL(blackmagic, jlink)
Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 15 compatible libraries
Scanning dependencies…
No dependencies
MethodWrapper([“checkprogsize”], [“.pioenvs/debug_jlink/firmware.elf”])
Memory Usage → Redirecting...
DATA: [ ] 0.4% (used 140 bytes from 36864 bytes)
PROGRAM: [ ] 1.3% (used 3492 bytes from 262144 bytes)
.pioenvs/debug_jlink/firmware.elf :
section size addr
.text 3476 0
.data 8 268435712
.data_RAM2 0 536870912
.data_RAM3 0 536887296
.bss 132 268435720
.bss_RAM2 0 536870912
.bss_RAM3 0 536887296
.ARM.exidx 8 3476
.uninit_RESERVED 0 268435712
.noinit_RAM2 0 536870912
.noinit_RAM3 0 536887296
.noinit 0 268435852
.ARM.attributes 40 0
.comment 126 0
.debug_info 5263 0
.debug_abbrev 2337 0
.debug_aranges 1632 0
.debug_ranges 1888 0
.debug_line 6949 0
.debug_str 6294 0
.debug_frame 4524 0
Total 32677
([“upload”], [“.pioenvs/debug_jlink/firmware.bin”])
AVAILABLE: blackmagic, jlink, mbed
CURRENT: upload_protocol = jlink
JLinkExe -device LPC11U68 -speed 4000 -if swd -autoconnect 1 -CommanderScript /home/jonne/Documents/PlatformIO/Projects/LPC11U68 base/.pioenvs/debug_jlink/upload.jlink
SEGGER J-Link Commander V6.32h (Compiled Jul 5 2018 18:15:02)
DLL version V6.32h, compiled Jul 5 2018 18:14:58

Unknown command line option base/.pioenvs/debug_jlink/upload.jlink.

There’s a space in path which is not quoted properly. Rename the project or correct the command if you control that part of the command.

1 Like

Thanks. I realized it also right after I posted. Forum auto-blocked me (2nd post rule) :wink:

This is a bug and was fixed in

Thanks!

1 Like