This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

IOT Timer Resolution ICMP example

Hi, 

I'm using the ICMP example provided in SDK 15 to test the 6lowpan and wanted to check the RTT from the nrf52832 dev kit.

I managed to do so with the IOT Timer, I check the time when sending the ICMP packet and print the difference upon receiving it, I am using the iot_timer_wall_clock_get function on both cases and I configure the resolution in the sdk_config.h in the IOT_TIMER_RESOLUTION_IN_MS define.

However I cannot set a resolution under 5ms, otherwise the system crashes and the code does not run. I get 

<error> app: Fatal error
<warning> app: System reset

Do you know how I can solve this issue? I would like to have 1 ms resolution for my tests.

Thank you 

  • Hello,

    Where does this error come from?

    When you get these kind of errors, they typically come from one of the APP_ERROR_CHECK(err_code); where the err_code != NRF_SUCCESS (0).

     

    Try to define DEBUG in your preprocessor defines, and then disable optimization (set it to -O0). Then try to debug, and set a breakpoint on line 90 in app_error.c, and see if it stops there. Then you can add *p_info to watch, and check where the APP_ERROR_CHECK(err_code); that triggered is located. See if you can make any sense of the call that returned the err_code, and why it did.

     

    Best regards,

    Edvin

  • Hi, 

    I did what you sugested and the error comes from the main.c of the ICMP example in line 526, which corresponds to the iot_timer_init functionThe error code is 7, which is INVALID_PARAMETER.

    After checking, I observed that in the app_timer.h the APP_TIMER_MIN_TIMEOUT_TICKS was defined as 5 ms. Changed that to 1 ms and now everything works.

    Thank you for pointing me in the right direction.

    Best regards

Related