AnsweredAssumed Answered

Compiling STM32 PMSM FOC LIBv4.2 projects with GCC.

Question asked by wolff.roger on Dec 20, 2015
Latest reply on Feb 24, 2016 by Zorn.Stephan
Hi, 
After about 20 hours of work I've managed to compile an example FOC application with GCC.  
I have to link with the "non-source-code" precompiled library that is provided. In my case: "MC_Library_STM32F302x8_single_drive".
There are two such libraries in the FOC LIB. One with a ".a" extension, as delivered for IAR. And one with a ".lib" extension delivered for KEIL uVision. 

The IAR version turns out to initialize the function pointers inside objects to the actual address that the function resides at. This leads to a run-time hardfault when the CPU tries to execute the function in ARM mode as opposed to Thumb mode (lower bit set). 

The uVision version doesn't want to link due to architecture mismatch.  "Conflicting CPU architectures 13/0"

Does anybody know of an option on the linker that will fix the addresses of the thumb-functions in my library? Does anybody know an option on the linker to make it ignore the architecture mismatch? (Would that work?) 

Would it be possible to get a gcc-compiled library from ST?

I've also spent a day installing the PMSM FOC kit and keil uVision on a virtual windows machine. I've given up (Windows doesn't like me, and the feeling is mutual. It had something like "permission denied" when trying to create output files. ). 

Anyway,  I'd be happy to just compile a test program once to see it work in Keil, but 1) I couldn't get it to work. 2) the stated limit is 32k code, and with the library I'm now at "about 48k code" so I don't think that will fit. 

Suggestions?



Outcomes