Skip to main content
Associate
February 28, 2025
Solved

STM32H743: The jump from startup to main does not occur. An unknown interrupt is repeatedly executed.

Hello.

An inexplicable bug occurs during the transition from startup_stm32h743xx.s to main, causing unnecessary functions to be repeatedly executed.

An unknown function (I2C_IsErrorOccurred) continues to be called. It is strange that it is being invoked despite no initialization being performed.

 

I believe that fixing this bug requires identifying the cause of the repeated calls to an unknown address, but I lack sufficient knowledge to do so

I need the help of someone knowledgeable.


IDE:
μVision V5.40.0.0
Toolchain: MDK Plus 5.40 : 5.40.0.3
C Compiler: ArmClang.exe V6.22
Assembler: Armasm.exe V6.22
Linker/Locator: ArmLink.exe V6.22
Library Manager: ArmAr.exe V6.22
Hex Converter: FromElf.exe V6.22
CPU DLL: SARMCM3.DLL V5.40.0.3
Dialog DLL: TCM.DLL V1.56.4.0
Target DLL: ULP2CM3.DLL V2.215.24.0
Dialog DLL: TCM.DLL V1.56.4.0

 

I haven't made any particular changes to the linker, startup, or system initialization, and I am using the default address 0x80000000.

This topic has been closed for replies.
TDK
TDKBest answer
February 28, 2025

The compiler is quite robust. It's unlikely to be doing things that are not present in the code. Similarly, the chip does not behave erratically and execute functions that it should not.

If I2C_IsErrorOccurred is called, set a breakpoint and examine the state of the chip to determine why it's called. Look at VECTACTIVE in SCB->ICSR to determine which interrupt the chip thinks it's in. Examine the registers of the relevant peripheral to determine why it's been called. I2C_IsErrorOccurred is not a direct IRQ handler, so look at the call stack to understand how it was called.

In any case we're unlikely to be able to help here unless you provide additional information on the problem. A minimal working example which exhibits the problem, or relevant screenshots and code showing the issue.

"If you feel a post has answered your question, please click ""Accept as Solution""."

5 replies

mƎALLEm
ST Technical Moderator
February 28, 2025

Hello,

What is the origin of your code? generated by CubeMx? An example from CubeH7? What is the board you are using? ST board? Custom board? if ST board which one?

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
TDK
TDKBest answer
February 28, 2025

The compiler is quite robust. It's unlikely to be doing things that are not present in the code. Similarly, the chip does not behave erratically and execute functions that it should not.

If I2C_IsErrorOccurred is called, set a breakpoint and examine the state of the chip to determine why it's called. Look at VECTACTIVE in SCB->ICSR to determine which interrupt the chip thinks it's in. Examine the registers of the relevant peripheral to determine why it's been called. I2C_IsErrorOccurred is not a direct IRQ handler, so look at the call stack to understand how it was called.

In any case we're unlikely to be able to help here unless you provide additional information on the problem. A minimal working example which exhibits the problem, or relevant screenshots and code showing the issue.

"If you feel a post has answered your question, please click ""Accept as Solution""."
taku_hatAuthor
Associate
March 3, 2025

@mƎALLEm 

@TDK 

Thank you for your response.

I would like to provide additional details first.

Our code is custom-developed and cannot be shared due to policy restrictions.
It is generated using CubeMX.
We are using the STM32H743I-EBAL2 board.


SCB->ICSR, its value was 0x00000803,it indicates a hard fault.

I will attempt to create an environment with a minimal setup to reproduce the same issue...

taku_hatAuthor
Associate
March 3, 2025

I will provide a screenshot of the SCB->ICSR register and xPSR state at the time of fault.

taku_hatAuthor
Associate
March 5, 2025

The cause of the issue was undefined behavior due to the initialization order problem of the static instance.
Thank you for your response.