Category: J-Link SEGGER

Install SEGGER J-Link tools on GNU/Linux x64 machine

OpenOCD is a great useful utility which supports the SEGGER J-Link but sometimes I prefer its native tools, for instance I can enable the SWD JTAG mode and take advantage of other useful low level commands.

Here is the procedure how to install the proprietary J-Link tools from SEGGER on GNU/Linux. This has been tested on Xubuntu 13.04.

First of all download the J-Link software: http://www.segger.com/jlink-software.html

At the moment of this writing the latest version is the v4.62a

tar xf JLink_Linux_V462a.tgz
cd JLink_Linux_V462a

make sure you are a member of the group plugdev, to check which users are in the group

cat /etc/group | grep plugdev

if eventually you have to add your name to the group

sudo useradd -G plugdev <username>

then copy the UDEV rules file which will allow every J-Link device to be open without root permission

sudo cp 45-jlink.rules /etc/udev/rules.d

now, if we try to launch the J-Link Commander we will probably get a weird error

./StartJLinkExe.sh
./StartJLinkExe.sh: 7: ./StartJLinkExe.sh: ./JLinkExe: not found

this is due because we are trying to launch a 32bit binary on 64bit machine, in fact we need the ia32-libs package.

sudo apt-get install ia32-libs

if we launch again the start script we might get

./StartJLinkExe.sh
./JLinkExe: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory

then we have to install the readline library 32bit version

sudo apt-get install lib32readline5

we can now launch the J-Link Commander without restarting

./StartJLinkExe.sh
SEGGER J-Link Commander V4.62a ('?' for help)
 Compiled Feb  6 2013 11:42:45
 DLL version V4.62a, compiled Feb  6 2013 11:42:42
 Firmware: J-Link ARM V8 compiled Nov 14 2012 22:34:52
 Hardware: V8.00
 S/N: 58000000
 Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFULL
 VTarget = 3.222V
 Info: TotalIRLen = 9, IRPrint = 0x0011
 Info: Found Cortex-M3 r2p0, Little endian.
 Info: TPIU fitted.
 Info: ETM fitted.
 Info: FPUnit: 6 code (BP) slots and 2 literal slots
 Found 2 JTAG devices, Total IRLen = 9:
 #0 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
 #1 Id: 0x06411041, IRLen: 05, IRPrint: 0x1, STM32 Boundary Scan
 Cortex-M3 identified.
 JTAG speed: 100 kHz
 J-Link>

To check which libraries are loaded:

export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
ldd JLinkExe
linux-gate.so.1 =>  (0xf772d000)
libjlinkarm.so.4 => not found
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf76f2000)
libusb-0.1.so.4 => /lib/i386-linux-gnu/libusb-0.1.so.4 (0xf76e7000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf76de000)
libreadline.so.5 => /lib32/libreadline.so.5 (0xf76a5000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf74f2000)
/lib/ld-linux.so.2 (0xf772e000)
libtinfo.so.5 => /lib/i386-linux-gnu/libtinfo.so.5 (0xf74d3000)

 

WordPress Themes