linux上搭建stm32開發環境 vscode+gcc+stm32cubeMX 和 vscode+platformIO
阿新 • • 發佈:2019-02-16
一、軟體清單:
- 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
( 補充:VSCode的PlatformIO IDE外掛裡Platform選項安裝“ST STM32”家目錄下會自動安裝相應工具,看下面:
嗯。不用另外裝arm-none-eabi工具集了,如果你用PlatformIO外掛的話。 )~/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc -v
- stm32flash(串列埠下載,選裝):
檢視串列埠資訊:sudo apt-get install stm32flash stm32flash -h
dmesg | grep tty
- OpenOCD:(現在是0.10.0)
sudo apt install openocd
- Stm32CubeMX: 官網下載,解壓後進入資料夾
sudo apt-get install default-jre sudo ./SetupSTM32CubeMX-x.xx.x.linux
二、配置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" ] } ] }
(有空再更新。)