Page 1 of 1

STM32F4, C++ Exception handling support ?

Posted: Fri Sep 28, 2012 9:27 pm
by gentijo
Is it possible/practical to enable C++ Exception handling support using the
Yagarto toolchain or does it just add too much overhead ?

I have a C++ library that I want to incorporate into my project but any throw()
call winds up in the unhandled exception function and not in the catch block.

I tried to comment out all the throw calls, but the same problem occurs when
event delete() is called. The little I have been able to find out about this says
that delete() actually requires exception support too..

I started with the ARMCM3-STM32F103-G++ example code and reconfigured it
to work with the F4, then enabled exception support in the Makefile. The code
compiles and runs fine just until it tries to throw an exception.

I was worried that exception support would cause too much stack consumption
but if I trace through the code, the SP does not look like it wildly out of control.

Thank you
John Gentilin

Re: STM32F4, C++ Exception handling support ?

Posted: Sat Sep 29, 2012 6:23 am
by Giovanni
Hi,

I never tried it, it could require changes to the linker script and/or to the startup file.

Giovanni

Re: STM32F4, C++ Exception handling support ?

Posted: Sat Sep 29, 2012 3:14 pm
by mabl
Hi gentijo,

exception handling is expensive but you can limit the impact of those undwinding routines by defining your own ones. Unfortunately, I do not have a link at hand.