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

Sending multiple data packets continuously on UART service

Hello,

I am testing the ble_peripheral example of ble_app_uart (SDK 12, soft device 130), this has been asked at a lot of places that the MTU is limited to 20. But then I implemented my own code snippet to send data into fragments. these are posts I was following:

devzone.nordicsemi.com/.../

devzone.nordicsemi.com/.../

I included the BLE_EVT_TX_COMPLETE in on_ble_evt(), but it never hits there, and If I try to send larger size stream, my module resets.

I want to know:

  1. Are there any other alternatives to send bytes greater than 20 on BLE UART interface, and can you give me hints on how to go about it?

Since I am new to this NRF51 SDK, I am yet to figure out following things:

  1. How to get the error number from APP_ERROR_CHECK
  2. How to set breakpoints and debug, without a heavy IDE, (I am using atom for development and compiling with the cross- compiler)

So if you want me to debug specific error codes, kindly help me out with a simple debug method. currently I am using printf which also prints on UART, but I dont feel it is reliable to bebug the issues in BLE UART with logging on UART.

Kindly help out asap

Parents
  • FormerMember
    0 FormerMember

    It is not possible to send data packets longer than 20 bytes with the nRF51.

    The BLE_EVT_TX_COMPLETE event will occur when the transmission of the queued packets is finished. What does your "transmit" code look like? Do you ever exit the function that is transmitting?

    As you know, the maximum amount of data to transmit in a notification is 20 bytes. If you try to transmit more bytes, sd_ble_gatts_hvx(..) will return an error, and APP_ERROR_CHECK(..) will reset the chip.

    For debugging you can use gdb, or perhaps it is easier to set up SEGGER embedded studio. This blog post shows how to do it.

    Instead of transmitting debug info over UART, you can transmit debug info over RTT. See this devzone post for how to enable debugging over RTT.

    The below example is a modified version of the ble_app_uart (SDK 12.0.0), and it shows how to test the throughput by counting upwards the data to transmit (not receiving data over UART, see data_send(..) ).

    ble_app_uart_test_throughput.zip

    The example should be placed in the following folder: ..\nRF5_SDK_12.0.0_12f24da\examples\ble_peripheral

    Note: the example has not been through extensive testing.

  • FormerMember
    0 FormerMember in reply to FormerMember

    It is not necessary to use interrupt context. I used it to leave BLE_EVT_xx context before sending more packets.

    Where do you see "transmission of queued packets"?

Reply Children
No Data
Related