2021-01-08 4:33 PM
Often I find that MCSDK does not have the exact MCU I need to use so I need to end up modifying the CubeMx *.ico file generated from MCSDK.
In trying to determine the relationship of these files I took an existing working project and renamed the *.stmx file to *.stmx_____. I then loaded the *.ico file with CubeMx with no complaints. Next I deleted the drive_parameters.h file then had CubeMx generate new code. The result was a new drive_parameters.h file was generated.
Where does the information for this new drive_parameters.h file come from? There was no old drive_parmeters.h file and the *.stmx file was not present.
I ask this because sometimes when rebuilding my project I find all my drive_parameters.h values have changed and I need to copy the file over from an archived project.
Thanks for any insight you can give on this. A secret decoder ring would be appreciated from ST ;)
Brian
Solved! Go to Solution.
2021-01-11 7:53 AM
Hello Brian,
Once the CubeMX file .ioc is generated, it has in the middleware section a part called MotorControl, which contains all the information about the FOC algorithm, among which the "previous" drive_parameters.h file.
Modifying the CubeMX file can lead to some error, so I suggest to always generate the project starting from the Workbench (.stmcx file) .
Further modifications can be added directly to the code in the dedicated parts indicated between comments:
/* USER CODE BEGIN ... */
/* USER CODE END... */
Code inside these comments is kept when the project is generated again and not overwritten by the new code generation.
I hope this can help you in your project.
2021-01-11 7:53 AM
Hello Brian,
Once the CubeMX file .ioc is generated, it has in the middleware section a part called MotorControl, which contains all the information about the FOC algorithm, among which the "previous" drive_parameters.h file.
Modifying the CubeMX file can lead to some error, so I suggest to always generate the project starting from the Workbench (.stmcx file) .
Further modifications can be added directly to the code in the dedicated parts indicated between comments:
/* USER CODE BEGIN ... */
/* USER CODE END... */
Code inside these comments is kept when the project is generated again and not overwritten by the new code generation.
I hope this can help you in your project.
2021-06-01 1:45 AM
The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 SDK).
Best regards
Laurent Ca...
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.