首页 > 解决方案 > STM32IDE 中的 CMSIS 问题

问题描述

我对微控制器编程完全陌生,我面临着我的第一个问题。我正在关注教程和网络文档,以便从 STM32 库开始,我尝试将 CMSIS 和 HAL 驱动程序添加到我的 stm32IDE 中,但每次我尝试构建大量错误时都会发生。有人可以向我解释什么是错的?

../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:399: Error: bad instruction `section .text:CODE:REORDER:NOROOT(1)'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:400: Error: bad instruction `i2c2_ev_irqhandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:403: Error: bad instruction `pubweak I2C2_ER_IRQHandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:404: Error: bad instruction `section .text:CODE:REORDER:NOROOT(1)'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:405: Error: bad instruction `i2c2_er_irqhandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:408: Error: bad instruction `pubweak SPI1_IRQHandler'
../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f412zx.s:409: 
.
.
.
.
make: *** [Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/subdir.mk:91: Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.o] Error 1
"make -j12 all" terminated with exit code 2. Build might be incomplete.

00:32:15 Build Failed. 5895 errors, 0 warnings. (took 2s.475ms)

标签: stm32halm4cmsis

解决方案


您正在尝试使用 GCC 编译器编译 IAR 启动文件。您需要的启动汇编程序文件位于目录下gcc。这两个汇编器有不同的语法。


推荐阅读