on-internet
← Community

Why do I need an infinite loop in STM32 programming?

Stack Overflow ·

I'm programming an STM32F4 in C (GCC), and it's an ARM Cortex-M4. I see all examples finish their main() function with an infinite loop, even when the rest of the program will be executed from interrupts. If I try to remove the loop from my program, the interrupts stop being fired too. Why can't I just remove this loop and exit the main thread? Here is the assembly (I guess it's Thumb-2, but I can't read that, even with the documentation): LoopFillZerobss: ldr r3, = _ebss cmp r2, r3 bcc FillZerobss /* Call the clock system initialization function.*/ bl SystemInit /* Call the application's entr

Comments

Sign in or sign up to comment and upvote.

No comments yet.