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

nRF52840 mesh SDK coexistence

Hi,

I have working firmware for nRF52832 dev kit based on mesh coexistence examples (Mesh SDK 2.2.0 + nRF5_SDK_15.0.0). I'm trying to port the same firmware on nRF52840 dev kit but there are no SDK coexistence examples provided for nRF52840 so I modified ble peripheral example from nRF5_SDK_15.0.0. If I don't initialize mesh everything else works fine, but I'm getting "ASSERTION FAILED at :0" when mesh stack is being initialized, in function mesh_config_backend_init(), line "NRF_MESH_ASSERT(p_entries != NULL);".

void mesh_config_backend_init(const mesh_config_entry_params_t * p_entries,
                              uint32_t entry_count,
                              const mesh_config_file_params_t * p_files,
                              uint32_t file_count,
                              mesh_config_backend_evt_cb_t evt_cb)
{
    NRF_MESH_ASSERT(p_entries != NULL);
    NRF_MESH_ASSERT(entry_count > 0ul);
    NRF_MESH_ASSERT(p_files != NULL);
    NRF_MESH_ASSERT(file_count > 0ul);

    m_power_down_time_us = 0;

    mp_files = p_files;
    m_file_count = file_count;
    mesh_config_backend_glue_init(evt_cb == NULL ? dummy_event : evt_cb);

    for (uint32_t itr = 0; itr < entry_count; itr++)
    {
        const mesh_config_file_params_t * p_file = file_get(p_entries[itr].p_id->file);
        NRF_MESH_ASSERT(p_file != NULL && p_file->p_backend_data != NULL);
        uint32_t size_guard = p_file->p_backend_data->size +
                mesh_config_record_size_calculate(p_entries[itr].entry_size) * p_entries[itr].max_count;
        NRF_MESH_ASSERT(size_guard <= UINT16_MAX);
        p_file->p_backend_data->size = size_guard;
        p_file->p_backend_data->entry_count += p_entries[itr].max_count;
    }

    /* Create files in increasing file ID order */
    const mesh_config_file_params_t * p_file = NULL;

    while ((p_file = next_file_get(p_file)) != NULL)
    {
        if (MESH_CONFIG_STRATEGY_NON_PERSISTENT != p_file->strategy)
        {
            NRF_MESH_ERROR_CHECK(mesh_config_backend_file_create(p_file->p_backend_data));
        }

        m_power_down_time_us += mesh_config_backend_file_power_down_time_get(p_file);
    }
}

Any idea what could be causing this? Are there any SDK coexistence examples for nRF52840?

Parents Reply
  • I found the issue, flash_placement.xml file is different in mesh SDK examples, it has an extra line:

    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_mesh_flash"  inputsections="*(SORT(.nrf_mesh_flash.*))" address_symbol="__start_nrf_mesh_flash" end_symbol="__stop_nrf_mesh_flash"/>

    So when you use ble_peripheral example and add mesh functionality to it, flash_placement.xml file should be modified also.

    This solved my issue, thanks for the help.

Children
Related