# About
This is a collection CMake build scripts used to build code generated by the STM32CubeMX tool from STMicroelectronics. An example project exists to demonstrate using a project file with code generated for the STM32F042K6 part as found on the NUCLEO-F042K6 development board.
STM32CubeMX currently exports build files for a few embedded-centric IDEs, which is not so helpful for people using gcc *from the command-line* or in my case, inside Emacs. I have added my own attempt at a CMake build script to handle generating a firmware binary, and flashing it to a development board using OpenOCD.
*CMakeLists.txt* here is the only noteworthy file; the generated firmware source code is simply convenient for testing the build process. Using this script with other targets should be a matter of using STM32CubeMX to generate code for your target, changing some file paths, and adjusting your compiler/linker flags.
# Running the Example Project
Prerequisites:
- Linux (OSX untested but should be usable)
- GNU ARM toolchain (i.e. arm-none-eabi-gcc, etc. are available)
- NUCLEO-F042K6 development board connected to USB
- OpenOCD (and R/W permissions to the USB device)
Compiling and flashing to target:
```
$ mkdir example/build; cd example/build
$ cmake ..
$ make flash
```
# Exporting Your Projects from STM32CubeMX
Select the *SW4STM32* IDE/toolchain from the when exporting your project.
# References
[STM32CubeMX](http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html)
[NUCLEO-F042K6 development board](http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-nucleo/nucleo-f042k6.html)
[OpenOCD](http://openocd.org/)
# License
MIT license unless designated otherwise. Generated files maintain their original licenses. Contributions welcome.
没有合适的资源?快使用搜索试试~ 我知道了~
stm32cubemx完整资源:CMake脚本以构建由STM32CubeMX生成的微控制器固件
共85个文件
h:55个
c:18个
txt:4个
需积分: 1 0 下载量 168 浏览量
2024-07-06
15:37:26
上传
评论
收藏 1.49MB ZIP 举报
温馨提示
stm32cubemx完整资源:CMake脚本以构建由STM32CubeMX生成的微控制器固件
资源推荐
资源详情
资源评论
收起资源包目录
stm32cubemx完整资源.zip (85个子文件)
stm32cubemx-cmake-master-2433747jf
STM32F769NI.ioc 6KB
STM32F042K6_CMakeLists.txt 3KB
STM32F769NI_CMakeLists.txt 4KB
STM32F042K6.ioc 3KB
.gitignore 42B
example
Drivers
STM32F0xx_HAL_Driver
Src
stm32f0xx_hal.c 15KB
stm32f0xx_hal_cortex.c 13KB
stm32f0xx_hal_tim.c 165KB
stm32f0xx_hal_i2c_ex.c 11KB
stm32f0xx_hal_rcc_ex.c 37KB
stm32f0xx_hal_dma.c 25KB
stm32f0xx_hal_tim_ex.c 66KB
stm32f0xx_hal_flash_ex.c 33KB
stm32f0xx_hal_i2c.c 158KB
stm32f0xx_hal_pwr.c 18KB
stm32f0xx_hal_pwr_ex.c 10KB
stm32f0xx_hal_flash.c 22KB
stm32f0xx_hal_gpio.c 20KB
stm32f0xx_hal_rcc.c 50KB
Inc
stm32f0xx_hal_pwr_ex.h 19KB
stm32f0xx_hal_i2c_ex.h 13KB
stm32f0xx_hal_cortex.h 5KB
stm32f0xx_hal_dma_ex.h 59KB
stm32f0xx_hal.h 33KB
stm32f0xx_hal_gpio.h 13KB
stm32f0xx_hal_flash_ex.h 21KB
Legacy
stm32_hal_legacy.h 173KB
stm32f0xx_hal_i2c.h 32KB
stm32f0xx_hal_rcc_ex.h 94KB
stm32f0xx_hal_def.h 7KB
stm32f0xx_hal_tim_ex.h 13KB
stm32f0xx_hal_flash.h 12KB
stm32f0xx_hal_tim.h 80KB
stm32f0xx_hal_gpio_ex.h 52KB
stm32f0xx_hal_dma.h 30KB
stm32f0xx_hal_pwr.h 7KB
stm32f0xx_hal_rcc.h 84KB
CMSIS
Include
arm_common_tables.h 7KB
cmsis_armcc_V6.h 54KB
core_cm0plus.h 44KB
arm_math.h 246KB
core_cmFunc.h 4KB
cmsis_armcc.h 24KB
core_cm0.h 36KB
core_cm4.h 112KB
core_sc300.h 100KB
core_cm3.h 101KB
core_cmInstr.h 4KB
cmsis_gcc.h 40KB
arm_const_structs.h 4KB
core_cmSimd.h 4KB
core_cm7.h 136KB
core_sc000.h 44KB
Device
ST
STM32F0xx
Source
Templates
system_stm32f0xx.c 13KB
gcc
startup_stm32f042x6.s 11KB
Include
system_stm32f0xx.h 4KB
stm32f072xb.h 941KB
stm32f071xb.h 590KB
stm32f030x6.h 420KB
stm32f070xb.h 455KB
stm32f030xc.h 459KB
stm32f070x6.h 440KB
stm32f048xx.h 887KB
stm32f051x8.h 539KB
stm32f078xx.h 938KB
stm32f091xc.h 996KB
stm32f098xx.h 993KB
stm32f0xx.h 10KB
stm32f042x6.h 890KB
stm32f038xx.h 442KB
stm32f058xx.h 536KB
stm32f031x6.h 445KB
stm32f030x8.h 425KB
CMakeLists.txt 3KB
Src
stm32f0xx_it.c 3KB
stm32f0xx_hal_msp.c 3KB
main.c 3KB
f042test.ioc 3KB
Inc
stm32f0xx_it.h 3KB
stm32f0xx_hal_conf.h 12KB
mxconstants.h 3KB
STM32F042K6Tx_FLASH.ld 6KB
README.md 2KB
STM32L432KC.ioc 5KB
STM32L432KC_CMakeLists.txt 5KB
共 85 条
- 1
资源评论
天`南
- 粉丝: 1291
- 资源: 270
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功