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

Mesh Assert on timeslot request

Hi everyone,

I have migrated my project from SDK for Mesh v2.1.1 to v3.0.0.

I am getting a Mesh Assert when the Mesh is trying to request a radio timeslot after the "NRF_EVT_RADIO_BLOCKED" event has been received.

I am getting the retun code 0x0f (Forbiden Operation) from sd_radio_request.

        /* Try to re-order a short one timeslot to avoid the block */
        case NRF_EVT_RADIO_BLOCKED:
            
            radio_request_params_reset();
            m_radio_request_earliest.params.earliest.length_us = TIMESLOT_BASE_LENGTH_SHORT_US;
            ret_code = sd_radio_request(&m_radio_request_earliest);
            NRF_MESH_ASSERT(ret_code == NRF_SUCCESS);
            //NRF_MESH_ASSERT(sd_radio_request(&m_radio_request_earliest) == NRF_SUCCESS);

            break;

Parents
  • Hi everyone,

    it seems the problem has been solved by removing "ble_softdevice_support.c" from the project.

    I have integrated the Mesh functionallity in toan exsiting BLE Project.

    Thanks for your help 

    Fabian

  • Hi Fabian,

    Sorry for the late reply. But we think that removing 'ble_softdevice_support.c' from the project is probably not the "right" solution. Our guess is that your project setup made you register the SD event observer twice. This will happens if you call ble_stack_init() function from 'ble_softdevice_support.c', and also add the handler at the project level.

    Could you check that for me?

    Best Regards,

    Marjeris

  • Hi Marjeris,

    I have added the mesh functionallity to a BLE example from nRF SDK 15.0.0 (ble_peripheral/ble_app_blinky)

    This example uses this "ble_stack_init" function (in main.c) to initialize the BLE Stack

    /**@brief Function for initializing the BLE stack.
     *
     * @details Initializes the SoftDevice and the BLE event interrupt.
     */
    static void ble_stack_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_sdh_enable_request();
        APP_ERROR_CHECK(err_code);
       
        // Configure the BLE stack using the default settings.
        // Fetch the start address of the application RAM.
        uint32_t ram_start = 0;
        err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
        APP_ERROR_CHECK(err_code); // FH
    
        // Enable BLE stack.
        err_code = nrf_sdh_ble_enable(&ram_start);
        APP_ERROR_CHECK(err_code);  // FH
    
        // Register a handler for BLE events.
        NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
    }
    


    To add the mesh function to this example I followed this guide from the Nordic website 

    https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/Mesh_SDK/v2-1-1/md_doc_getting_started_how_to_nordicSDK

    And added this code to forward SoftDevice events to the mesh stack 

    #define MESH_SOC_OBSERVER_PRIO 0
    
    
    // Mesh Event handler
    static void mesh_soc_evt_handler(uint32_t evt_id, void * p_context)
    {
        nrf_mesh_on_sd_evt(evt_id);
    } // end func
    
    // Mesh SOC observer
    NRF_SDH_SOC_OBSERVER(m_mesh_soc_observer, MESH_SOC_OBSERVER_PRIO, mesh_soc_evt_handler, NULL);


    Sorry for my late reply and thanks for your help

    Fabian

  • Hi Fabian,

    You said you were using SDK for Mesh v3.0.0? Then you need to use nRF5 SDK 15.2 instead of 15.0. The right guide for integrating Mesh into nRF5 SDK examples will then be this one https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/Mesh_SDK/v3-0-0/md_doc_getting_started_how_to_nordicSDK

    Next time remember you can select the version of the SDK you are want to work with in the Documentation Library using the drop down menu in the top right.

    The forwarding of SoC events to the mesh stack is already taking care of in 'ble_softdevice_support.c' in Mesh SDK v3.0.0.

    static void on_sd_evt(uint32_t sd_evt, void * p_context)
    {
        UNUSED_VARIABLE(p_context);
    
        (void) nrf_mesh_on_sd_evt(sd_evt);
    }
    
        /* Register Mesh handler for SoC events. */
        NRF_SDH_SOC_OBSERVER(mesh_observer, NRF_SDH_BLE_STACK_OBSERVER_PRIO, on_sd_evt, NULL);
    }
    

    So if you already were adding this in your main.c then the SD event observer would have been registered twice and give you a timeslot assert. So now that's why the problem "was fixed" when you removed 'ble_softdevice_support.c'.

    I strongly recommend to follow the guide for Mesh SDK v3.0.0 and use SDK 15.2, since that's what the Mesh SDK v3.0.0 has been production tested with and can save you some troubles down on the road. Sorry for the inconvenience this time.

    Best Regards,


    Marjeris

Reply
  • Hi Fabian,

    You said you were using SDK for Mesh v3.0.0? Then you need to use nRF5 SDK 15.2 instead of 15.0. The right guide for integrating Mesh into nRF5 SDK examples will then be this one https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/Mesh_SDK/v3-0-0/md_doc_getting_started_how_to_nordicSDK

    Next time remember you can select the version of the SDK you are want to work with in the Documentation Library using the drop down menu in the top right.

    The forwarding of SoC events to the mesh stack is already taking care of in 'ble_softdevice_support.c' in Mesh SDK v3.0.0.

    static void on_sd_evt(uint32_t sd_evt, void * p_context)
    {
        UNUSED_VARIABLE(p_context);
    
        (void) nrf_mesh_on_sd_evt(sd_evt);
    }
    
        /* Register Mesh handler for SoC events. */
        NRF_SDH_SOC_OBSERVER(mesh_observer, NRF_SDH_BLE_STACK_OBSERVER_PRIO, on_sd_evt, NULL);
    }
    

    So if you already were adding this in your main.c then the SD event observer would have been registered twice and give you a timeslot assert. So now that's why the problem "was fixed" when you removed 'ble_softdevice_support.c'.

    I strongly recommend to follow the guide for Mesh SDK v3.0.0 and use SDK 15.2, since that's what the Mesh SDK v3.0.0 has been production tested with and can save you some troubles down on the road. Sorry for the inconvenience this time.

    Best Regards,


    Marjeris

Children
No Data
Related