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

    This shouldn't be too hard to accomplish. I suggest you start out with the ble_app_uart example, and implement/replace the UART/UARTE functions with the experimental_libuarte example functions. This post is very thorough on the matter of LIBUARTE if anything is unclear, and has a few tips on what to stay alert on when using the peripheral, so I suggest a read through there as you go along.

    For example, be aware that LIBUARTE requires NRFX_PRS_BOX_4 to be disabled for the UARTE0 peripheral since it needs to use its own LIBUARTE UARTE0_UART0_IRQHandler, as it is not fully integrated in the SDK yet.

    Now, we don't have a finished example where LIBUARTE is integrated in the ble_app_uart example, so you will have to do this yourself, or if you're lucky, someone on the forum has already made something similar and are willing to share.

    Best of luck and regards,

    Simon

Reply
  • Hi

    This shouldn't be too hard to accomplish. I suggest you start out with the ble_app_uart example, and implement/replace the UART/UARTE functions with the experimental_libuarte example functions. This post is very thorough on the matter of LIBUARTE if anything is unclear, and has a few tips on what to stay alert on when using the peripheral, so I suggest a read through there as you go along.

    For example, be aware that LIBUARTE requires NRFX_PRS_BOX_4 to be disabled for the UARTE0 peripheral since it needs to use its own LIBUARTE UARTE0_UART0_IRQHandler, as it is not fully integrated in the SDK yet.

    Now, we don't have a finished example where LIBUARTE is integrated in the ble_app_uart example, so you will have to do this yourself, or if you're lucky, someone on the forum has already made something similar and are willing to share.

    Best of luck and regards,

    Simon

Children
  • Hi,

    I modified the experiment_libuarte for my needs, but when I try to import it in the ble_app_uart I have many many many problems that really I do not know to figure them out. I tried to import the libraries like "nrf_libuarte.h", "nrf_libuarte.c", "nrf_libuarte_async.h".....

    I tried to modify something in sdk_config of ble_app_uart  following the setup of sdk_config in experimental_libuarte.

    In the main of ble_app_uart I removed the previous "uart_event_handle" and replaced it with the one that is in experimental_libuarte (a bit changed for my needs) and then send everything using ble_nus_data_send.

    When I try to build the solution, FOR THE MOMENT, I get these 2 errors:

    - static assertion failed: "Timer instance not enabled"

    - 'NRFX_TIMER0_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_TIMER_INSTANCE'?

    but I' m sure that I'll get something else going forward.

Related