[ubuntu stm32]ubuntu stm32 develop envirment

Reference: https://www.instructables.com/id/Build-a-Program-for-STM32-MCU-Under-Linux/

Ubuntu下使用STM32CubeMX和SW4STM32进行开发 https://my.oschina.net/igiantpanda/blog/1618140

1.Install gcc compiler for stm32.

sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi

After installed:

2.Install STM32CubeMX

There is 2 method to use lib. First way, you can direct download lib without STM32CubeMx(not suggest to use), as following:

Download in stm32 official site: https://www.st.com/en/development-tools/stm32cubemx.html

Or use STM32CubeMx to auto generote a project, as following:

Download from https://my.st.com/content/my_st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.license=1547121534992.product=STM32CubeMX.version=5.0.1.html

When you execute the STM32CubeMx, maybe suffer a proble, as below:

The reason is ubuntu is 64-bit system, but STM32CubeMx is 32-bit program, so we need to install libc6-i386, as below:

sudo apt install libc6-i386

And you also maybe meet another problem, as below:

So you need to install JRE, as below:

sudo apt install openjdk-8-jre

And now, you can open the installer as below:

3.Generate a demo project.

After installed, use command "./STM32CubeMX " to execute, as below:

Usage:

(1)Configure a new project: (If first time to use, will be download automatic).

If succeed, the project directory as below (already exit Makefile):

At lastj, input "make" to compile the project, output file is:

5.Dowload using JLInk, detail see other artcle.

5.stm32 IDE.

You can found the suported IDE on ST official site: https://www.st.com/en/development-tools/stm32-ides.html?querycriteria=productId=LN1200

5.Use Code::Blocks IDE.

sudo apt install codeblocks

 

(to be contiue ... )

6.Use eclipse IDE.

(to be contiue ... )

7.Use vscode IDE.

(to be contiue ... )

(end)

猜你喜欢

转载自www.cnblogs.com/lizhuohui/p/10274375.html