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

NRF Mesh ad_listener handler NULL?

I'm trying to integrate mesh 4.0.0 into an existing project that uses sdk 16.0.0. I'm very close, but I'm getting an error when I try to run mesh_stack_start()

I traced the issue down to the input_param_check method in mesh/bearer/src/ad_listener.c

static uint32_t input_param_check(const ad_listener_t * p_adl)
{
    if (p_adl == NULL || p_adl->handler == NULL)
    {
        return NRF_ERROR_NULL;
    }


    if (p_adl->adv_packet_type > BLE_PACKET_TYPE_ADV_EXT && /*lint !e685 Relational operator '>' always evaluates to 'false' */
        p_adl->adv_packet_type != ADL_WILDCARD_ADV_TYPE)    /*lint !e650 Constant '255' out of range for operator '!=' */
    {
        return NRF_ERROR_INVALID_PARAM;
    }

    return NRF_SUCCESS;
}

On line 3, the p_adl->handler is NULL.

I'm a bit stumped on why this handler would be NULL and where exactly it is set.

I have added .nrf_mesh_flash and .nrf_mesh_ram sections to my linker file as follows:

  .nrf_mesh_flash :
  {
    PROVIDE(__start_nrf_mesh_flash = .);
    KEEP(*(SORT(.nrf_mesh_flash*)))
    PROVIDE(__stop_nrf_mesh_flash = .);
  } > FLASH

  .nrf_mesh_ram :
  {
    PROVIDE(__start_nrf_mesh_ram = .);
    KEEP(*(SORT(.nrf_mesh_ram*)))
    PROVIDE(__stop_nrf_mesh_ram = .);
  } > RAM

Any suggestions would be greatly appreciated!

Best

Parents
  • One other thing I noticed while inspecting the symbols was the placement of the sdh_req_observers.

    This is from the light_switch/server example that ships with the mesh sdk:

    0004df3c D __nrf_mesh_start_ad_listeners
    0004df3c D __start_sdh_req_observers
    0004df3c D __stop_sdh_req_observers
    0004df3c R __stop_sdh_stack_observers
    0004df3c D m_instaburst_mesh_packet_listener
    0004df44 D m_mesh_packet_listener
    0004df4c D m_beacon_listener
    0004df54 D m_pb_adv_ad_listener
    0004df5c D __nrf_mesh_start_mesh_config_entries
    0004df5c D __nrf_mesh_stop_ad_listeners

    And this is from the project that I'm trying to compile:

    0005134c D __nrf_mesh_start_ad_listeners
    0005134c D m_beacon_listener
    00051354 D m_instaburst_mesh_packet_listener
    0005135c D m_mesh_packet_listener
    00051364 D m_pb_adv_ad_listener
    0005136c D m_dfu_ad_listener
    00051374 D __nrf_mesh_start_mesh_config_entries
    00051374 D __nrf_mesh_stop_ad_listeners

    Besides the extra dfu_ad_listener, the only difference is the sdh_req_observers. I am forwarding SoftDevice events to the mesh stack via:

    static void mesh_soc_evt_handler(uint32_t evt_id, void * p_context)
    {
        nrf_mesh_on_sd_evt(evt_id);
    }
    
    NRF_SDH_SOC_OBSERVER(m_mesh_soc_observer, MESH_SOC_OBSERVER_PRIO, mesh_soc_evt_handler, NULL);

Reply
  • One other thing I noticed while inspecting the symbols was the placement of the sdh_req_observers.

    This is from the light_switch/server example that ships with the mesh sdk:

    0004df3c D __nrf_mesh_start_ad_listeners
    0004df3c D __start_sdh_req_observers
    0004df3c D __stop_sdh_req_observers
    0004df3c R __stop_sdh_stack_observers
    0004df3c D m_instaburst_mesh_packet_listener
    0004df44 D m_mesh_packet_listener
    0004df4c D m_beacon_listener
    0004df54 D m_pb_adv_ad_listener
    0004df5c D __nrf_mesh_start_mesh_config_entries
    0004df5c D __nrf_mesh_stop_ad_listeners

    And this is from the project that I'm trying to compile:

    0005134c D __nrf_mesh_start_ad_listeners
    0005134c D m_beacon_listener
    00051354 D m_instaburst_mesh_packet_listener
    0005135c D m_mesh_packet_listener
    00051364 D m_pb_adv_ad_listener
    0005136c D m_dfu_ad_listener
    00051374 D __nrf_mesh_start_mesh_config_entries
    00051374 D __nrf_mesh_stop_ad_listeners

    Besides the extra dfu_ad_listener, the only difference is the sdh_req_observers. I am forwarding SoftDevice events to the mesh stack via:

    static void mesh_soc_evt_handler(uint32_t evt_id, void * p_context)
    {
        nrf_mesh_on_sd_evt(evt_id);
    }
    
    NRF_SDH_SOC_OBSERVER(m_mesh_soc_observer, MESH_SOC_OBSERVER_PRIO, mesh_soc_evt_handler, NULL);

Children
No Data
Related