2025-01-09 08:08 AM
Hello everyone,
I have an existing project on the STM32H753VIT6 and I need to add three-phase motor control (FOC mode) via STDRIVE101 driver. The question is whether my approach to importing the MCSDK into my project is correct.
Due there is no support for my MCU in MC Workbench, I choose NUCLEO-H745ZI-Q and generate a project for it. (also I choose A2212 13T motor and X-NUCLEO-IHM09M1 bridge).
As far as I understand, STM32CubeIDE desn't have possibility to automatically import the configuration from H745 to H753 (?). Therefore, I need to configure the MCU myself via CubeMX, or transfer partially the contents of the .ioc file of the generated H745 project to my one (however it is not recommended to change this file).
But look like in order for "Motor Control" to appear in "Middleware and Software Packs" in "Pinout & Configuration" in any case, it is necessary to edit the .ioc file and add following:
ExtraMW=MotorControl
ExtraMW.MotorControl.Config=MotorControl
ExtraMW.MotorControl.Mode=MotorControl
ExtraMW.MotorControl.Root=MCSDK_v6.3.2-Full/MotorControl
ExtraMW.MotorControl.Template=templates
The question is whether it is necessary to have "Motor Control" in "Middleware and Software Packs"? Maybe it's enough to just transfer all the necessary files from Workbench generated project?
I opted out of adding this these lines, as it seems to create additional redundant files in the project. As a result, after transferring the configuration and files, I got the following error:
Which I fixed by adding the following code (found in the example) to the "mc_config.c" file:
ESC_Handle_t ESC_M1 =
{
.pESC_params = &ESC_ParamsM1,
};
But as a result, I got an error in the file "profiler_dcac.c": fatal error: profiler_dcac.h: No such file or directory.
This file does not exist in the generated project or in the SDK.
Please help me understand what is the best direction to go for importing MCSDK into STM32H753 and what I am doing wrong.