STM32 development board under Linux

STM32 development board under Linux


Use CubeMX + SW4STM32
use Ubuntu18, supporting the latest version of ROS


I changed my mind, IDE is not fragrant
with cubemx generated makefile and then directly make, edit with vscode

To install a cross-compiler gcc-arm-none-eabi, and then directly make on the line

About programming, with https://github.com/texane/stlink.git it seems to be not enough. . .

Now we intend to use the STM32CubeProCgrammer

tm finally became engaged. . .

The whole process

The first step: STM32Cube installation

St official website to download STM32CubeMX, STM32CubeProCgrammer, after extracting the entire package (including exe) to round to the next linux (I'm a good win moved ubuntu download a virtual machine), can be installed directly run .linux, all the way to next

Step Two: installation dependencies

Installation and use of the 2.1 Oracle Java 8

Given STM32CubeProCgrammer with the oracle of jdk, we go to the official website to download and install the latest version of the corresponding linuxx64, this time 8u202-Linux-is-the JDK x64.tar.gz
https://www.oracle.com/technetwork/java /javase/downloads/java-archive-javase8-2177648.html

After downloading

$ sudo tar zxvf jdk-8u202-linux-x64.tar.gz -C /usr/lib/jvm
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_202/bin/java 300
$ sudo update-alternatives --config java
#随后根据提示进行,选择刚装那个

I know nothing about java: This section comes from https://blog.csdn.net/lu_embedded/article/details/103032083

2.2 libusb-1.0-0-dev installed

This is the pre-installation requirements of stlink

$ sudo apt install libusb-1.0-0-dev

2.3 cross compiler installation

Cross compiler is probably in the host A platform under compile an executable file that can be run in the B platform host. B platform itself might not have the operating system, not to mention the compiler, so this is necessary. Now it is to generate cortex-M3 of bin under linux

ubuntu18 under very simple

$ sudo apt install gcc-arm-none-eabi

2.x STM32CubeMX operating environment

I forgot. . . If you do not run up now search bar

2.End

At this point STM32CubeMX, STM32CubeProCgrammer should be able to run normally

The third step: stlink driver installation

I'm using stlink-v2 burner, github Open Source project https://github.com/texane/stlink.git
directly to make after the clone down, sudo make install just fine

Step Four: Start Testing

I do not use the middle IDE, because it is not very good. . .
I tried SW4STM32, feeling unfriendly, functions can guarantee that I not used to. If you want to use the IDE directly Quguan net SW4STM32, is Eclipse.
Currently used VSCode edit the code, is indeed easy to use, configure this section, see https://www.zybuluo.com/zzzc18/note/1645112

4.1 STM32CubeMX generate code

Other places are the same, do not make the presentation, but finally not generate the corresponding IDE directly generates makefile version

4.2 compiled code

Just write what the lighting, and then in the directory under the direct make, will generate a build folder, there are example.bin, example.elf and example.hex, bin and hex can be used for programming, elf can be used for debugging.

4.3 programming process

To the pit where they are most
open STM32CubeProCgrammer
Figure I can not add, referring to official documents https://www.st.com/content/ccc/resource/technical/document/user_manual/group0/76/3e/bd/0d/cf/ 4d / 45/25 / DM00403500 / files / DM00403500.pdf / jcr: content / translations / zh.DM00403500.pdf
fact you can probably see it with ye

4.3.1 ST-link firmware upgrade

If the front-loading drive no problem, right side should be able to detect it.
What firmware upgrade, point Fireware upgrade, after the programmer should be able to show the information corresponding to the point update, if not being given that (not in dfu), to plug it, and can not even stm32 board. Then the following points upgrade, the progress bar has completed just fine

4.3.2 board connection

I do not know how long toss, always thought it was not board-driven, or simply do not support me this small board, resulting in Rom, nearly as good as the information board, and later found not. . . After desperately searching aimlessly purpose, I saw a statement, push and hold reset, click connect , wait for a second, and release reset on the official forums. It did so again actually really become. . .
Intermediate stop time can not be too short, or not
this operation manual on why not write? ? This scrutiny ye get out? ? ?
But there seems to be a certain principle, it is estimated that in hindsight I naive

4.3.3 burning program

Before opening generated in software example.bin or example.hex, Download points on the line, reset the points on the board to start running

Guess you like

Origin www.cnblogs.com/zzzc18/p/12573262.html