STM32F4, C++ Exception handling support ?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
gentijo
Posts: 11
Joined: Sat Jul 21, 2012 5:00 am

STM32F4, C++ Exception handling support ?

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F4, C++ Exception handling support ?

Post by Giovanni »

Hi,

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

Giovanni
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32F4, C++ Exception handling support ?

Post 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.
Post Reply