Skip to main content
DCyr
Associate III
October 3, 2019
Question

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

  • October 3, 2019
  • 33 replies
  • 14802 views

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;

This topic has been closed for replies.

33 replies

DCyr
DCyrAuthor
Associate III
November 15, 2019

Duplicate entry deleted.

cedric H
Technical Moderator
November 15, 2019

​Hello David,

If you look at the image below, you will see a contextual menu allowing you to choose between Debug or Release mode.

The correct optimization level is set in Release mode.

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

Let me know if it fixes your issue.

Regards

Cedric

0690X00000As4KmQAJ.png

DCyr
DCyrAuthor
Associate III
November 25, 2019

Duplicate entry deleted.

cedric H
Technical Moderator
November 29, 2019

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

DCyr
DCyrAuthor
Associate III
December 3, 2019

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

DMolo
Associate III
December 9, 2019

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
December 13, 2019

​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
DCyrAuthor
Associate III
December 13, 2019

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...
Senior III
June 22, 2021

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
July 6, 2021

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

shorai
Associate III
July 6, 2021

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

DCyr
DCyrAuthor
Associate III
July 6, 2021

"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...

shorai
Associate III
July 7, 2021

Hi DCyr

Thanks for your answer.

What I am trying to say (and for a lot of other topics in STM) is .... ST have not fixed this bug which is now apparently 2 years old!!!

No, the problem is 'new' to me. Previously (several years ago) I used the ST libs when they were new. They worked with these boards.

Now they are broken.

I just want to spin a BLDC for a prospective client - I'll probably do that in FORTH in a few minutes

They probably work flawlessly on the expensive non-ST tools

Pathetic - yes

Will I move on? - Yes You and DMolo point me to the same recommended path.

Thansk for tthe heads up.