cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault_Handler Triggered When Enabling Hall Effect in Motor Profiler with MC Workbench 6.3.0

Inaba
Associate

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:

  • Tools:
    • MotorControl Workbench 6.3.0
    • STM32CubeIDE 1.15.1
    • STM32CubeMX 6.11.1
  • Hardware:
    • Control Board: NUCLEO-G474RE
    • Power Board: X-NUCLEO-IHM17M1

The following configurations work fine with this setup:

  • Motor Profiler with Hall Effect OFF
  • FOC with Main Sensor Observer+PLL
  • FOC with Main Sensor Observer+PLL and Auxiliary Sensor Hall Sensor

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Inaba
Associate

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.

View solution in original post

3 REPLIES 3
Inaba
Associate

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.

GMA
ST Employee

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.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

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