cancel
Showing results for 
Search instead for 
Did you mean: 

Errors compiling with STMCubeIDE likely because module libraries aren't included. How do you include missing libraries? Or could it be something else?

DCyr
Associate III

We generate the firmware code using the Motor Control Workbench that calls the STMCubeMX that then calls the STMCubeIDE. We were able to successfully compile the firmware this way using the IAR IDE, but we get many compiler errors with the STMCubeIDE. An example of the errors is:

../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_timebase_rtc_alarm_template.c:98:1: error: unknown type name 'RTC_HandleTypeDef'; did you mean 'I2C_HandleTypeDef' RTC_HandleTypeDef    hRTC_Handle;

52 REPLIES 52
cedric H
ST Employee

Hello David,

> Any idea why the GUI won't connect to the 1V1 after flashing it with the IDE?

If you are able to profile your motor with this board, your hardware setup is obviously OK.

If you started from the example, I do not see a obvious reason that could explain your issue.

There is few things you can check in order to debug your UART issue.

  • Check that the UART is properly enabled in the User Interface box.
  • Check that the UART is well configured in th Digital I/O box

If both are OK, you need to dive into the code.

First thing you can do is to put a break point on USART_IRQHandler from the file stm32_F3XX_mc_it.c

It should break as soon as you try to connect with your PC. If it is not the case, you need to check why. Possible root cause are :

  • USART interrupt not enable at NVIC level.
  • USART RX interrupt not enable at USART level ( RX UART is first enable by UI_TaskInit calling from MX_MotorControl_Init )
  • USART is not correclty configured (IP number or Pins)

> 2.     Related to this suggested user code for “stm32f0xx_mc_it.c�?, there is no /* USER CODE END START_STOP_BTN */ i

This is because the button is not selected in the User interface

> Does the firmware for the STEVAL-ESC001V1 with a STM32F303 use high frequency injection?

From the 5.X we do not support frequency injection anymore. This feature has been removed because very few motors were able to support this feature.

STEVAL-SPIN3201

Speed feedback issue comes from the fact that the observer did not converge at the end of the rev-up phase.

The criteria for observer convergence is the variance and the speed. The idea is to start the motor in openloop up to the required speed that allow the observer to converge. This is configured in the startup parameters. If you have a working setup for the same motor with another board, try to replicate the same startup parameters. you can also try to increase the variance threshold in speed sensing window.

Regards

Cedric

Hi Cedric

Thanks for the suggestions, but I am afraid I am not familiar enough with the internals of the MC system to be able to understand how to implement your suggestions.

"Check that the UART is properly enabled in the User Interface box." I made no changes to these parameters for the sample, so it's as delivered. Does it seem correct to you?

0690X00000AtGMmQAN.jpg

"Check that the UART is well configured in the Digital I/O box". I made no changes to these parameters for the sample, so it's as delivered. Does it seem correct to you?

0690X00000AtGMwQAN.jpg

"...put a break point on USART_IRQHandler from the file stm32_F3XX_mc_it.c" I don't know how to do this. Question: Should I put messages in the user exits of USART_IRQHandler within stm32f30x_mc_it.c? If so, using the GUI, how can a message be sent to the user?

"Possible root cause are :

* USART interrupt not enable at NVIC level.

* USART RX interrupt not enable at USART level ( RX UART is first enable by UI_TaskInit calling from MX_MotorControl_Init )

* USART is not correctly configured (IP number or Pins)"

This level of debugging is beyond my skill level given the complexity of the code. I would have thought the generated code would be tested and debugged so the user wouldn't have to perform the debugging. Is there any way to send you the generated code so you can run a test?

"...the button is not selected in the User interface" There is no button on the STEVAL-ESC001V1, but that wasn't the issue. The suggested code to drive the motor with a PWM signal required inserting some code (from the user manual) inside the user exit (BEGIN & END statements) but there is already code there and no END statement. So it is not obvious how to insert this code.

The thing is; this worked OK with the IAR IDE, but I can't get the same result with the STM32CudeIDE.

Thanks!

David Cyr

Hi Cedric,

"STEVAL-ESC002V1: This board is 6steps only and not supported by the MCSDK. I will inform the responsible team to support cubeIDE." Any feedback from the responsible team as to if and when the MCSDK will support the STEVAL-ESC002V1?

STSPIN3201: Still cannot get the STSPIN3201 past the start-up error. I have tried all the suggestions in the FAQs. The motor ramps up well to the final speed of 3000 RPM and stops dead. The BullRunning sample does not compile clean with the following error:

C:/Users/david/STM32CubeIDE/workspace_1.1.0/SPIN3201/SDK5x - STEVAL-SPIN3201 - BullRunning/Src/main.c:28:10: fatal error: mc_extended_api.h: No such file or directory   #include "mc_extended_api.h"

Custom code for the 3201 does compile cleanly, which is what I am using.

STEVAL-ESC001V1: Still can’t connect the GUI to the board. Is it possible there is a bug in the generated code that is preventing a connection unless the profiler has connected first? It worked OK with the IAR IDE.

Given there are several STM choices for driving a sensorless BLDC motor, which family is strategic for STM, and which should we try to use for a 500 to 8000 RPM motor that has to change speed quickly.  Motor characteristics from the ST Motor Profiler: Rs=0.1, Ls=0.2mH, V/krpm=0.7V, Friction 17microN.ms, Inertia= 1microN.ms, Imax=15A, Vbus=14V.

Thanks,

David Cyr

DMolo
Senior

Also interested in which family is strategic. My project uses the f303cb, in a completely custom setup. I finally won the battle with the mcwb, though still​ use importing a true studio project and update the parameters by having a parallel project and using GIT diffs... 

Pretty much a month after I spun the first pcb, st announced the​ g431 which looks better in every way, but being new... I'm not convinced it's stable yet... Apparently opamp silicon errors?

Generally I'm pretty pleased with the f303cb. I've got it on native usb, serial to another WiFi chip, i2c to another widget, scr control on another timer... ​my motor drive is pushing roughly 60w at 20v with 6x0.1gbp FETs, cold as ice. Using the internal opamps and comparators. Gate drives can be had for 25p each, need 3 so no great cost advantage to using the integrated stspin.

​It's been a real struggle with the st software, for me very similar reasons to you, but I think I'm happy with the end result.

AntoineC
ST Employee

​Hello David,

For the STEVAL-ESC001V1 issue, in STM32CubeIDE, you have to build your project in Release mode. 

There is, as the image below, a contextual menu allowing you to choose between Debug or Release mode.

The correct optimization level is set in Release mode (Optimize for speed).

This menu is accessible through the little arrow at the right of the hammer.

0690X00000As4KmQAJ.png

Regards

Antoine

DCyr
Associate III

Hi Antoine,

This is not my issue currently. I always use "Release" because the generated code doesn't fit inside the available memory on some evaluation boards. My current issues are listed in my most recent post of 4 days ago. Hopefully you can help with those issues.

Thanks! David Cyr

Laurent Ca...
Lead II

The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 MC SDK). 

Best regards

shorai
Associate III

I'm getting these errors on both the Legacy and Y versions installed yesterday (5 July 2021)

Seems this is a long standing problem and is overdue fro a fix.

The .inc directories are vivible to the project, so most likely there is a filter in cube/mx that filters out *_LL_*.inc files.

I can't see where this is cause the HAL_*.incs n the same directories are visible

This is something I really LOVE about Eclipse based C environments - information hiding at the extreme

Can someone at ST please set up regression testing and automated testing as is commonplace in the industry fro the past 20 years.

Thanks

DCyr
Associate III

"The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 MC SDK). " Firstly, I don't know what you are trying to say! Secondly, the problem(s) we were having with your software AND HARDWARE are now ancient history. To be responding to a query 2 years later is rather sad. We have moved on to another supplier, since ST hardware and software don't work! Pathetic...

There are a LOT of missing libraries - they are not being copied or linked properly in the CUBE project.