stm32 - 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)
解决方案
您正在尝试使用 GCC 编译器编译 IAR 启动文件。您需要的启动汇编程序文件位于目录下gcc
。这两个汇编器有不同的语法。
推荐阅读
- c# - ASP.Net Core - 应用程序部件 - 防止将程序集加载到应用程序域
- reactjs - 元素隐式具有“任何”类型,因为“任何”类型的表达式不能用于索引类型“{}” - React Anagram
- node.js - 如何与 Tendermint ABCI 正确沟通?
- python - Python Pandas - 从数据框中按类别绘制多个条形图
- azure-devops - Azure DevOps 在容器代理中执行容器作业
- ruby - 记录返回 lambda 的方法
- regex - 移动与给定正则表达式匹配的目录
- mysql - Rails:通过连接表查找所有尚未连接的资源
- windows - Windows 批量重命名文件,其创建日期时间为秒
- postmark - MailMason 创建纯文本电子邮件模板