STM32F107 and assembler errors?
Currently I am working on a project using the STM32F107 and the System Workbench. I have already worked on another project with a STM32F407 and the System Workbench before, so I know a little bit how to find my way around.
So far everything was working fine.
However, I am experiencing some (for me) unexpected behavior which I want to understand rather than just live with it
The OpenSTM32 IDE version I am using is:
OpenSTM32 IDE 1.10.0.201607251855 fr.ac6.feature.mcu.ide.feature.group Ac6
ARM Compiler:
ARM Compiler for MCU (for Windows 32 bits) 1.7.0.201602121829 fr.ac6.feature.mcu.externaltools.armnone.win32.feature.group Ac6
There are actually 2 things:
- (Not completely reproducable): When generating code from the STM32cubeMX, everything compiles fine etc. However, when moving around the instruction “__HAL_RCC_PLLI2S_ENABLE();” (generated by the STM32CubeMX), an error appears saying: “Error: selected processor does not support `rbit r0,r0’ in Thumb mode”. However, that error was not there at the start of the project, everything compiled just fine. It was only after I converted the project to C++ usage that this appeared. Currently I have worked around the problem by just using bit-or instructions instead of using the predefined macro.
- Completely reproducable: When using the “set_BASEPRI()” and “get_BASEPRI()” macros (defined in cmsis_gcc.h), errors like “Error: selected processor does not support `mrs r3,basepri’ in Thumb mode” are produced.
Obviously, I can work around the last problem as well, however, it was bothering me that I don’t really understand why those errors are showing up. Maybe there is a perfectly suitable explanation and I’m just not getting it
Any hint is greatly appreciated.