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

NRF52840DK error caused in app_timer2.c (error code 8)

Hello,

In order to try and implement passkeys, I've implemented my program inside of the glucose app example. The project compiles + runs and crashes sometimes randomly but usually after connecting and entering the passkey.

According to the debugger, the error starts inside of "app_timer2.c"

Then continues to app_error.c with an error code of 8.

Does anyone know what this is?

Thank you!

  • Hi,

    It is not clear to me which functions return the error code (8 = NRF_ERROR_INVALID_STATE), and the screenshot does not show it. Can you make sure to enable logging and build select "Debug" from the build configuration drop-down? That way the exact location of the error will be printed in the log so that we can know which function returned NRF_ERROR_INVALID_STATE.

  • Hello!

    I understand, for I haven't been able to find out which function returns the error code as well. I have logging and the RTT back-end enabled too but I'm not getting the location of the error. Would the call stack be of any help?

    Thank you!

  • Hi,

    The call stack does indicate a failure in app_timer implementation, as you write, but it would be good to know more. The fact that only "Fatal error" is printed indicates that you are not building the debug configuration, which has more extensive logging (assuming you are basing your application on an SDK example). Can you select "Debug" from the build configuration drop-down menu, rebuild and test again? What does the log say in that case?

    Do you have any code that can reproduce this on a DK that I can run on my side?

  • Yes, I am based on an application example. I have the settings enabled in the sdk_config, but I guess the insufficient DEBUG feedback another issue for me.

    Yes I do have something you could run on an nRF52840DK but I was wondering if there is a way I could send it to you without posting it here? I would consider this program to be "company-sensitive".

  • Hi,

    Nicholas_Nuti said:
    Yes, I am based on an application example. I have the settings enabled in the sdk_config, but I guess the insufficient DEBUG feedback another issue for me.

    Yes. But getting debug logging is very good in this cases, as it typicaly points right at the problem. If you select the Debug build as shown by this image you get it right away:

    This does not do much, but it adds DEBUG and DEBUG_NRF to the list of preprocessor definitions (which is what is relevant for logging), and it sets the optimization level to None, so that the behavior you see actually match the code. This is very important for making life easier when debugging. 

    Nicholas_Nuti said:
    Yes I do have something you could run on an nRF52840DK but I was wondering if there is a way I could send it to you without posting it here? I would consider this program to be "company-sensitive".

    Yes. You can open a new private case where you upload the code and refer to this thread.

Related