Ubuntu13.04 use Jlink and ST-Link V2 to burn STM32F1x, STM32F4x, jlinkstm32f1x
Recently I have studied openpilot and crazyflie2.0, both of which need to be written and burned in Linux. So I have studied how to use Jlink in Linux and open-source openocd that supports multiple simulators, but it was difficult, and there was always a mistake, so I was so disheartened that I had to study it and record my experiences.
First of all, openocd is a general burning platform, support a number of simulators, such as Jlink, Ulink, ST-LINK and so on, basically on the market support, in addition, JLink itself also has DBG can be online debugging, so at the beginning, I tried to use openocd,
The environment is as follows:
1, Ubuntu1304
2, JLink and ST-LINK Simulators
The process is as follows:
1, switch to the root, plug in the JLink or ST-LINK, use the lsusb command to view the corresponding simulator usb Information
2, install libusb-1.0.9, unzip Installation
./Configure
Make
Make install
3. Download openocd0.9.0, decompress the package, and install it. Note that jlink and stlink are only used, so only enable these two simulators during configure.
./Configure -- enable-jlink -- enable-st-link
Make
Make install
Cd tcl/
If Jlink is used to debug stm32f1x, run the following command:
Openocd-f interface/jlink. cfg-f target/stm32f1x. cfg
If Jlink debugs stm32f4x, run the following command: (test failed)
Openocd-f interface/jlink. cfg-f target/stm32f4x. cfg
If ST-Link debugs stm32f1x, run the following command: (My ST-LINK is V2)
Openocd-f interface/st-link-v2.cfg-f target/stm32f1x_stlink.cfg
If ST-Link debugs stm32f4x, run the following command: (My ST-LINK is V2)
Openocd-f interface/st-link-v2.cfg-f target/stm32f4x_stlink.cfg
Unfortunately, if the test fails in the red part, Jlink cannot find the boundary, and I will use this combination, so I can only find other methods, so I tried to use the Jlink tool.
4. Download JLink_Linux_V422 and decompress it.
Cd JLink_Linux_V422/
./Start
Jlink was inserted on the STM32F4x board, and it was very successful. Why not openocd? Try again later.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.