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

NRF_ERROR_NO_MEM at sd_ble_gatts_hvx

I am getting a no memory error (NRF_ERROR_NO_MEM) after using sd_ble_gatts_hvx several times in a loop. I think the error is indeed 0x04 and not BLE_ERROR_NO_TX_PACKETS 0x3004 as one would expect from a such use case.. What could be potential reason for this? (SDK 11 - SD130)

Parents
  • It sounds unlikely that you should receive NRF_ERROR_NO_MEM(0x04) when it is not listed as a return code for sd_ble_gatts_hvx(), are you sure that its not BLE_ERROR_NO_TX_PACKETS (0x3004) ? 

    There are only 7 packets in the TX_BUFFER, if you queue more than that before the SoftDevice can send the TX packet, then you will receive that error. 

    What you should do is to stop queuing and wait for the BLE_EVT_TX_COMPLETE and then queue notifications again.

    Best regards

    Bjørn 

Reply
  • It sounds unlikely that you should receive NRF_ERROR_NO_MEM(0x04) when it is not listed as a return code for sd_ble_gatts_hvx(), are you sure that its not BLE_ERROR_NO_TX_PACKETS (0x3004) ? 

    There are only 7 packets in the TX_BUFFER, if you queue more than that before the SoftDevice can send the TX packet, then you will receive that error. 

    What you should do is to stop queuing and wait for the BLE_EVT_TX_COMPLETE and then queue notifications again.

    Best regards

    Bjørn 

Children
No Data
Related