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

Mesh relay configuration on proxy node causes assert at next startup

Hi

I have had problems when trying to update the relay status of a server node in my mesh app which is a combination of the light switch server proxy and dfu examples (plus some other stuff).

I've gone back to the default light switch server prxoy example and found that the problem is already present in that application.


If I send a config server message to disable the server's relay capabilities, I will get an entry written in flash like this:


0072000 10100408 FFFF0001 01010002 00140100 7FFFFFFF


That looks OK. But once this entry is in the flash, the node will assert at startup. This seems to be because of the NRF_MESH_IRQ_PRIORITY_LOWEST / NRF_MESH_IRQ_PRIORITY_THREAD problem described in many other threads.


At startup the call stack will look like this:

bearer_event_in_correct_irq_priority()
timer_sch_abort()
advertiser_disable()
core_tx_adv_set()
core_tx_set()
mesh_config_backend_iterate_action()
mesh_config_backend_read_all()
mesh_config_load()
mesh_stack_init()
mesh_init()
initialize()
main()
start()

And this will assert in bearer_event_in_correct_irq_priority() because there was no active irq

    if (active_irq == HAL_IRQn_NONE)
    {
        return (m_irq_priority == NRF_MESH_IRQ_PRIORITY_THREAD || !hal_irq_is_enabled(EVENT_IRQn));
    }
    else
    {
        volatile uint32_t prio = NVIC_GetPriority(active_irq);
        return (prio == m_irq_priority || (prio > m_irq_priority && !hal_irq_is_enabled(EVENT_IRQn)));
    }


and m_irq_priority is set to NRF_MESH_IRQ_PRIORITY_LOWEST as specified in mesh_init()


If I change the priority in mesh_init() to NRF_MESH_IRQ_PRIORITY_THREAD, the startup will work OK, but as soon as I try connecting via the proxy I will get an assert in bearer_event_in_correct_irq_priority() because now the priority of SWI2_EGU2 is 7 while m_irq_priority is 15 (NRF_MESH_IRQ_PRIORITY_THREAD)

Can you help me with a suggestion how to solve this? I can't configure the relay status of my office mesh network until this is solved :-)

Thanks in advance,
P-O Håkansson

Related