2024-06-07 05:42 AM
Hello,
I am experiencing an issue with the Motor Profiler in MotorControl Workbench 6.3.0. When I enable the Hall Effect in the generated source code, the program triggers the HardFault_Handler during execution.
Here are the details of my setup:
The following configurations work fine with this setup:
However, when running the Motor Profiler with Hall Effect ON, the debugger shows that the HardFault_Handler is called within the FOC_Init() function, specifically at the HT_Init(&HT, false) call. The error message is:
Can't find a source file at "C:\Motor_Control\MC_Releases\6.3.0\MotorProfilerLibs\Projects\NUCLEO-G431RB-X-NUCLEO-IHM07M1-3Sh\MotorControlDev\MCSDK\MCLib\Any\Src\mp_hall_tuning.c"
Locate the file or edit the source lookup path to include its location.
Please note that since MotorControl Workbench 6.3.0 is installed in its default location, the folder "C:\Motor_Control" does not exist.
I have also set up the same tool configuration on a new PC where MotorControl Workbench 6.3.0 was not previously installed, but I encounter the same error.
Could anyone provide guidance on what might be causing this issue and how to resolve it?
Thank you in advance for your support.
inaba
Solved! Go to Solution.
2024-06-09 06:44 PM
Although the cause is unclear, the issue we wanted to address has been resolved. By setting the Target Toolchain to IAR EWARM V8, Motor Pilot is now functioning without any problems.
2024-06-09 06:44 PM
Although the cause is unclear, the issue we wanted to address has been resolved. By setting the Target Toolchain to IAR EWARM V8, Motor Pilot is now functioning without any problems.
2024-06-10 02:55 AM
Hello @Inaba,
Thank you for this problem report.
A ticket has been entered on our side and we will come back to you shortly once we know more about it.
2024-06-17 02:09 AM - edited 2024-06-20 09:45 AM
Hi, sorry for the inconvenient faced with the Motor Profiler binary. We have a workaround that allows to use STM32CubeIde with this binary without a Hard Fault. The workaround consists of initializing a pointer pMCIList[M1] = &Mci[M1]; just before the call of the function FOC_Init(); into the function MCboot() embedded into the file mc_tasks.c file.
You will find below part of the MCboot function with the correction:
__weak void MCboot( MCI_Handle_t* pMCIList[NBR_OF_MOTORS] )
{
/* USER CODE BEGIN MCboot 0 */
/* USER CODE END MCboot 0 */
if (MC_NULL == pMCIList)
{
/* Nothing to do */
}
else
{
bMCBootCompleted = (uint8_t )0;
/*************************************************/
/* FOC initialization */
/*************************************************/
pMCIList[M1] = &Mci[M1];
FOC_Init();
.....
Hope this will help you.
Fabrice