This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

peripheral_uart crashes using fifo's for ble transmission in nrf connect sdk 1.8.0

hi, i am using ncs 1.8.0 for an application where i need to send some data every 10 ms. directly sending data over NUS with bt_nus_send() from the main thread works fine. but when i try to send data through exiting ble_write_thread by putting data into fifo_uart_rx_data results in these warnings in the log and skips a lot of data to be sent to the receiver.

[00:00:43.284,240] <wrn> bt_att: No ATT channel for MTU 16520
[00:00:43.284,240] <wrn> bt_gatt: No buffer available to send notification
[00:00:43.284,271] <wrn> peripheral_uart: Failed to send data over BLE connection
[00:00:43.294,250] <wrn> bt_att: No ATT channel for MTU 16520
[00:00:43.294,250] <wrn> bt_gatt: No buffer available to send notification
[00:00:43.294,281] <wrn> peripheral_uart: Failed to send data over BLE connection
[00:00:43.314,270] <wrn> bt_att: No ATT channel for MTU 16520
[00:00:43.314,270] <wrn> bt_gatt: No buffer available to send notification
[00:00:43.314,300] <wrn> peripheral_uart: Failed to send data over BLE connection

using ble_write_thread also works fine for larger intervals of time. only problem is when i set the interval to 10 ms it crashes likes this.

i have incresed the mtu size and heap size also but it did not show any considerable change.

these are the changes i made in prj.conf


#incresing the mtu size
CONFIG_BT_L2CAP_TX_MTU=240
CONFIG_BT_BUF_ACL_RX_SIZE=240

#thread naming
CONFIG_THREAD_NAME=y
#increasing the heap size
CONFIG_HEAP_MEM_POOL_SIZE=4096

any advice on how to get this correct.

thanks in advance.

Parents
  • i am sorry. it is my code causing the error. i was not checking whether the memory is allocated or not before pushing to the fifo. and the data and length given to bt_nus_send() being a garbage values resulted in this behaviour.
    after setting a while loop to repeat allocating until the memory is allocated the code works fine. but i am not sure this is the way to go here. any advice is appreciated. 
    i have incresed the stacksize of the concerned data sending thread but doesn't seem to be doing anything much. am i missing anything here?

Reply
  • i am sorry. it is my code causing the error. i was not checking whether the memory is allocated or not before pushing to the fifo. and the data and length given to bt_nus_send() being a garbage values resulted in this behaviour.
    after setting a while loop to repeat allocating until the memory is allocated the code works fine. but i am not sure this is the way to go here. any advice is appreciated. 
    i have incresed the stacksize of the concerned data sending thread but doesn't seem to be doing anything much. am i missing anything here?

Children
No Data
Related