1

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!

elliott.col
  • 49
  • 1
  • 1
  • 5
  • Looks like you're missing a macro. Open up `ccnE9ju5.s` and see if it has an `error` preprocessor directive. – Fiddling Bits May 24 '15 at 02:21
  • 1
    I'd guess that toolchain is configured with a fairly ancient default CPU/architecture version (the instructions mentioned are relatively new ones), so you probably need to pass `-mcpu=cortex-m3` for it to work as expected. Assuming that IDE isn't too different from other Eclipse-based things, I'd poke around either the build settings or the toolchain editor in project properties, but can't say for sure since as well as having never heard of TrueSTUDIO I only really have experience of using external Makefiles and just bodging the Eclipse settings to make the indexer vaguely accurate. – Notlikethat May 24 '15 at 02:40
  • @fiddling-bits - I tried to hunt down ccnE9Ju5, however this is a temporary file and is deleted automatically before I can get a look at it! – elliott.col May 24 '15 at 21:57
  • @Notlikethat I have had a look around the build settings - tried changing the target to cortex-m3 instead, although I still get the same error. By changing the compiler to (CDT Internal Builder --> Gnu Make Builder), I get similar problems, although it now uses a startup script which is part of my project (startup_stm32f205xx.s, generated by STM32Cube) – elliott.col May 24 '15 at 22:04

4 Answers4

3

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

Tanja
  • 41
  • 2
  • 3
  • 11
Kotliner
  • 153
  • 2
  • 11
3

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

0___________
  • 60,014
  • 4
  • 34
  • 74
0

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. 
elliott.col
  • 49
  • 1
  • 1
  • 5
-1

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