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
studzinski said: 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.
studzinski said:..\..\..\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 ...
The m_tx_fifo variable is well declared in app_uart_fifo.c. However as static, so the ARM compiler limits the scope to the file. And I do not want to write anything in library file...
The app_fifo_write(&m_tx_fifo, NULL, &data_len); is used to get the room, as specified in the library documentation...
My question is: do you know an another way to get the remaining room in fifo, or the way to know a pointer to actual (assigned) UART fifo in order to use this function?
studzinski said:as static, so the ARM compiler limits the scope to the file
That's what the 'C' standard defines - nothing specifically to do with ARM!
If you want the symbol to be accessible from outside that file, you will either have to make it global, or provide an "accessor" function.
Or you could use a buffer of your own?
Of course, I said ARM, because I use it...
But my question was simple:
How to know the UART fifo remaining room (initialized by UART_FIFO_INIT macro)?
Is there any direct way in 14.2 SDK library without writing a custom fifo??
studzinski said:Is there any direct way in 14.2 SDK library without writing a custom fifo??
Surely, you've already answered that - use the app_fifo_write() function ?
You just need to use a buffer that is in-scope at the point of the call