STM32Cube - project does not build (Selected processor does not support Thumb mode)

a 夏天 提交于 2020-04-18 07:29:33

问题


I have generated a code base using STM32Cube for STM32F205RB to be used within Atollic TrueSTUDIO. The project does not build, giving the error:

arm-atollic-eabi-gcc -c -mthumb -std=gnu90 -DUSE_HAL_DRIVER -DSTM32F205xx -IC:\Users\Elliott\Atollic\TrueSTUDIO\ARM_workspace\USBInterfaceCUBE\USBInterfaceCube/Inc -IC:\Users\Elliott\Atollic\TrueSTUDIO\ARM_workspace\USBInterfaceCUBE\USBInterfaceCube/Drivers/STM32F2xx_HAL_Driver/Inc -IC:\Users\Elliott\Atollic\TrueSTUDIO\ARM_workspace\USBInterfaceCUBE\USBInterfaceCube/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -IC:\Users\Elliott\Atollic\TrueSTUDIO\ARM_workspace\USBInterfaceCUBE\USBInterfaceCube/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc -IC:\Users\Elliott\Atollic\TrueSTUDIO\ARM_workspace\USBInterfaceCUBE\USBInterfaceCube/Drivers/CMSIS/Include -IC:\Users\Elliott\Atollic\TrueSTUDIO\ARM_workspace\USBInterfaceCUBE\USBInterfaceCube/Drivers/CMSIS/Device/ST/STM32F2xx/Include -IC:\Users\Elliott\Atollic\TrueSTUDIO\ARM_workspace\USBInterfaceCUBE\USBInterfaceCube\Projects\TrueSTUDIO\USBInterfaceCube Configuration/Debug/ -Os -ffunction-sections -fdata-sections -g -Wall -o Drivers\STM32F2xx_HAL_Driver\stm32f2xx_hal_rcc.o ..\..\..\..\Drivers\STM32F2xx_HAL_Driver\Src\stm32f2xx_hal_rcc.c 
C:\Users\Elliott\AppData\Local\Temp\ccnE9ju5.s: Assembler messages:
C:\Users\Elliott\AppData\Local\Temp\ccnE9ju5.s:288: Error: selected processor does not support Thumb mode `rbit r3,r3'
C:\Users\Elliott\AppData\Local\Temp\ccnE9ju5.s:298: Error: selected processor does not support Thumb mode `clz r3,r3'
...

I'm not too sure where to go with this one - I have seen suggestions to change the compiler options, although I am unable to find where to do this within TrueSTUDIO (One thing which worries me somewhat is when I select project properties>C/C++ Build>Settings, I get an error "The currently displayed page contains invalid values" - however, I also get this same error on freshly created projects within TrueSTUDIO)

Any ideas, suggestions or clarifications are greatly appreciated!


回答1:


I experienced the same problem, I fixed it by adding -mcpu=cortex-m3




回答2:


In this IDE you must set the uC in the project/right_click/properties. Then it will know what to set in the -mcpu gcc option. [enter image description here]1




回答3:


After much stuffing about, I believe I have found the root of the problem - the startup script generated by STM32Cube is for MDK-ARM (I have double checked - I certainly have TrueSTUDIO selected with Cube, looks like a bug?). I can get my code to compile without any errors by creating a new project within TrueSTUDIO and copy/pasting the .s file from that project over the Cube generated project.

Looking at the top of startup_stm32f205xx.s, I can see the line below:

;* Description        : STM32F205xx devices vector table for MDK-ARM toolchain. 

The correct file mentiones TrueSTUDIO:

* @brief     STM32F2xx Devices vector table for Atollic TrueSTUDIO toolchain. 



回答4:


I had this problem. Check the configuration settings to see if your STM device is installed. I must change my stm



来源:https://stackoverflow.com/questions/30419416/stm32cube-project-does-not-build-selected-processor-does-not-support-thumb-mo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!