Hello,
I'm using the NRF5 sdk v17.0.2 with s140 on the nrf52840,
I would like to know the technical reason why the APP_ERROR_HANDLER definition in app_error.h depends on the DEBUG definition. Indeed APP_ERROR_HANDLER will call either app_error_handler or app_error_handler_bare.
In fact I would like to store (when my firmware is compiled in release so, DEBUG won't be defined) the program counter, line number and filename in a record (non volatile memory, or external flash). The app_error_handler_bare doesn't allow to do that because of its API.
I tried to modify the SDK where APP_ERROR_HANDLER doesn't depend on DEBUG and always call app_error_handler, and it works perfectly (line number, filename and program counter can be retrieved perfectly in the final error handler).
So why there is two kind of implementations ?
Best,
Joël