Hi,
I'm using Segger Embedded Studio (with gcc naturally). The standard C++ exception handling doesn't work: exceptions are not caught by exception handler. Is there a way to enable normal C++ behaviour?
Thanks,
Daniel
Hi,
I'm using Segger Embedded Studio (with gcc naturally). The standard C++ exception handling doesn't work: exceptions are not caught by exception handler. Is there a way to enable normal C++ behaviour?
Thanks,
Daniel
Hello Daniel,
For questions regarding Segger Embedded Studio, I would recommend asking the Segger Forum e.g. https://forum.segger.com/index.php/Thread/4448-Have-to-import-cpp-files-to-run-code/
Similar questions regarding the nRF SDK and C++ usage have been asked before, have a look here and here.
Kind regards,
Øyvind
Hello Daniel,
For questions regarding Segger Embedded Studio, I would recommend asking the Segger Forum e.g. https://forum.segger.com/index.php/Thread/4448-Have-to-import-cpp-files-to-run-code/
Similar questions regarding the nRF SDK and C++ usage have been asked before, have a look here and here.
Kind regards,
Øyvind
Øyvind,
Sorry but I don't get it - can you elaborate why these links are relevant to my question?
Best,
Daniel
Not directly connected to your question, but since you are asking in our forum I would like to inform you that Nordic Semiconductor doesn't have any official support for C++ in SES (or any other compiler) so you will have to do some of the error searching here yourself.
Kind regards,
Øyvind
Øyvind,
OK, C then: since unlike C++, C doesn't have a mechanism for systematic exception handling, can you recommend the Nordicsemi preferred way (in C) to recover from HW faults?
Best,
Daniel
Daniel,
The nRF SDK has built-in error handling, see HardFault handling library and Error module in the SDK v15.3 documentation. This tutorial is also a good read to learn about the error handling in nRF5 projects.
Hope this answers your question.
Kind regards,
Øyvind
Øyvind,
From browsing the links you sent it appears that there is a function HardFault_Handler which in turn calls HardFault_c_handler. Furthermore, I see that there is an assembly implementation of HardFault_Handler in \nRF5_SDK_15.3.0_59ac345\components\libraries\hardfault\nrf52\handler\hardfault_handler_gcc.c
My questions:
1. Do I need to compile this as part of my project?
2. Does implementing HardFault_c_handler interfere with softdevice?
3. What is the uint32_t * parameter passed to HardFault_c_handler?
Best,
Daniel