C++ exception handler on gnu arm cortex m4 with freertos

前端 未结 3 2323
小蘑菇
小蘑菇 2021-02-20 02:03

Update 2016-12 There is now also a minimal example for this behavior: https://community.nxp.com/message/862676


I\'m using a ARM Cortex M4 with fr

3条回答
  •  迷失自我
    2021-02-20 02:19

    After successfully creating a blank project with default settings in freescales Kinetis, and asking the same problem on the nxp community, Alice_Yang , an NXP engineer (assuming by the NXP badge), told me the answer:

    By default new projects link to newlib-nano which has it exception support disabled.

    The libstdc++ built along with newlib-nano have exception handling disabled.

    So the solution is to link simply to newlib. This can be done by simply removing the line "-specs=nano.specs" in "other linker flags" and also make sure the check box which adds the same option is also disabled. Then everything works as expected. Only the code increased by 27 kB in ROM/text size and 2kB in RAM/data.

提交回复
热议问题