Skip to main content
RGmün.1
Associate II
Apr 21, 2022 2:55 PM UTC
Solved

(Solved) STM32G0B1CCU6 runs into hard fault after activating EXTI3 interrupt

Hello

The STM32G0B1CCU6 running into a hard fault caused by SPI2.

After activating EXTI3 at the Pin PB3 (as interrupt) the controller is running into a hard fault. We think, that the hard falut is comming from the SPI-line because the MISO-pin is on the same EXTI-Line!?

Note: MISO Pin at SPI2 uses the same EXTI3 - Line.

Question:

Why runs the controller into the hard fault? Is it, becuase the MISO-Pin is not defined?

Is there any restriction about the EXTI3 - Line and using SPI2?

Is there any workaround for this issue?

thanks

Roland

This topic has been closed for replies.
RGmün.1
RGmün.1Best answer
Associate II
Apr 22, 2022 12:58 PM UTC

Hello Jan

thanks for your fast answer.

After updating the IDE to the latest version and regeneration from the ioc-file the application will now run without any hard fault.

May this issue caused about wrong/different IDE/CubeMX versions.

Thanks

Roland

2 replies

waclawek.jan
Super User
Apr 21, 2022 3:07 PM UTC

Hardfault does not result from hardware, but from bug in program.

Debug as usually: in the hardfault handler, look at the stacked PC (perhaps using debugger) and content of all core registers, then in disasm (or better mixed C/disasm) walk back a couple of instructions from this address and look at the potentially offending instruction.

JW

RGmün.1
RGmün.1AuthorBest answer
Associate II
Apr 22, 2022 12:58 PM UTC

Hello Jan

thanks for your fast answer.

After updating the IDE to the latest version and regeneration from the ioc-file the application will now run without any hard fault.

May this issue caused about wrong/different IDE/CubeMX versions.

Thanks

Roland