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

LIBUARTE on ble_app_uart with DMA

Hi All,

I have 2 boards nrf52840 pc10056 and I need to run ble_app_uart using LIBUARTE with DMA in order to obtain a more robust uart communication

I would like to use an uart DMA that will work in background saving the byte received in a buffer (fixed length) and once that it is full having an interrupt where I can check this buffer and send it to the central unit.

Is there any easy way to set  everything up and change the code of ble_app_uart? Any suggestion??

Thanks

Parents
  • What about the RX buffer on the central side? Do you clear that one after printing as well, or does it just fill up?

    Have you stepped through your code to see why you never reach the APP_ERROR_CHECK()? If you set the check outside of the if-loop so you get it no matter what the error code, you should be able to see it.

    Best regards,

    Simon

  • Hello,

    I left the central in the way that it is on SDK 15.3 that Nordic released. The only thing I changed was to commented out the ECHO function in order to do not send back data to the peripheral. My idea was to work before on the peripheral and, once it works, moving on the central.

    The program stops here:

    SVCALL(SD_BLE_GATTS_HVX, uint32_t, sd_ble_gatts_hvx(uint16_t conn_handle, ble_gatts_hvx_params_t const *p_hvx_params));

    Assuming that the packet is long, for example, 75 characters. If I set a rx_buffer of 150 characters, from the "central" side I will see only 2 packets.

    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 3, 0, 4, 150, 3);

    Basically the programs will call the following function 3 times:

    return sd_ble_gatts_hvx(conn_handle, &hvx_params);

    the first 2 times it works, in the third it will hang (On the peripheral side).

    If I increase the RX_buffer for example at 225 (3x75)

    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 3, 0, 4, 225, 3);

    the program will call 4 times "sd_ble_gatts_hvx" but on the 4th it will stop. But from this function I cannot get any error because the program never return from there.

    The path of the error is:

    It will finish in:  "Unknown function at 0x00000A60"

Reply
  • Hello,

    I left the central in the way that it is on SDK 15.3 that Nordic released. The only thing I changed was to commented out the ECHO function in order to do not send back data to the peripheral. My idea was to work before on the peripheral and, once it works, moving on the central.

    The program stops here:

    SVCALL(SD_BLE_GATTS_HVX, uint32_t, sd_ble_gatts_hvx(uint16_t conn_handle, ble_gatts_hvx_params_t const *p_hvx_params));

    Assuming that the packet is long, for example, 75 characters. If I set a rx_buffer of 150 characters, from the "central" side I will see only 2 packets.

    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 3, 0, 4, 150, 3);

    Basically the programs will call the following function 3 times:

    return sd_ble_gatts_hvx(conn_handle, &hvx_params);

    the first 2 times it works, in the third it will hang (On the peripheral side).

    If I increase the RX_buffer for example at 225 (3x75)

    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 3, 0, 4, 225, 3);

    the program will call 4 times "sd_ble_gatts_hvx" but on the 4th it will stop. But from this function I cannot get any error because the program never return from there.

    The path of the error is:

    It will finish in:  "Unknown function at 0x00000A60"

Children
No Data
Related