2016-01-18 06:34 AM
I am wondering if I can use STM32 FOC SDK with a compiler other than IAR EWARM or Keil MDK-ARM.
I have looked up to a document (presentation slide) named ''STM32 PMSM FOC SDK 4.2 - Hands on workshop with hardware tools'', and it says that ''Two IDEs are supported: IAR EWARM and KEIL ?Vision.'' on page 25. But based on SDK workflow diagrams in the same document, I concluded that STM32 PMSM FOC SDK only generates parameters as header file. So, I thought I should be able to take those header files and use wherever I want. Am I right? And if not, what am I missing? Note: I attempted to try that, but the SDK gave an error which I think is about a completely different subject (pin mapping). #stm32-pmsm-foc2016-01-21 02:16 AM
I've tried and by now managed to compile the FOC code with gcc.
Getting to know the FOC code while at the same time porting it to an unsupported compiler is tricky. In the end I had to ''get it (almost) working with KEIL'' before I was able to get it to work with gcc. Some of the FOC code is ''binary only''. This is provided as a library for one of the supported compilers. It turns out that gcc supports the IAR library format. However, IAR apparenlty optimizes the code by eliminating functions that are never called. This functionality also exists in the gnu toolchain, but is implemented differently so it doesn't work with the supplied IAR library. . Therefore you'd need to recompile the library (but you don't get the source), or live with the fact that it compiles some 20k of dead code into your binary. Also the gnu linker has a bug that isn't yet fixed in the mainstream distributed binaries: The PC relative references to thumb functions are not linked correctly. https://bugs.launchpad.net/gcc-arm-embedded/+bug/1421389?comments=allThat said, I've manged to port to GCC.... So it is possible. But there is no support from ST, as they say ''not supported''....2016-03-07 07:20 AM
Hello Wolff.roger,
Could you give some pointers on how you were able to compile with gcc? Currently I'm stuck linking pre-compiled object files. i.e. linking STO_SpeednPosFdbkClass.o and such, makes the program throw a Hard Fault on MCBoot function.2016-03-14 02:30 AM
2021-06-17 01:03 AM
The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK).
Best regards