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");
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


No Data
  • I do not know how to get a pointer to the tx fifo buffer

    That doesn't seem to have anything to do with the question of finding the remaining space in the buffer?

    Surely, if you have the buffer, then getting a pointer to it is just basic 'C' ? Please clarfiy what you've tried, and where you're stuck.

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

    It's telling you that you have not defined 'm_tx_fifo' - so you need to define it!

    The 'C' programming language requires that you declare things before you use them ...