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

Getting a MESH ASSERT on 'subscription delete all'

Hi,

as describe in the title, we are getting a mesh assert when trying to remove all suscibtions from a model.

it is kind of hard to reproduce because this command is not implemented in NrfMesh app, so we are implementing it in our App.

The assert appear when calling this command for the first time after a full erase of the dk board and the first provisionning.

regarding the SDK 4.1 for Nrf52840, the assert is caused by this:

device_state_manager.c : 2036 - 2048

uint32_t dsm_address_subscription_remove(dsm_handle_t address_handle)
{
    if (address_handle_valid(address_handle))
    {
        nrf_mesh_address_t addr;
        uint32_t status = dsm_address_get(address_handle, &addr);
        if (status == NRF_SUCCESS)
        {
            if (addr.type == NRF_MESH_ADDRESS_TYPE_GROUP)
            {
                if (m_addresses[address_handle].subscription_count == 0)
                {
                    return NRF_ERROR_NOT_FOUND;  // <-- this 

called from:

config_server.c : 496

        NRF_MESH_ASSERT(dsm_address_subscription_remove(subscribed_addresses[i]) == NRF_SUCCESS);

after restarting the node, this command works fine.

can you please take a look and tell me where is the probleme?

best regards

B

Parents
  • Hi Benjamin, 

    Could you let me know what you did before you called the function to erase all subscriptions ? Have you assigned a subscription address to any model ? 

    It seems that the address has no subscription and then it end up in NRF_ERROR_NOT_FOUND. 


    I'm curious about subscription_count and the subscribed_addresses[] array you have. 

  • Hi, sorry for the late answer

    here you have it

    Best regards

  • Hi,

    I suspect there may be a discrepancy between the states of the access layer and the device state manager. In this part of code, the number of subscriptions are checked using access layer functions, and then used for determining how many entries to delete from DSM. If access and DSM is out of sync at this point, then that could explain this error. If that is the case then I do not see any immediate way to fix this for an application, as it must be fixed in the mesh stack code itself.

    I will report the issue to our developers, so they can look into it and hopefully reproduce and suggest a fix. Do you have a project running on an nRF DK or Dongle, where this issue can be easily reproduced?

    Regards,
    Terje

Reply
  • Hi,

    I suspect there may be a discrepancy between the states of the access layer and the device state manager. In this part of code, the number of subscriptions are checked using access layer functions, and then used for determining how many entries to delete from DSM. If access and DSM is out of sync at this point, then that could explain this error. If that is the case then I do not see any immediate way to fix this for an application, as it must be fixed in the mesh stack code itself.

    I will report the issue to our developers, so they can look into it and hopefully reproduce and suggest a fix. Do you have a project running on an nRF DK or Dongle, where this issue can be easily reproduced?

    Regards,
    Terje

Children
Related