cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 HAL_EXTI_SetConfigLine() causes the Hard Fault

Takemasa
Associate III

STM32F7 HAL_EXTI_SetConfigLine() causes a Hard Fault whenever the parameter is one from the HAL_EXTI_GetConfigLine().

  • CubeIDE 1.2.1
  • STM32Cube FW_F7 V1.15.0
  • Nucleo F746

Following is the sample of the sequence. This code retrieve the EXTI configuration of the B1 ( User button ), clear the configuration, and then, set the configuration again.

hexti_b1.Line = EXTI_LINE_13;
    HAL_EXTI_GetConfigLine(
                           &hexti_b1,
                           &hexti_b1_config
                           );
    HAL_EXTI_ClearConfigLine(&hexti_b1);
    HAL_EXTI_SetConfigLine(&hexti_b1, &hexti_b1_config);

In the API called line 7, a hard fault happen. I saw the source of the HAL_EXTI. It seems the pointer operation bug.

The attached nucleo-f746-exit is a demonstration code. If you run it, you will see the hard fault happen.

The other nucleo-g431 is for comparison. It runs on the Nucleo-G431 (64). It just work.

0 REPLIES 0