application runs 9 times out of 10 NRF_ERROR_RESOURCES error free and then, once in a while, NRF_ERROR_RESOURCES massively present from the beginning

To the kind attention of Nordic support team,

I'm testing a freertos project, with softdevice and radio notifications. A constant number of notifications is queued before the starting of the connection interval, and sent during the connection interval itself. It works very well, I get this high speed data stream. Every time I get a sporadic NRF_ERROR_RESOURCES, the feedback mechanism exploiting BLE_GATTS_EVT_HVN_TX_COMPLETE starts working as well, and the resource error disappear after a while.

Everything works fine, like 9 executions of the program out of 10 are really stable and NRF_ERROR_RESOURCES free. If I reset (Ctrl+Shift+F5 using Segger), it seems that, once in a while, from the beginning of the connection NRF_ERROR_RESOURCES is massively there, and it never goes away. Only reducing the number of queued notifications help.

But why the number of notifications should be reduced once in a while? All this sounds to you like a problem in the application, or there could be something changing in the connection? I thought about master forcing a different connection interval than the desired one. But using BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST I have no evidence for now that this behavior is due to a change in connection interval timing. I attached systemview files to the project and next days I'll be possibly able to post some more thing about this issue (also I'm gonna use Nordic sniffer). Really, just a quick opinion from your experts would be very much appreciated. Also, any debug strategy you would recommend.

Thank you in advance, best regards.

  • Hi all, some systemview data. This is the nice condition: (a resource error can still occurs, but everything seems to return to "normal" after a while) 

    This is the condition where the communication starts to struggle and seems never to return back to "normal"

    These are systemview files, you can open them renaming them as *.bin -> .SVDat:





    Best regards

  • I saw that - if switching on bluetooth in my phone and having it close to my antenna device - during "normal" case execution, ,i get lots of resource errors, that end as soon as I'm switching off bluetooth in my phone. Could be a problem in transmission channels. Is it possible to force the master (windows + built in ble chipset) to ask for new channels? Or, is nRF Connect Bluetooth Low Energy Standalone v4.0.0 able to update frequency channels? 

  • Hi,

    You are getting NRF_ERROR_RESOURCES because the Tx buffer is full and have to wait for a Tx to complete before a new buffer is available. This is normal, but the question is why this happens. Something happens on the link, but we cannot say from here what that is without more information. Can you make a sniffer trace that shows the communication between the nRF and the phone? That should show if there are connection parameter changes, a lot of re-transmissions, or other things that could explain this.

    astella said:
    Could be a problem in transmission channels. Is it possible to force the master (windows + built in ble chipset) to ask for new channels?

    Note that Bluetooth is frequency hopping, and normally most of the channels will be in use. It is possible to request a new channel map from the nRF, but that requires quite a bit, and it is not likely that it would help (the phone and desktop computer Bluetooth stacks keep track of this and typically update the channel map regularly if needed). (In any case it seems premature before knowing what actually causes this issue.)

  • Hi Einar, I have a very simple application, without freertos and using softdevice s140 7.3.0. I enabled radio notifications and I can see, at least observing systemview output, that sw1 frequency is not constant.

    This is what this test code looks like. Ble_SendReportHVX(); is also called when BLE_GATTS_EVT_HVN_TX_COMPLETE. 

    void Common_Init()

        // Configure and initialize the BLE stack.
        if (!nrf_sdh_is_enabled())


    That measure in systemview is:

    void SWI1_IRQHandler(bool radio_evt)
        if (radio_evt)
          radio_evt_ok = true;
          if(m_number_of_packets_per_interval == 0)
            m_number_of_packets_per_interval = MAXIMUM_NUMBER_PACKET_PER_INTERVAL;

    Is it normal to have this sw1 behavior? Am I missing some setting? I expected to get a more regular sw1 timing. What could be the cause of this variability?

    Best regards

  • This is solving the previous issue, like this -triggering on active- the event is quite regular as expected:

    uint16_t err_code = radio_notification_init(2, NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE, NRF_RADIO_NOTIFICATION_DISTANCE_800US);