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

Assertion in access_model_publish(), after setting publish address

Hi everyone,

I'm migrating my project from nrf sdk for Mesh v2.1.1 to v5.0.0. To do this, I build my code on the light switch client example from nrf sdk for mesh v5.0.0.

my setup:
- own PCB with the nrf52832 chip (but same problem occurs with an nrf52DK)
- segger embedded studio for ARM V5.40a
- nrf sdk for mesh v5.0.0 (is currently v2.1.1)
- nrf mesh android app v3.1.1

The problem:
The node sends a message to the provisoner whenever the node resets (using the function access_mode_publish() in access.c). No messages are send until the subscription address is set (which is correct). But after I set the application key and subscription address with the nrf mesh app, the program gets an assert when it sends the message. It goes to the error handler.
(I've tested this in nrf sdk for mesh v4.2.0 and v3.0.0 as well, but I get the same problem).

I have been debugging this problem and I found out that the assert happens in the timer_scheduler.c here:

If I'm correct, this means that an irq priority is not set correctly. But I have set all irq priorities to 6 (NRF_MESH_IRQ_PRIORITY_LOWEST), so I don't know why this gives the problem.

I've been looking in the migration guides and release notes, but I couldn't find anything that could help me with this problem.

So my question is: How can I solve this irq priority problem?

If there is any information missing, please let me know.

Parents Reply Children
  • Hi,

    First of all, thank you for your reply. To answer your questions: I checked the documentation and I did everything that was needed. I do not use FreeRTOS or any other RTOS for the nrf.

    When I tried to reproduce my problem I realised that the irq priorities are set correctly. At least no errors/assert occur from there. The problem is actually in core_tx.c here:

    The message I'm trying to send is a segmented message, so it should send multiple messages here, but it stops before sending one. I tried to look for the definition of this function, but I could not find it. So I don't now why this goes wrong when the app key and publish address are set, and does not go wrong when they are not set.

    Some more info: I do not have any problems with publishing reply messages or any other publish messages. All my reply messages are not segmented.

  • Hi,

    Do you get any error codes/asserts from the packet_send() function? And you are not running the mesh handling in the main loop, correct?

  • Hi,

    Yes I do get an assert in the packet_send() function. I started looking further into that function and I realised that I did get an assert from where I first thought I got it. So my irq priorities are still the problem.

    With mesh handling do you mean sending/receiving message from the mesh network,? If so, I do send the message from the main loop, using the function access_model_publish(). Is that a problem?

  • Hi,

    Yes, calling mesh APIs from the main loop may cause some issues(Take a look at Hung's answer for more detail around this).

    If you want to run mesh related stuff in the main, follow this part of the document.

  • Hi,

    I changed the priority to NRF_MESH_IRQ_PRIORITY_THREAD (15), but the nrf resets when I try to connect to it. The _IRQ_PRORITYs in sdk_conifg.h are not for mesh, so it doesn't have to do with this problem, does it? These are all set to 6 (= NRF_MESH_IRQ_PRIORITY_LOWEST).

    I also tried with the second link you send me, but the nrf resets when trying to send the first provisioning packets. It says that the APP_SHED_QUEUE_SIZE should be 32 when there is minimum to no additional user code within the main loop. So I increased that size, but it still resets when I send the first provisioning packets. I have APP_SCHED_EVENT_SIZE set equal to APP_TIMER_SCHED_EVENT_DATA_SIZE, which has a value of 8.

Related