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

Error code 0x00008043 received when calling dm_security_setup_req

Hello,

I'm working with a nrf51822, SoftDevice S120 v2.0 and SDK v9.0 platform.

Specifically using it a Central role to connect to a Blood Pressure peripheral.

When I connect to the peripheral and subscribe to the target characteristic for "INDICATION" (so it can send me the Blood Pressure readings)

The peripheral responds to my centrals sd_ble_gattc_write() command on its CCCD with a BLE_GATTC_EVT_WRITE_RSP.

Here it indicates that it requires BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION

I then do this:

uint32_t err_code = dm_security_setup_req(&p_client->handle);
APP_ERROR_CHECK(err_code);

When doing this I get an error code of 0x00008043.

I am pretty new to Nordic SD/SDK so I'm unable to work this error code out.

Can someone please advice?

Thanks very much, Mark

  • This is not a valid error code. Have you turned off optimizations? Have you used the debugger to see where inside dm_security_setup_req() the error is returned?

  • Thanks for the reply @Petter

    You are right, I was casting the error_code incorrectly.

    The error_code is 0x00008043. I believe this is DM_DEVICE_CONTEXT_FULL right?

    It seems to fail somewhere in this method:

    static __INLINE ret_code_t device_instance_allocate(uint8_t *              p_device_index,
                                                          ble_gap_addr_t const * p_addr)
    {
        ret_code_t err_code;
        uint32_t     index;
    
        err_code = DM_DEVICE_CONTEXT_FULL;
    
        for (index = 0; index < DEVICE_MANAGER_MAX_BONDS; index++)
        {
            DM_TRC("[DM]:[DI 0x%02X]: Device type 0x%02X.\r\n",
                   index, m_peer_table[index].peer_id.id_addr_info.addr_type);
            DM_TRC("[DM]: Device Addr 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X.\r\n",
                   m_peer_table[index].peer_id.id_addr_info.addr[0],
                   m_peer_table[index].peer_id.id_addr_info.addr[1],
                   m_peer_table[index].peer_id.id_addr_info.addr[2],
                   m_peer_table[index].peer_id.id_addr_info.addr[3],
                   m_peer_table[index].peer_id.id_addr_info.addr[4],
                   m_peer_table[index].peer_id.id_addr_info.addr[5]);
    
            if (m_peer_table[index].id_bitmap == UNASSIGNED)
            {
                if (p_addr->addr_type != BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE)
                {
                    m_peer_table[index].id_bitmap           &= (~ADDR_ENTRY);
                    m_peer_table[index].peer_id.id_addr_info = (*p_addr);
                }
                else
                {
                    m_peer_table[index].id_bitmap &= (~IRK_ENTRY);
                }
    
                (*p_device_index) = index;
                err_code          = NRF_SUCCESS;
    
                DM_LOG("[DM]: Allocated device instance 0x%02X\r\n", index);
    
                break;
            }
        }
    
        return err_code;
    }
    

    I'm in Central Mode. Trying to connect to a BP Meter in Peripheral Mode (I'm not sure if they use Nordic internally as it's an off the shelf device that I have the API for).

    In my Central codebase the DEVICE_MANAGER_MAX_BONDS = 8

    Does this mean that BP Meter has maxed out on bonds or my Central has maxed out on bonds?

    Thanks again for your help.

    Does this mean that maximum bonds have been reached?

  • 0x00008043 is DM_DEVICE_CONTEXT_FULL yes. It means that your central have reached the maximum number of bonds. You can confirm this by doing an erase all and program the SoftDevice and application once more.

  • Hi @Petter

    I increased DEVICE_MANAGER_MAX_BONDS from 8 to 9.

    I assumed that this new space will be then used to bond with my Peripheral. i.e. m_peer_table[newIndex].id_bitmap would equal UNASSIGNED But I'm seeing some weird behaviour.

    In this method:

    static __INLINE ret_code_t device_instance_allocate(uint8_t *              p_device_index,
                                                          ble_gap_addr_t const * p_addr)
    

    I printed out the id_bitmap of all 9 bond after increasing my MAX BONDS to 9.

    And this is what I see:

    ******** m_peer_table[0].id_bitmap = 0xDB
    ******** m_peer_table[1].id_bitmap = 0x68
    ******** m_peer_table[2].id_bitmap = 0x9B
    ******** m_peer_table[3].id_bitmap = 0x1C
    ******** m_peer_table[4].id_bitmap = 0xFD
    ******** m_peer_table[5].id_bitmap = 0x59
    ******** m_peer_table[6].id_bitmap = 0x58
    ******** m_peer_table[7].id_bitmap = 0xB0
    ******** m_peer_table[8].id_bitmap = 0x1C (This should be the new one) 
    

    m_peer_table[8].id_bitmap should be UNASSIGNED but it holding 0x1C.

    I cant seem to find what 0x1C is? Can you point out what may be happening here?

  • Do you get this error if you try to bond after an erase all? And program the SoftDevice and application once more.

Related