STSPIN32G4 Error in generated code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-02 4:16 AM
Hello,
I am using the STSPIN32G4 IOC file from MC Workbench for a motor control example. However, I encounter the following errors during the build process. Since these files are auto-generated, I can't directly fix them by declaring the missing elements
Error: C:/MCB Example/MtrCtrlMdlGen/temp/stm32g431rb_ihm16m1/Drivers/STM32G4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:1007:47: error: 'OPAMP_POWERMODE_NORMALSPEED' undeclared (first use in this function); did you mean 'LL_OPAMP_POWERMODE_NORMALSPEED'? 1007 | #define OPAMP_POWERMODE_NORMAL OPAMP_POWERMODE_NORMALSPEED | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Solved! Go to Solution.
- Labels:
-
MC Workbench
-
STM32 Motor Control
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 2:38 AM
Hello @AsimAsrar
Thanks for your inputs.
The issue you reported is known and already described in the release notes.
In the section known limitations you can find the following statement:
- When generating a configuration based on an STM32G4xx series MCU and using internal OPAMPs with STM32CubeMx version 6.10.0, make sure to select HAL and not LL for the Drive Type in the Workbench.
I did a quick test with STM32CubeMX 6.11 and it seems that now it is fixed.
Regards
Cedric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-02 6:44 AM
Hello @AsimAsrar,
Your issue probably comes from a misalignment between the HAL version and your cubeMX version.
Could you please give the version of the tools you are using : MCSDK, CUBEMX, Cube package (HAL)
Thanks
Cedric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-02 8:49 AM
Hello Cedric, Below are the details.
CUBEMX Version: 6.10.0
Motor Control WorkBench: 6.3.0
While generating the IOC file I am selecting LL and not HAL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-02 9:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 2:38 AM
Hello @AsimAsrar
Thanks for your inputs.
The issue you reported is known and already described in the release notes.
In the section known limitations you can find the following statement:
- When generating a configuration based on an STM32G4xx series MCU and using internal OPAMPs with STM32CubeMx version 6.10.0, make sure to select HAL and not LL for the Drive Type in the Workbench.
I did a quick test with STM32CubeMX 6.11 and it seems that now it is fixed.
Regards
Cedric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 6:37 AM
Hello,
Thank you for your suggestion. Setting the OPAMP to HAL did resolve the opamp error. However, I am still encountering an error related to 'TIM'. When I configure it as HAL, I receive the following error:
Note: I had to change few peripherals to LL as I was getting the above error for them as well.
Alternatively, when I set it to LL, I get this error:
Could you please advise on how to resolve this issue?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 7:04 AM
Hi,
Your attached IOC is not the one generated by the motor control workbench, so no chance that the project built from it can contain the Motor control FW lib (which contain the declaration of the missing constants, plus obviously all the motor control FW algorithm).
Regards
Cedric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 10:54 AM
Hello,
It's the same IOC file, but I made a few modifications for my example. I disabled the motor control, adjusted some parameters of ADC2, and added LPUART.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-04 3:05 AM
I had to change few parameters of TIM, and it's working now. Thank You.
