Building the JTAG comunication tool STLINK

STLINK is open source software to program and debug ST’s STM32 Discovery kits. Those kits have an onboard chip that translates USB commands sent by the host PC into JTAG/SWD commands.

sudo apt-get install libusb-1.0-0-dev

This is the previously created directory for building purposes

 cd  ~/stm32build
git clone git://github.com/texane/stlink.git stlink_texane
cd stm32build/stlink_texane/

./autogen.sh
./configure

make

If everything went ok we will binaries of st-flash and st-util

 

 

 

 

add the binaries to .bashrc using export command

connect the board to the system..in theJtag communication part we can see power and one another led islighted up in red color…open up a terminal and issue the command

#st-util

It detects the hardware and listens to the port and we can see the jtag led turns green when board is detected

Advertisements

3 thoughts on “Building the JTAG comunication tool STLINK

  1. I found several problems…. the yall lead to the following:

    ./configure: line 4370: syntax error near unexpected token `USB,’

    Configure fails and will report a missing libusb erroneously…

    To fix:

    1) The time stamp on many(all?) of the files from the git hub is set far into the future. This breaks make and autoconf. So you need to fix this before running autogen.sh

    2) You do need to be sure you have the latest libusb-devel installed.

    3) You will need to be sure you have pkg-config installed

    4) then issue the following command lines:

    ./autogen.sh

    ./configure

    make

    make install

    udevadm control –reload-rules

    A clean boot might be a nice idea.

    from there you can connect the discovery board and issue the following:

    st-term

    and the following should return:

    ST-Linky proof-of-concept terminal :: Created by Necromant for lulz
    chip id: 0x413
    core_id: 0x2ba01477
    cpuid:impl_id = 0x41, variant = 0
    cpuid:part = 0xc24, rev = 0x1
    sram: 0x20000000 bytes @ 0x30000

    If you connect an st-link dongle with NO connection to a cou you get:

    ST-Linky proof-of-concept terminal :: Created by Necromant for lulz
    chip id: 0
    core_id: 0
    cpuid:impl_id = 0x60, variant = 0
    cpuid:part = 0xed0, rev = 0
    sram: 0x0 bytes @ 0x0
    stlinky magic not found in sram 😦

    It would be nice if there were man pages, but the program seems easy to use so far.

    you should pursue this. It has the makings of a nice suite of programs.

    Thanks

    Glen

  2. I am a stlink-texane use since March this year. My host is running Ubuntu-13.10. Following is the package installation information on my host:

    tclee@tclee-Latitude-E6400:~/EmbeddedArm/stlink_texane$ cat config.log|egrep VERSION|egrep -v DEFS
    | #define PACKAGE_VERSION “0.5.6”
    | #define VERSION “0.5.6”
    | #define PACKAGE_VERSION “0.5.6”
    | #define VERSION “0.5.6”
    | #define PACKAGE_VERSION “0.5.6”
    | #define VERSION “0.5.6”
    PACKAGE_VERSION=’0.5.6′
    VERSION=’0.5.6′
    #define PACKAGE_VERSION “0.5.6”
    #define VERSION “0.5.6”
    tclee@tclee-Latitude-E6400:~/EmbeddedArm/stlink_texane$

    I am using this package along with the arm-none-eabi-gcc package to develop my STMF2 firmware, with no problems. My STM32F2 board connects to my host through two cables: the JTAG/SWD cable; ST-LINKv2 USB cable.

    When I run the tool in April I saw a magic number mis-match issue shown as below. What I am now have time to to make the tool available for logging the printf() messages from my STM32F2 board to my host. I need to resolve this problem. Your comment or help are extremely welcome.

    tclee@tclee-Latitude-E6400:~/EmbeddedArm/stlink_texane$ ./st-term
    ST-Linky proof-of-concept terminal :: Created by Necromant for lulz
    chip id: 0x413
    core_id: 0x2ba01477
    cpuid:impl_id = 0x41, variant = 0
    cpuid:part = 0xc24, rev = 0x1
    sram: 0x20000000 bytes @ 0x30000
    stlinky magic not found in sram 😦

    tclee@tclee-Latitude-E6400:~/EmbeddedArm/stlink_texane$

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s