cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable exception handling on STM32G474?

DEyer.1
Associate II

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?

0 REPLIES 0