Distance measurement library questions (Part 3)

The code in dm.c uses  nrf_dm_calc() to calculate the distance 

I wanted to try using  nrf_dm_high_precision_calc() function to see if accuracy improves so I added the following code to dm.c

static void calculation(void) line 404
nrf_dm_populate_report(&report);
float hi_prec = nrf_dm_high_precision_calc(&report);
//nrf_dm_calc(&report);
process_data(&report);
if(isnan(hi_prec)){
   result.status = false;
else{
   result.dist_estimates.mcpd.best = hi_prcec;
}
Now I get a crash  after calling dm_request_add in both REFLECTOR and INITIATOR roles.
00> [00:00:01.895,019] <err> os: ***** MPU FAULT *****
00> [00:00:01.895,050] <err> os: Data Access Violation
00> [00:00:01.895,050] <err> os: MMFAR Address: 0x20014480[0m
00> [00:00:01.895,080] <err> os: r0/a1: 0x200147dc r1/a2: 0x200147c0 r2/a3: 0x200147b8
00> [00:00:01.895,111] <err> os: r3/a4: 0x20014930 r12/ip: 0x3fd37823 r14/lr: 0x00005c2b
00> [00:00:01.895,111] <err> os: xpsr: 0x21000000
00> [00:00:01.895,141] <err> os: s[ 0]: 0x00000000 s[ 1]: 0x00000000 s[ 2]: 0x00000001 s[ 3]: 0x00000000
00> [00:00:01.895,172] <err> os: s[ 4]: 0x00000000 s[ 5]: 0x00000000 s[ 6]: 0x00000000 s[ 7]: 0x00000000
00> [00:00:01.895,202] <err> os: s[ 8]: 0x00000000 s[ 9]: 0x00000000 s[10]: 0x00000001 s[11]: 0x00000000
00> [00:00:01.895,202] <err> os: s[12]: 0x00000000 s[13]: 0x00000000 s[14]: 0x00000000 s[15]: 0x00000000
00> [00:00:01.895,233] <err> os: fpscr: 0x20000010
00> [00:00:01.895,233] <err> os: Faulting instruction address (r15/pc): 0x000051f0
00> [00:00:01.895,294] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
00> [00:00:01.895,324] <err> os: Current thread: 0x20007528 (dm_thread_id)
00> [00:00:02.451,751] <err> fatal_error: Resetting system
Questions
1. What needs to be done to stop the crashing?
2. Are there plans to add a parameter to let the user decide which calculation method to use?
3. Please elaborate on the two methods : pros and cons of each? When to use and when not to use?
Thanks
Andy
Related