2025-07-04 3:57 AM
Hello ST Community,
I am currently using the EVSPIN32F0251S1 inverter board to control a BLDC motor in an elevator door control application.
For this use case, I need to obtain precise motor rotation counts using Hall sensor feedback. While working on this, I found that the ST Motor Control Workbench does not provide a direct method or setting to access Hall sensor counts. To work around this, I manually modified the hall_speed_pos_fdbk.c and hall_speed_pos_fdbk.h files and was able to retrieve counts using HALL_M1.RevolutionCounter. However, whenever I regenerate the project through Motor Control Workbench, all these custom changes are lost. (i get reference from this post: bldc-motor-with-hall-sensor-keep-track-of-number-of-revolutions).
Could you please advise on the recommended method to implement and retain Hall sensor count functionality, especially in a way that is compatible with project regeneration from Motor Control Workbench and STM32CubeMX? Any guidance or best practices would be greatly appreciated.
Thank you in advance for your support.
Best regards,
Vedant Kachhadiya
Solved! Go to Solution.
2025-07-06 11:26 PM - edited 2025-07-06 11:27 PM
Hello @Vedant07,
MCSDK functions are defined with a __weak attribute, then you are free to redefine these functions (with no attribute and with your custom changes) on a separated file and add it in the generated project. Your defined functions will be the used ones.
2025-07-06 11:26 PM - edited 2025-07-06 11:27 PM
Hello @Vedant07,
MCSDK functions are defined with a __weak attribute, then you are free to redefine these functions (with no attribute and with your custom changes) on a separated file and add it in the generated project. Your defined functions will be the used ones.