Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

using UART to collect 2 rx_buf

Hi, I have configured normal uart, where you send 1 tx_buf and wait for the rx_buf until you get a response. This setup was fine until the logging feature was requested. However, I need a different type of setup because I also need to log data.

I am collecting data on sd card. I am communicating with motion controller over uart to drive a motor. I can send the string "GN\r" over uart in a tx_buf and receive the speed response and then I can print it to a file on the sd card. However, The motion controller also sends a response back when it reaches the destination. Then I have send disable motor command over uart to stop the motor.

lets say  I have a timer. In the timer interrupt a local rx_buf catches speed data after transmitting the tx_buf. and in the mainloop  I have another uart communication going, the tx_buf says notify at position x and the local rx_buf in the loop is going to catch the response "P/r/n"

Will this work? Do I need concurrency or RTOS? or what would be the ideal uart setup for this? Will a simple timeout work? Please share you thoughts

Parents Reply Children
No Data
Related