Reputation: 404
I am required to read the serial number of connected J-Link (I use J-Link Compact Plus from Segger) via the command line.
I am using tools from Segger such as JFlash.exe and JLink.exe
I managed to find a way to read a serial number via JLink.exe by executing the following command:
JLink.exe -CommanderScript -CommandFile GetSerial.jlink
Where GetSerial.jlink is a custom file that I have created and it looks like:
ShowEmuList
exit
The above method seems to work fine but I am not convinced that this is the most optimal way.
My questions:
Jlink.exe -ShowEmuList
But the above does not seem to work:
Thanks in advance for the help.
Upvotes: 1
Views: 3046
Reputation: 2802
1: I couldn't find anything in the JFlash reference.
To answer 2:
The command line options for JLinkEXE are not that good, unfortunately. If you just need the connected emulators printed, I would rather go for Nordic Semiconductors nrfjprog
, part of the nRF Command Line tools found here.
Then you can simply do
# nrfjprog -i
960063027
960036138
960019988
821009140
It has a lot of other nice features as well but is mostly made for their nRF-chipsets though. If you are indeed using their chipset, this is a one-stop shop for everything you need.
Upvotes: 0