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
  • Hi

    Looking at the documentation of FIFO, it doesn't seem to mention specifically "no added delay": https://docs.zephyrproject.org/latest/reference/kernel/data_passing/fifos.html 

    "A data item may be added to a FIFO by a thread or an ISR. The item is given directly to a waiting thread, if one exists; otherwise the item is added to the FIFO’s queue. There is no limit to the number of items that may be queued.

    A data item may be removed from a FIFO by a thread. If the FIFO’s queue is empty a thread may choose to wait for a data item to be given. Any number of threads may wait on an empty FIFO simultaneously. When a data item is added, it is given to the highest priority thread that has waited longest."

    One thing could be unaligned memory access, as FIFO data items must be aligned on a word boundary, as the kernel reserves the first word of an item for use as a pointer to the next data item in the queue.

    Best regards,

    Simon

Reply
  • Hi

    Looking at the documentation of FIFO, it doesn't seem to mention specifically "no added delay": https://docs.zephyrproject.org/latest/reference/kernel/data_passing/fifos.html 

    "A data item may be added to a FIFO by a thread or an ISR. The item is given directly to a waiting thread, if one exists; otherwise the item is added to the FIFO’s queue. There is no limit to the number of items that may be queued.

    A data item may be removed from a FIFO by a thread. If the FIFO’s queue is empty a thread may choose to wait for a data item to be given. Any number of threads may wait on an empty FIFO simultaneously. When a data item is added, it is given to the highest priority thread that has waited longest."

    One thing could be unaligned memory access, as FIFO data items must be aligned on a word boundary, as the kernel reserves the first word of an item for use as a pointer to the next data item in the queue.

    Best regards,

    Simon

Children
No Data
Related