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

How to know the remaining room in UART fifo?

Dear Sirs,

I use the standard printf() function to communicate via UART (with retargeting).

Unfortunately could not find a way to not overwrite a buffer.

The only workaround I have found is an additional delay as below:

printf("nRF52: command received from main processor\r\n");
nrf_delay_ms(100);
printf("next sentence...\r\n");

I try to use the following fifo function, but I do not know how to get a pointer to the tx fifo buffer

    app_fifo_write(&m_tx_fifo, NULL, &data_len);

I get following error,  in despite of the library app_fifo.c added to the project....

..\..\..\main.c(1041): error:  #20: identifier "m_tx_fifo" is undefined

Unfortunately, the APP_UART_FIFO_INIT macro does not return any info about used buffer...

I use 14.2 SDK &  custom board with nrf52810.

Thank you in advance for your help

Andre

Parents Reply
  • The function  app_fifo _write() is just what I used.
    This is a generic function and can be (I suppose) applied to all fifi using the same structure.
    UART fifo has the same data structure...

    I know to write a function using this library. I think the only problem is the UART  fifo variable scope...

    I asked you for help, just to not write my own redundant code, because such fifo is already initialized by APP_UART_FIFO_INIT macro...

    Cordially

    Andre

Children
Related