2019-01-07 06:52 AM
Dears
I'm using board "STEVAL SPIN3202" to drive a BLDC Motor. To program the microcontroller , I'm using STM32 Motor Control Workbench software. The mode of driving is sure FOC since I'm using this software. The problem, However, happens when I activate the "Hall sensors" for speed sensing. The problem doesn't happen when I'm generating the code in this software. The problem happens when I'm compiling the generated code in the IAR. When compiling, the next error message shows up:
Error[Pe020]: identifier "M1_HALL_H1_GPIO_Port" is undefined
Error[Pe020]: identifier "M1_HALL_H1_Pin" is undefined
Error[Pe020]: identifier "M1_HALL_H2_GPIO_Port" is undefined
Error[Pe020]: identifier "M1_HALL_H2_Pin" is undefined
Error[Pe020]: identifier "M1_HALL_H3_GPIO_Port" is undefined
Error[Pe020]: identifier "M1_HALL_H3_Pin" is undefined
I believe that the MC workbench doesn't define the values for theses "Variables".
Could you please provide a solution for this problem ? How could I define the value of these variables ?
Best regards
Amr
2019-01-07 07:11 AM
Not expert here, however, when a BLDC is sensored, 3 additional (timer?) pins are required.
I guess the 3 pins (Pin and Port) must be defined in a header file or as a compile option.
Better look into a functional example of sensored motor and grep (find in file) these define names to find out what is missing and where it should be defined.
2019-01-08 01:07 PM
Thanks for the help ! This solution did not work. I've managed to solve the problem by creating the project one more time and generate it with Hall sensors in the first time. The problem was happening because when you generate the code without hall sensors and then generate it again with hall sensors. The reason is that if you generate the code one time without hall sensors, the generator deletes the h files for the hall sensors.
2021-01-06 01:06 PM
Thanks for digging into this when you did. I'm seeing the same problem in MC WB 5.4.4.20160., for what it's worth. Now, off to figure out how to get it to generate that file by "starting over". :\