Skip to main content
dc2ac
Associate II
October 1, 2023
Question

Problem compiling code generated by MC workbench and CubeMX.

  • October 1, 2023
  • 2 replies
  • 4788 views

I am using STM32CubeIDE 1.12.1 and MC Workbench 6.20 to generate the profiler firmware to run with the Motor Profiler software. I am running into two problems.

The first one: If I use the P-NUCLEO_IHM003 kit in the Example Projects to generate the code, I don't have this problem. If I create a new project by selecting the motor and the power board (same as the example) to generate the code, I get this error with the static function "R3_1_RLGetPhaseCurrents()".

In file included from ../../Inc/mc_config.h:40,
from ../../Inc/motorcontrol.h:25,
from C:/Users/dc2ac/.st_workbench/projects/motor-profiler/Src/mc_interface.c:28:
../../MCSDK_v6.2.0-Full/MotorControl/MCSDK/MCLib/G4xx/Inc/r3_1_g4xx_pwm_curr_fdbk.h:263:13: warning: 'R3_1_RLGetPhaseCurrents' declared 'static' but never defined [-Wunused-function]
263 | static void R3_1_RLGetPhaseCurrents(PWMC_Handle_t *pHdl, ab_t *pStator_Currents);
| ^~~~~~~~~~~~~~~~~~~~~~~

The second problem is when I included the motor profiler checkbox in the application configuration tab, I got compile errors. If I don't check the box, it compiles normally. When the box is checked, it includes the "libmp-IAR_ARMv7-M.a" file. When linking, there are multiple errors related to "warning: 'R3_1_RLGetPhaseCurrents' declared 'static' but never defined".

Help is appreciated.

 

This topic has been closed for replies.

2 replies

dc2ac
dc2acAuthor
Associate II
October 1, 2023

Sorry for the quick copy and paste in the last post. The second problem is related to the error "unknown mandatory EABI object attribute 50" when linking the "libmp-IAR_ARMv7-M.a" file.

cedric h1
Visitor II
October 1, 2023

Hello @dc2ac ,

The first point is a warning that does not affect the compilation.

The second point is due the compiler version. Please update your cubeIDE to version 1.13.2.

Regards

Cedric

If you agree with my answer, please accept it by clicking on 'Accept as solution'."

dc2ac
dc2acAuthor
Associate II
October 2, 2023

Hi Cedric,

The second point is fixed after the upgrade to 1.13.2. On the first point, any idea where the code generation is different between the example project and the new project?

Thanks for your reply.

SRedd.5
Senior III
October 2, 2023

For the first error you have not included in compilation r3_1_g4xx_pwm_curr_fdbk.c file which is important, where the definition of R3_1_RLGetPhaseCurrents function is available.