nRF9160 flush UART buffer.

Hello!

I'm currently working on a project that uses an Icarus IoT board that is connected to a camera through UART.
The board is taking pictures with the camera, gathers the picture data through UART, and then sends the picture to AWS with the help of LTE. However, after a certain amount of time the board stops sending pictures in the middle of a transmission. My guess is that the memory might be full because the buffer never gets flushed.
I've seen other posts using "app_uart_flush() " for the nRF5 series, but it does not seem to be in the library anymore, I might be wrong about this, but I can't find it.

so my question is:
Is there another way to flush the UART buffer for the nRF9160?

I've tried to use k_free(*name of buffer*), but I'm not certain if this is the correct function. The board just ends up rebooting as soon as it reaches this part of the code.
The buffer itself is defined as 

extern uint8_t read_buf[READ_BUF_SIZE];

Appreciate all help and answers, thank you!

Parents
  • app_uart_flush was relying on app_fifo_flush. Fifos are application level buffers that could be controlled in app, but I do not think you can do that when you are using Zephyr system calls to interfact with UART driver. 

    I've tried to use k_free(*name of buffer*), but I'm not certain if this is the correct function. The board just ends up rebooting as soon as it reaches this part of the code.

    Not sure why you are trying k_free here, are the buffers dynamically allocated? if so how k_free would help communicating with the uart driver to flush the driver. 

    Can you add more code snippets on how you are using read_buf in your code, i am confused by the use of k_free on the buffers and your interpretation of connecting this to uart?

Reply
  • app_uart_flush was relying on app_fifo_flush. Fifos are application level buffers that could be controlled in app, but I do not think you can do that when you are using Zephyr system calls to interfact with UART driver. 

    I've tried to use k_free(*name of buffer*), but I'm not certain if this is the correct function. The board just ends up rebooting as soon as it reaches this part of the code.

    Not sure why you are trying k_free here, are the buffers dynamically allocated? if so how k_free would help communicating with the uart driver to flush the driver. 

    Can you add more code snippets on how you are using read_buf in your code, i am confused by the use of k_free on the buffers and your interpretation of connecting this to uart?

Children
Related