If I compile a simple C++ test program (say RT-STM32F407-DISCOVERY-G++ demo), and make sure to remove "-fno-exceptions" and place the following code in main:
Code: Select all
try {
throw 1;
}
catch( ... ) {
// all ok
}
It works as expected. That is, the exception is thrown, caught, and then main gets on with its progress.
Now the clincher. If I do the same thing but target my STM32F7 (starting with RT-STM32F769I-DISCOVERY demo) and add C++ support with exceptions, the same code as above doesn't get into the catch() block, and treats it as an unhandled exception (eventually ending up in the std abort handler and thus chSysHalt() infinite loop).
I've tried this on ChibiOS-18.2.1, with the ARM GCC7-2017-q4-major toolchain.