nRF51822: extract line number and file name from app_error_fault_handler

Hello, guys!

We are using nRF51822 SoC with nRF5 SDK v12.3.0 and s130 SoftDevice. For the devices in the wild, we would like to implement the following health monitoring strategy:

  1. Detect when the fault events happen (e.g. HardFaults, App Error Faults, Watchdog reset),
  2. Store the info about the fault event
  3. Report the info about the fault event(s) to the app over the BLE link, once the connection is established.

Currently, we are not sure how to find the line_number and file_name that caused the AppErrorFault. As you have advised us in this thread, we store the fault identifier (id) as well as the info field of the instruction that caused the AppErrorFault.

My question is how can we get the line_number and file_name externally, once we know the values of id and info parameters? Is there any script or tool that can help us extract that information somehow?

For example, in the case of HardFaults, we can use addr2line tool of the arm compiler to find out more about which function/module is behind the p_stack_address->pc we extract from the HardFault_Handler(). Is there any similar approach in the case of AppErrorFault?

Thanks in advance for your time and efforts.

Sincerely,
Bojan.

Parents Reply Children
Related