cancel
Showing results for 
Search instead for 
Did you mean: 

Motor control SDK 5.1.0 code generation problem when using STM32CubeMX 4.26.0

bluenow1896
Associate III
Posted on June 10, 2018 at 18:16

Hello,

  I started the experimental work on Motor control SDK 5.1.0, it seems that the code generation have issue when using STM32Cube v4.26.0.  The problem is that the generated code/project has missing mc lib to link, which causes the build failure in the SW development IDE, such as IAR, SW4STM32, etc.

  Please refer to

https://community.st.com/0D50X00009XkWF5SAN

  to find a case of details.

  Will ST support confirm and address this issue?

  One more question is, how the MotorControlWorkbench find the version of STM32CubeMX installed in system? I have a STM32CubeMX 4.26.0 installed in system previously did not been found by MotorControlWorkbench and I have to uninstall and re-install to let MotorControlWorkbench be aware of the installation of STM32CubeMX 4.26.0.

  Which version of STM32CubeMX to be suggested to work with Motor control SDK 5.1.0?  I have STM32CubeMX  of version 4.25.1 installed and when generate code/project for SW4STM32 or TrueStudio, there a c file was missing from project and build will fail. The code/project generation for IAR is fine.

Andy

null
8 REPLIES 8
cedric h1
Associate III
Posted on June 11, 2018 at 09:41

Dear Andy,

We confirm that we have discovered just after the 5.1.0 release an issue with 

STM32Cube v4.26.0. The copy of the lib into the project is now fixed in the 5.1.1 that is already available for download.

Please note that with the latest 

STM32Cube v4.26.0, unfortunately the compilation optimization for Atollic/Truestudio is broken, and the project will not be compiled with -Ofast by default. This could be an issue depending on the PWM frequency you want to achieve. Of course, you can change this optimization within TrueStudio, (Project properties : C/C++ Build / Settings / Tool Settings/ C Compiler/ Optimizations / Optimization Level : Optimize for speed -Ofast)

We are waiting a fix from CubeMX team.

>  One more question is, how the MotorControlWorkbench find the version of STM32CubeMX installed in system?

It is done thanks to the windows registry

> Which version of STM32CubeMX to be suggested to work with Motor control SDK 5.1.0? 

We really advise you to update to 5.1.1. Project generation will be fine for both cube 4.25.1 or 4.26 ( be careful with optimization with TrueStudio)

>  I have STM32CubeMX  of version 4.25.1 installed and when generate code/project for SW4STM32 or TrueStudio, there a c file was missing from project and build will fail

We are not aware of this issue, could you tell us a bit more about your config ? what files are missing ? could you post your stmcx file ?

regards

Cedric

If you agree with my answer, please accept it by clicking on 'Accept as solution'."
Posted on June 11, 2018 at 15:48

Hi

Cedric

,

  Thanks for very helpful information. I will try

5.1.1

with MX4.26, see how it works.

  Mainly I do the evaluation on the hardware platform of X-NUCLEO-IHM07M2,  starting with the project of potentiometer from Motor control SDK.

  When using CubeMX4.25.1 to generate code/project for TrueStudio or SW4STM32, potentiometer.c in Src/ is in the folder but does not been included in TrueStudio or SW4STM32 project, which causes build fail.  The code generation for IAR is fine.

  There is another Atollic bug failed build the generated code/project on Windows. The bug is on TrueStudio windows version only. I had reported the bug 2 or 3 weeks ago, and have no further information since then, as the Atollic web site was down for maintenance/integration for over a week. The bug is that the TrueStudio windows version can handle the file path much shorter, which failed to locate either header file or c source file with long path. So the same project gone through build fine on Linux with TrueStudio.  SW4STM32 handle this well on both Windows and Linux.

Regards,

-Andy

Posted on June 11, 2018 at 16:50

Hi Andy,

Actually in the readme.txt that comes with the potentiometer example, it is specified that you can select either EWARM or MDK-ARM V5.

In the next version, we will add TrueStudio example too, but today in order to use TrueStudio, we

need the HAL version 1.9.1 for the F3 series, and it is available only through a patch from st.com, so it is not so straightforward ...

Regards

Cedric

Posted on June 12, 2018 at 01:55

Hi

Cedric

,

  I tried

5.1.1

today and unfortunately it still need manually fix things to make build go through.

  I tried the project of P-NUCLEO-IHM001/MotorControlKitPotentiometerExample/potentiometer, to generate the code/project with CubeMX4.26.0 for IAR EWB, TrueSTUDIO and SW4STM32. Each of them has at least one problem to prevent build success.  The good thing is now I know what/where go wrong for each of cases and I can fix each of them manually.

  I thought those problems are easily to reproduce, so I wouldn't provide the details hence. 

  Let me know if have question to reproduce, I certainly like to help with any details if anyone needs.

Regards,

-Andy

Posted on June 13, 2018 at 17:30

Hi Cedric,

  I want to bring to you an attention that the MC-SDK 5.1.1 seems not working well as my experience.

  I tried the project of P-NUCLEO-IHM001/MotorControlKitPotentiometerExample/potentiometer, from the package, to generate code/project through CubeMX4.26.0, for IAR EWB,  and the build from IAR EWB failed. I manually fixed the problem as now I'm be more experienced to know what/where MC-SDK could make things wrong, but still ST should fix it in the future release.

  From MC-SDK 5.1.1 , I also tried the same project of P-NUCLEO-IHM001/MotorControlKitPotentiometerExample/potentiometer, with CubeMX4.26.0 to generate the code/project for TrueSTUDIO and SW4STM32, and the build from TrueSTUDIO or SW4STM32 also failed. Again, with the experience from MC-SDK 5.1.0 , I was managed to fix the build manually.

-Andy

Posted on June 14, 2018 at 10:15

Hi Andy,

we are planing a 5.1.2 to address these kind of small issues..

For TrueStudio, we are aware of the missing potentiometer.c in the makefile, and the optimization level which is not -Ofast by default. The optimization level will be fixed in the next MX version (4.26.1 ) ( the project is build on demand by cubeMX). 

Regarding IAR, we are not aware of any issue, and you wrote in your inital post that the generation is fine. Could you tell us a bit more ?

Thanks a lot for your feedback.

Regards

Cedric

If you agree with my answer, please accept it by clicking on 'Accept as solution'."
Posted on June 14, 2018 at 15:07

Hi Cedric,

  Thanks for the information.

  Regarding code/project generation for IAR by CubeMX4.26.0 , MCSDK 5.1.0 was fine but MCSDK 5.1.1 has issue.  I don't remember the details at this moment but it should be easy and straightforward to reproduce. 

  In case you find difficult to reproduce, let me know. I'm be in pleasure to help.

Regards,

-Andy

Laurent Ca...
Lead II

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