linux上搭建stm32开发环境 vscode+gcc+stm32cubeMX 和 vscode+platformIO

一、软件清单:

  • 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
    linux上搭建stm32开发环境 vscode+gcc+stm32cubeMX 和 vscode+platformIO_第1张图片

二、配置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

    linux上搭建stm32开发环境 vscode+gcc+stm32cubeMX 和 vscode+platformIO_第2张图片

(有空再更新。)

你可能感兴趣的:(嵌入式,stm32)