【问题标题】:Issues With CMSIS In STM32IDESTM32IDE 中的 CMSIS 问题
【发布时间】:2021-10-18 02:15:09
【问题描述】:

我对微控制器编程完全陌生,我面临着我的第一个问题。 我正在关注教程和网络文档,以便从 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)

【问题讨论】:

标签: stm32 hal m4 cmsis


【解决方案1】:

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

【讨论】:

  • 您好,感谢您的回复。如果我理解我不明白,那么我可以从构建中排除 IAR 并仅使用 GCC 目录中的文件吗?相同的文件,但编译器不同吗?
  • @Andrea 您应该从现有项目开始(STMicro 为主要编译器提供了大量项目)并尝试了解包含哪些文件以及原因。这不是很明显:) 通常启动函数是特定于编译器的,这就是为什么每个支持的工具链都有一个文件startup_stm32xxx.s
  • @Guillaume Petitjean,谢谢,我通过删除 IAR 和 ARM 以及 GCC 文件夹解决了这个问题。我使用 STARTUP 文件夹中的启动文件。在实践中,我认为我不需要 CSMIS,而只需要 HAL 库中的驱动程序文件。在这一点上,我不知道 CMSIS 库是干什么用的。
  • HAL 依赖于 CMSIS。
猜你喜欢
  • 2020-04-11
  • 2021-09-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-08-15
  • 2018-08-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多