Hello, Erich Styger
KDS 3.0 , PE project or without PE project , kinetis K20X256vll7, I want to use the exceptions detect try catch() of C++,
could you tell me how to configure ?
The attachment is my project , and when i debug , it could not run in to the catch() , at the end, it show the error :
Thank !
Original Attachment has been moved to: k20dx256vl7_cpp_pe_test1.zip
Hello fan,
I'm having trouble starting a C++ project with KDS 3, PE, using a kinetis KE06Z.
Can you help me with the steps or maybe posting a empty C++ project?
Regards,
CH
Hi fan xy,
The GNU toolchain that KDS 3.0.0 uses does not support exception handling, this is because the libstdc++ built along with newlib-nano have exception handling disabled. You can find more information on this link:
Question #230716 : Questions : GCC ARM Embedded
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Carlos,
Thank for your reply.
And how we can change the newlib-nano to newlib ? or change libstdc++ to another , which build along wiht newlib ?
Thank !
Fan
Hi fan,
if you remove --specs=nano.specs from the linker options, it will use the newlib.
Erich
Confirmed, disabling newlib-nano in the linker settings allows exceptions to be caught and handled. It's rather necessary to do this with certain packages such as Cereal for serialization. There is a code size penalty, of course, but if you're doing C++ applications with exception handling, you probably want to be running on a 1MB+ flash part anyway.