STM32 Development with CubeMX and Eclipse
Using OpenOCD
Next, plug in the STLink adapter to a USB port on the computer. Since the Discovery board combines an STLink adapter with a controller module, this should be easy to reach via a USB jack. First, test whether the system recognizes the adapter. To run this test under Linux, use the commands lsusb
or dmesg
. In Windows, use the device manager to figure out whether the adapter is present.
After doing this, monitor the connection using OpenOCD. The Open On-chip Debugger requires a configuration script for accurate control. When a system wide Linux installation is involved, the Discovery Board script stm32vldiscovery.cfg is ordinarily located in in the folder /usr/share/openocd/scripts/board. By way of example, you could then use the commands from Listing 3 in order to test the Discovery board.
Listing 3
stm32vldiscovery.cfg
$ cd /usr/share/openocd/scripts/board $ openocd -f stm32vldiscovery.cfg
Setting up CubeMX
It is very easy to set up CubeMX under Linux. After registering at GET SOFTWARE on the project page [4], you can download and extract a ZIP file. After, you've done this run the installation assistant with
SetupSTM32CubeMX-<Version>.linux
Since CubeMX only creates projects for commercial development environments, you will need a converter for Eclipse. One such program is available [5] from Baoshi Zhu's Github account. It's coded in Python, so is platform independent too. Download it onto your computer with
$ git clone https://github.com/baoshi/CubeMX2Makefile
You may find that you need to install the Git client in order to be able to download.
The final component you will need is the GNU ARM plugin for Eclipse. You can get this from the project updates page [6]. Install it in the development environment clicking on Help | Install | New Software | Add. You may find it helpful to work through the online tutorial for this plugin.
« Previous 1 2 3 4 Next »
Buy this article as PDF
Pages: 7
(incl. VAT)