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.
