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!

  • 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);

  • Thank you for your help Einar! I very much appreciate it.

    Do you have any insight on the previous problem?

Related