cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve errors from compiling example code of 6step Steval 3204?

Tahi.1
Associate II

I have been trying to compile the example program "6-Steps speed regulation using the STEVAL-SPIN3204 inverter board" from Motor control workbench.

I have made no changes to the example and following instructions from the text file as it is:

0693W00000SwLsRQAV.pngThe project is generated successfully:

0693W00000SwLtoQAF.pngThen I make a new project in STM IDE with the ioc file as follows:

0693W00000SwLuNQAV.pngWhen I try to build the project, I get the following errors:

0693W00000SwLvpQAF.png 

Can somebody please help, where am I making a mistake?

P.S. This is my first time using STM.

1 ACCEPTED SOLUTION

Accepted Solutions
Fred V.
ST Employee

Hello again,

I think you came across an issue in the MCSDK 4.8 which I have not qualified yet. It is going to take some time to identify the issue. I'm sorry.

However, I may have alternatives for you. If you are not stuck into using MCSDK 5.4.8, maybe can you switch to using MCSDK 5.Y.4 or even MCSDK 6.0.0, both of which are available for free from st.com (https://www.st.com/en/embedded-software/x-cube-mcsdk.html).

Trying with MCSDK 5.Y.4 will provide you with an experience close to 5.4.8 in terms of tooling with the Workbench. With this version, you have two examples that target 6-Step motor drive with the STEVAL3204 inverter board:

  • Six-Step Sensorless and Voltage Mode on a STEVAL-SPIN3204+Shinano LA052-080
  • Six-Step Hall Sensor and Voltage Mode on a STEVAL-SPIN3204+Shinano LA052-080

Both are similar except that one is sensorless (the first one) while the other one relies on Hall sensors for speed and position sensing. I checked the first one which built well in the configuration that you described: STM32CubeMx 6.6.1, the (currently) latest FW version 1.11.3. My assumption is also that you use the latest STM32CubeIDE version (1.10.1).

Please, feel free to tell me if this configuration suits your needs at the moment. Note that the one you tried from MCSDK 5.4.8 is very similar to that one.

Another option for you would be to try MCSDK 6.0.0 in which Six Step is no longer provided as a set of examples but rather as a first class citizen into the MCSDK that you can configure more to your needs (especially in terms of motor parameters). The workbench interface has been fully reworked and it is the path MCSDK is taking for future releases.

Now, the way you open the project in STM32CubeIDE is not what I would advise, but the thing is that with 5.4.8, it seems that the project is incorrectly produced.

With 5.Y.4, you would open STM32CubeIDE and go to "File" --> "Open project from file system".

Then, you would navigate to the folder where the project has been generated and use it as the base folder for the project.

STM32CubeIDE will prompt you with two possible project. The one to choose is the the one that mentions `STM32CubeIDE` in its name. For some reason, 5.4.8 does not generate such a possibility. This is part of the issue you unveiled (thanks to you).

Then, you should have a working (at least a building) project.

Please, let me know how this is going on for your project. Whether the proposal I suits you or not, I would be very glad to know. Anyway, we'll work on the issue with MCSDK 5.4.8, but I cannot set any date for a version fixing it...

Best Regards,

Fred

View solution in original post

9 REPLIES 9
Fred V.
ST Employee

Hello,

I cannot find an example with that name in neither MCSDK 5.Y.4 nor in 5.4.8. What version of the SDK do you use? What is the exact name of the example you are trying to setup?

Thanks a lot.

Best Regards,

Fre

Start by checking the include paths and the presence of the one file it ​complains about. If not copied into the project, check the source directories of the package and copy manually.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Tahi.1
Associate II

@Fred V.​ 

I am using motor control workbench 5.4.8 and the name of the example is "Six Step drive with STSPIN3204"

0693W00000UFVhkQAH.png

Tahi.1
Associate II

Now I was getting these errors:

0693W00000UFVjvQAH.pngI added the new path this way:

0693W00000UFVlDQAX.pngThen, I got the following errors:

0693W00000UFVpoQAH.pngI changed the optimization level of the code:

0693W00000UFVqhQAH.pngNow, I am stuck on these errors:

0693W00000UFVs4QAH.pngThese errors are coming from the following file on lines 48, 49, 50:

0693W00000UFWBGQA5.pngAnd these functions are properly defined in "steval-spin3204.h". This header file and associated .c file is present in the path and also I couldn't find any duplications of these functions. What could be the error?

0693W00000UFWD2QAP.png

Fred V.
ST Employee

OK,

Thanks for all the information. I'm going to give it a try and I'll tell you.

BR

Fred

Thank you very much

Fred V.
ST Employee

Hello again,

I think you came across an issue in the MCSDK 4.8 which I have not qualified yet. It is going to take some time to identify the issue. I'm sorry.

However, I may have alternatives for you. If you are not stuck into using MCSDK 5.4.8, maybe can you switch to using MCSDK 5.Y.4 or even MCSDK 6.0.0, both of which are available for free from st.com (https://www.st.com/en/embedded-software/x-cube-mcsdk.html).

Trying with MCSDK 5.Y.4 will provide you with an experience close to 5.4.8 in terms of tooling with the Workbench. With this version, you have two examples that target 6-Step motor drive with the STEVAL3204 inverter board:

  • Six-Step Sensorless and Voltage Mode on a STEVAL-SPIN3204+Shinano LA052-080
  • Six-Step Hall Sensor and Voltage Mode on a STEVAL-SPIN3204+Shinano LA052-080

Both are similar except that one is sensorless (the first one) while the other one relies on Hall sensors for speed and position sensing. I checked the first one which built well in the configuration that you described: STM32CubeMx 6.6.1, the (currently) latest FW version 1.11.3. My assumption is also that you use the latest STM32CubeIDE version (1.10.1).

Please, feel free to tell me if this configuration suits your needs at the moment. Note that the one you tried from MCSDK 5.4.8 is very similar to that one.

Another option for you would be to try MCSDK 6.0.0 in which Six Step is no longer provided as a set of examples but rather as a first class citizen into the MCSDK that you can configure more to your needs (especially in terms of motor parameters). The workbench interface has been fully reworked and it is the path MCSDK is taking for future releases.

Now, the way you open the project in STM32CubeIDE is not what I would advise, but the thing is that with 5.4.8, it seems that the project is incorrectly produced.

With 5.Y.4, you would open STM32CubeIDE and go to "File" --> "Open project from file system".

Then, you would navigate to the folder where the project has been generated and use it as the base folder for the project.

STM32CubeIDE will prompt you with two possible project. The one to choose is the the one that mentions `STM32CubeIDE` in its name. For some reason, 5.4.8 does not generate such a possibility. This is part of the issue you unveiled (thanks to you).

Then, you should have a working (at least a building) project.

Please, let me know how this is going on for your project. Whether the proposal I suits you or not, I would be very glad to know. Anyway, we'll work on the issue with MCSDK 5.4.8, but I cannot set any date for a version fixing it...

Best Regards,

Fred

Tahi.1
Associate II

HI @Fred V.​ , thank you for the reply.

I have shifted to motor control workbench 5.Y.4 and yes, the project built without errors. But then I was unable to connect the board with motor pilot with the error "Port open and try to configure the motor". Based on this post and the provided code in it, the board connected. However I still see some errors, as missing GUI parts and cant select control mode:

0693W00000UnD5CQAV.png Errors in terminal of Motor Pilot:

0693W00000UnD5bQAF.pngApart from these errors, the program worked with the hardware user buttons and thanks I was able to run some small BLDC motors.

For my main application, I have a 10 pole pair BLDC motor. Since, motor profiler cant work with this board, I manually changed the motor electrical parameters in the example project. But they don't seem to take effect and the motor doesn't run.

I have the following questions:

Can I change the motor parameters in the example project or do I need to make a new project for a different kind of motor? In the example project, there is also no option for the start up parameters.

If I start a new project, will FOC be the default control method implemented?

Just in your opinion, Is it possible to have "position control" with STEVAL3202, a bldc motor and installing hall sensors?

Thank you again.

Fred V.
ST Employee

Hello,

Indeed, 115200 bps on the UART link is a max at the moment with devices such as STSPINF0 and other STM32F0/G0 based MCUs. Hopefully, this may change in the future. The missing GUI parts syndrome seems linked with the errors you see in the Terminal tab: unknown registers resulting from the six-step firmware not supporting all the registers used in the FOC UI would results in making related UI widgets disappear. No more than an intuition here, we'll have to investigate this issue.

Appart from that, the UI screenshot you attached in your post does not show the Six-Step GUI application. That most certainly explains part of your problem. The Motor Pilot tool provides several GUI application tailored to specific situation (see here). At installation time, the pilot defaults to opening the FOC GUI. Since you are using a Six-Step application, you should opt for the Six-Step GUI application. To do so, disconnect from the board and select the GUI --> Load GUI menu item.

0693W00000UnKv5QAF.pngThis pops a file open dialog. Use it to navigate to the place where your MC SDK installation sits and head for the the <code>Utilities\PC_Software\STMotorPilot\GUI</code> folder. There you'll find a defaultApp_6STEP.qml file that you can open.

0693W00000UnKvZQAV.pngThen, you can connect to the board again. The UI should work well now. If that is not the case, please, let us know.

About your questions:

  • If I start a new project, will FOC be the default control method implemented? Yes, with MCSDK 5.*.*, a new project will use FOC as the default (and only) control method. If you prefer creating Six-Step projects from the start, use MCSDK 6 that promoted the Six-Step control technique to full citizenship. Then, you'll be able to configure your Six-Step application with the same flexibility as the FOC ones.
  • Position Control with with STEVAL3202: Well. From a theory point of view (STSIPN32F0 MIPS, RAM, Flash, ...), I do not see any reason why this could not be achieved. Now, if you plan to use the position control feature delivered with MCSDK, then I think it is going to be a little hard. The main point here is that the position control specific code is heavily using floating point computations that ARM Cortex M0 based devices like the STM32F0 MCUs on which the STPIN32F0 is based do not natively support. In addition, I doubt that the Workbench will let Position Control projects be produced for other MCUs than STM32F3.
  • Changing the motor parameters in the example project. Sure, you can. However, you cannot do it from the Motor Control Workbench (with versions 5.4.8 and version 5.Y.4). You need to open STM32CubeMx and open the IOC file delivered with the example. To do so:
    • Open STM32CubeMx and select the File --> Load Project menu item.
    • Navigate to the place where you saved the example. Next to the example *.stmcx file, you can find a folder with the same name. In this folder, you'll find a file named 6S_STEVAL3204_SL_VM.ioc, that you can open:

0693W00000UnLOHQA3.png

  • Once it is loaded, expand the Middleware section in the left pane (Categories tab) and click on "MotorControl". A pannel is open in the UI that displays the parameters of the MotorControl middleware:

0693W00000UnLOWQA3.pngYou can modify these parameters, save the project back and generate the code by clicking on "GENERATE CODE". If you browse these parameters, you'll see the following motor parameter ones:

  • POLE_PAIR_NUM
    • LS
    • RS
    • MOTOR_VOLTAGE_CONSTANT

Some more information is available here about the modification of these parameters:

https://wiki.st.com/stm32mcu/wiki/STM32MotorControl:6-step_Firmware_Examples_User_Manual

I hope it'll help. Please, let us know how things will work.

Best Regards,

Fred