embedded 原文存档
PlatformIO + STM32CubeMX+vscode+RTThread
参考链接:https://blog.csdn.net/jiladahe1997/article/details/108371747
pio的快捷键:
| build | Ctrl+Alt+B |
| download | CTRL+ALT+U |
1,使用STM32CubeMX正常生成工程,生成时候选择makefile
2,因为pio自己会下载cube库,正常默认使用它自己的库,所以用cubemx生成的工程,可以配置pio的ini文件来让pio使用工程自己的cube库。
3,pio识别工程是查找platfomio.ini文件,所以可以用pio生成工程,名字和cubemx的名字一样。或者直接在cubemx工程里面新建一个platfomio.ini文件
`[platformio] src_dir = ./ [env:genericSTM32F103RC] platform = ststm32 board = genericSTM32F103RC /* 注释掉下面framework这一行(ini文件中分号表示注释)*/ /* 表示不使用plateformIO的HAL库 */ ;framework = stm32cube /* 表示使用项目目录下的HAL库以及RT-threa */ build_flags = -D STM32F103xE -IInc -IDrivers/CMSIS/Include -IDrivers/CMSIS/Device/ST/STM32F1xx/Include -IDrivers/STM32F1xx_HAL_Driver/Inc -IDrivers/STM32F1xx_HAL_Driver/Inc/Legacye/ /* 表示使用项目目录下的HAL库以及RT-thread */ src_filter = +<src/> +<startup_stm32f103xe.s> +<Drivers/> +<Middlewares/> /* 表示使用项目目录下的链接文件 */ board_build.ldscript = ./STM32F103RCTx_FLASH.ld debug_tool = stlink`