Skip to main content
DEyer.1
Associate II
January 14, 2025
Question

How to enable exception handling on STM32G474?

  • January 14, 2025
  • 0 replies
  • 590 views

Hello,

I create my project for the Nucleo STM32G474 board in CubeMX using an output CMake file and now I want to enable exception handling. I noticed the CXX compiler flag had -fno-exceptions, I removed this. However, when I try something as simple as 

 

 

 try
 {
 throw std::exception();
 }
 catch (const std::exception &e)
 {
 log_blocking("Caught exception:");
 }

 

 

I see that the program throws the exception and then falls into std::terminate(). What am I missing here? Are there any other special things I need to do in order to enable exception handling?