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!

Parents Reply Children
  • 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.

  • Oh, I can't believe I didn't have that selected... Thank you so much for your help!

    The error code that comes up in the terminal is:

    <error> peer_manager_sm: Could not perform security procedure. smd_params_reply() or smd_link_secure() returned NRF_ERROR_INVALID_ADDR. conn_handle: 0
    <error> peer_manager_handler: Unexpected fatal error occurred: error: NRF_ERROR_INVALID_ADDR
    <error> peer_manager_handler: Asserting.
    <error> app: ERROR 16 [NRF_ERROR_INVALID_ADDR] at C:\Nordic\components\ble\peer_manager\peer_manager_handler.c:294
    PC at: 0x00039F85
    <error> app: End of error report

    So it seems to be a connection issue.

  • New Update on the errors as well. If I disable LESC:

    #define SEC_PARAM_LESC                  0

    and I pair... it seems to work fine for a short time in DEBUG mode. BUT when I go to the battery service and turn on notifications, I get another error from the SAADC:


    <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Local database, action: Update
    <error> app: ERROR 3735928559 [Unknown error code] at C:\Nordic\modules\nrfx\drivers\src\nrfx_saadc.c:522
    PC at: 0x000320BB
    <error> app: End of error report

  • I'm really only using this glucose example for the passkey. I don't even need a random passkey; I only need a static passkey. This seems to be more trouble than it's worth. Is there a simple way I can simply implement a static passkey?

  • Hi,

    Nicholas_Nuti said:
    Is there a simple way I can simply implement a static passkey?

    Yes. This is essentially the same way as you implement random passkey, just that you additionally specify the passkey by configuring the SoftDevice accordingly.

    This will work smoothly if you take an unmodified GLS example, and just add this snipped at the end of the gap_params_init() function.

        memset(&opt, 0x00, sizeof(opt));
        uint8_t passkey[] = "123456";
        opt.gap_opt.passkey.p_passkey = passkey;
        err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &opt);
        APP_ERROR_CHECK(err_code);

Related