当前位置:   article > 正文

linux下vscode配置gcc,linux上搭建stm32开发环境 vscode+gcc+stm32cubeMX 和 vscode+platformIO

c:/users/xch/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/ar

一、软件清单:

VSCode:应用商店安装 或

sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make

sudo apt-get update

sudo apt-get install ubuntu-make

sudo umake web visual-studio-code

arm-none-eabi-gcc:

sudo apt-get install gcc-arm-none-eabi

sudo apt-get install gdb-arm-none-eabi

或 手动下载安装:https://launchpad.net/gcc-arm-embedded/+download

( 补充:VSCode的PlatformIO IDE插件里Platform选项安装“ST STM32”家目录下会自动安装相应工具,看下面:

~/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc -v

嗯。不用另外装arm-none-eabi工具集了,如果你用PlatformIO插件的话。  )

stm32flash(串口下载,选装):

sudo apt-get install stm32flash

stm32flash -h

查看串口信息:

dmesg | grep tty

OpenOCD:(现在是0.10.0)

sudo apt install openocd

( http://openocd.org)

openocd安装和使用,请看此篇

Stm32CubeMX: 官网下载,解压后进入文件夹

sudo apt-get install default-jre

sudo ./SetupSTM32CubeMX-x.xx.x.linux

f1a58fd5a0f4e4a403e2447db98f5ff1.png

39c5f0cf172f9ccf373e2bed0dae291b.png

二、配置vscode(待续)

cortex-debug插件(感觉不错~):

launch.json例子:

{

"version": "0.2.0",

"configurations": [

{

"name": "Cortex Debug",

"cwd": "${workspaceRoot}",

"executable": "build/L496ZGTx_LPUASRT.elf",

"request": "launch",

"type": "cortex-debug",

"servertype": "openocd",

"BMPGDBSerialPort": "/dev/ttyACM0",

"runToMain": true,

"device": "STM32L496ZG",

//"preLaunchTask": "build-elf",

"configFiles": [

"board/st_nucleo_l4.cfg"

]

}

]

}

PlatformIO IDE插件(感觉支持的东西比较新):请戳http://docs.platformio.org/en/latest/ide/vscode.html#quick-start

fa7fe4c105f9aea2cdac35e9e46ce33c.png

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/217744
推荐阅读
相关标签
  

闽ICP备14008679号