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

ncs 1.6.1 peripheral_uart difference between nRFConnect for Mobile and nRFToolBox UART

Hi,

I work with win10 laptop, Toolchain  nrf Connect SDK 1.6.1 on a nrf5340dk.

I modifyed peripheral_uart to use 240 bytes like it's explain into  "ncs 1.6.1 peripheral_uart example - increasing NUS size" ticket:

https://devzone.nordicsemi.com/f/nordic-q-a/79654/ncs-1-6-1-peripheral_uart-example---increasing-nus-size/337721#337721

First question:

It's work perfectly with nRFToolBox but I realized that it's work diffrently with nRFConnect for Mobile.

With nRFToolBox I can send 239 bytes with Rx Characteristc and Tx charateristic.

But if i try with nRFConnect I can't send more then 19 bytes with Tx Characteristic and more then 36 bytes with Rx Characteristic.

On Rx I have the "error 9 (0x9) Gatt prepare Q full" when I send 37 bytes and on Tx I have the warning" No Att channel for MTU 24 / no buffer available to send notification / fialed to send data over BLE connection" when I send 20 bytes.

Why is that not working on nRFConnect ?

Second question:

During a BLE formation in France I learned that there is a negociation between the central and the peripheral before etablishing a connection about the size of MTU.

I need to transfert a lot of data by the uart connection and I want to be sure that I can send paquet of 239 bytes for each connection with any smartphone (Android).

Do you know how to retrieve the result of the negociation between the central (smartphone) and the peripheral (nrf5340dk) ?

Best Regards,

Rob.

Parents
  • It seems like more prepare writes are being performed than the config (CONFIG_BT_ATT_PREPARE_COUNT=2) set. Try to increase this size. It would be really good get a sniffer trance of the whole transaction in the not working setup (mobile) to get an even deeper understanding of the communication between your device and the mobile app.

  • Additionnal information:

    With "CONFIG_BT_ATT_PREPARE_COUNT=6" I 'm limited to 108 bytes on Rx characteristic.

    I put "CONFIG_BT_ATT_PREPARE_COUNT=15" then I can send more then 239 bytes on Rx characteristic, but I have a log inf:

    <log_strdup alloc failed>

    What does it mean ?

    Best Regards,

    Rob.

  • Not sure what is happening on the receiver end. A sniffer log would help a lot to understand the issue looking at the communication in detail. The logs are not very informative. Please share your modifications so that i can reproduce this or add detail sniffer logs for this communication.

  • Hi Susheel,

    Thank you for your help.

    I managed to get the sniffer to work.

    There is the communication and the log with nRF ToolBox UART:

    nrfToolBox_UART_peripheral_uart_256a.pcapng

    I can see on line 1285 a sent write request where I send a packet 246 bytes (reassambled) and on line 4313 I received handle value notification a packet of 247 bytes (reassambled).

    There is the communication and the log with nRFConnect:

    nrfConnect_peripheral_uart_256a.pcapng

    I can see on line 9365 I received handle value notification a packet of 18 bytes.

    I cannot see the packet with more then 20 bytes send, where you have the warning "bt_att: No ATT channel for MTU 30 / bt_gatt: No buffer available to send notification / peripheral_uart_256a: Failed to send data over BLE connection" on the log message.

    I can see on line 10799 a sent write request where I send a packet of 18 bytes,

    line 10805 18 bytes more, line 10811 18bytes more, line 10817 18 bytes more..

    For a total 12 packet of 18 bytes where send (216 bytes).

    There is my project:

    3162.prj.conf4743.nrf5340dk_nrf5340_cpuapp.overlay

    Best Regards,

    Rob.

  • Additionnal information:

    I resolved the log inf: <log_strdup alloc failed>, by insering in prj.conf file:

    CONFIG_LOG_STRDUP_MAX_STRING=251
    CONFIG_LOG_STRDUP_BUF_COUNT=15

    but I still have the problem with:

    [00:00:41.223,632] <wrn> bt_att: No ATT channel for MTU 30
    [00:00:41.223,632] <wrn> bt_gatt: No buffer available to send notification
    [00:00:41.223,632] <wrn> peripheral_uart_256a: Failed to send data over BLE connection

    I cannot send from the computer to the smartphone more then 19 bytes with nRFConnect.

  • Hi Susheel,

    I find this post:

    https://devzone.nordicsemi.com/f/nordic-q-a/74604/in-connect-sdk-v1-5-0-nrf-samples-bluetooth-peripheral_uart-data-number-is-limited-20-bytes-more-than-20bytes-ble-will-part-data-in-two-or-more-packs-to-send-or-receive/309239#309239

    That explain how to modify MTU size on the app nRFConnect, on the top right the there is 3 dots ranged verticaly, there I can modify "request MTU". I put 239 and I no more error, I can send enougth bytes with nRFConnect now !

  • Great, 

    The IOS version I have does not seem to support this.functionality.

Reply Children
No Data