Hi,
I run JLink arm commandline tool using command file and it always returns exit code 0, even if application ended because of error. What's interesting is that on Ubuntu there is correct exit code.
My command file:
It is crucial for production line to know if there has been some errors during flashing.
I run JLink arm commandline tool using command file and it always returns exit code 0, even if application ended because of error. What's interesting is that on Ubuntu there is correct exit code.
My command file:
JLink output:exitonerror 1
speed 4000
if SWD
r
erase
loadfile /tmp/unexistingFile.hex
r
exit
It's the simpliest reproduction scenario but this bug occurs on any other occasion for example when I unplug programmer during flashing - still exitCode 0.$ JLink_Linux_V612_arm/JLinkExe -device nrf52 -CommandFile /tmp/commandFile.jlink
SEGGER J-Link Commander V6.12 (Compiled Nov 25 2016 18:05:29)
DLL version V6.12, compiled Nov 25 2016 18:05:16
Script file read successfully.
Processing script file...
J-Link Commander will now exit on Error
J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Nov 14 2016 16:58:29
Hardware version: V1.00
S/N: 682915018
VTref = 3.300V
Selecting 4000 kHz as target interface speed
Selecting SWD as current target interface.
Target connection not established yet but required for command.
Device "NRF52" selected.
Found SWD-DP with ID 0x2BA01477
Found SWD-DP with ID 0x2BA01477
AP-IDR: 0x24770011, Type: AHB-AP
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl 0 @ E00FF000
ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
Cortex-M4 identified.
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Erasing device ((null))...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Total time needed: 0.316s (Prepare: 0.045s, Compare: 0.000s, Erase: 0.263s, Program: 0.000s, Verify: 0.000s, Restore: 0.007s)
Erasing done.
Downloading file [/tmp/unexistingFile.hex]...
Failed to open file.
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Script processing completed.
HypriotOS: root@black-pearl in /tmp
$ echo $?
0
It is crucial for production line to know if there has been some errors during flashing.
The post was edited 1 time, last by Aleksander ().