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

Can i Use Ring Buffer from Zephyr in Uart Event Handler?

Hi,

Im using nrf9160 based custom board, nrf sdk 1.5.1. with Zephyr

Im using Uart in DMA mode but have small doubts in implementation

1. what is the max size of buffer for DMA in UART (i need at least 2048 buffer, so is that possible)?

2. I want to collect this Uart data in Ring Buffer(zephyr/..../sys/ring_buffer.h), can i directly implement ring_buf_put() in Uart Event Handler?, i have tested and its working fine, but i need confirmation that is it good practice or do we have any work arround?

3. can i use k_poll_signal_raise() in envent handler?

 if( ring_buf_put(&evcRingBuf, (event->data.rx.buf + event->data.rx.offset), event->data.rx.len) < event->data.rx.len )
    {
        LOG_WRN("RingBuf write failed");
      }    
      
      k_poll_signal_raise(&EVCCommSignal, EVC_PORT_DATA);
    }

Best Regards

Rajender

Related