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

UARTE configuration with nrf9160 and zephyr

Hi,

we have developed our working UART code according to Zephyr documentation, and its working fine,

we find that this code works with EasyDMA . but my question is my uart2_fifo_callback function is calling for every byte, why its happening like this, please help me to understand?

Note: we are using UART in UARTE_INTERRUPT_DRIVEN mode

and some other doubts are:

1. How we can increase/decide RX FIFO size

2. How we can configure UART so that the Uart_fifo_callback function will be called only once per every communication

3. What is the difference between UARTE_INTERRUPT_DRIVEN and CONFIG_UART_ASYNC_API, can we have interrupt handler even if i use CONFIG_ASYNC_API mode?

Best Regards

Rajener.

Parents Reply Children
  • Hi,

    Thank for your response,

    But when i try to open this project in the Segger Embedded Studio, its not opening, For your reference i am attaching a screenshot of the same.

    you can check my environment options by referring next pic-->

      

    Please help to solve this issue, so that i can verify my UARTE

    Best Regards

    Rajender.

  • Hi,

    I solved this project creating issue,

    i will update on the UARTE soon

    Best Regards

    Rajender

  • Hi Torbjorn,

    I have created your project in my segger embedded studio, but i con not find any configuration in uart_init() or anywhere else,  Where i can configure my UARTE properties(like baud rate, etc.,)

    when i try to build and upload in to my nRF9160 board, its building and uploading fine, but now i can not see the output, i have tried all the baud rates given in my terminal software still no use.

    NOTE: i have changed some code and configs, Please check below-->

    #define UART_BUF_SIZE		10//16
    #define UART_RX_TIMEOUT_MS	500//100

    dev_uart = device_get_binding("UART_2");

    Please help to understand

    Best Regards

    Rajender

  • Hi,

    Finally i have tested your project and its working fine, triggering interrupts according to the data buffer size and timeout delay,

    but it working only one direction, means if i send any data to uart port through my terminal software its receiving and i can see the data also, but when i add uart tx function then also its not sending data to uart port from my microcontroller, i have tried both uart_tx() or z_impl_uart_tx() but no use
    NOTE: i did not enabled console also, Im using uart_2 for my uart communication

    Please help me to understand

    Best Regards

    Rajender

  • Hi,

    after spending some time on this i got to know that

    when i transmit data using uart_tx() this will return 0, (means-successful) but again it will trigger timeout function(static void tx_timeout()) then, UART_TX_ABORTED event, and then UART_TX_DONE event.
    but anyway data will not sends to the UART Terminal.

    Please help me to solve this.

    NOTE: I am attaching my project for your reference please check.

    UART_TEST.zip

    Best Regards

    Rajender.

Related