I have application which has 3 UARTS (GSM / Debug / GPS) and will be developed under FreeRTOS (not the matter here but STM32F1 will be used).
What would be the pattern to use with this setup regarding:
GSM: Will be used to receive message commands and send feedback from sensors. GPS: Will be processed to get new location ASAP. Debug: Will output information on the status of the system.
4 Tasks should be implemented;
- GPS Receive
- GSM communication
- Debug output
- Application task
GPS will get location and put it into global buffer then signal via semaphore that location is available. If semaphore has not been taken (either put that new location into circular buffer or discard it).
GSM will receive data into queueRX and queueTX and send when possible to the server.
Debug output will also receive in queueRX and queueTX and send to dedicated UART.
Application task will coordinate all of the main algorithm (take location, acquire sensor info and send output to GSM and debug).
Now comes the question, because there is 3 UARTS in the same time (two at 115200 and GPS at 9600) what would be the best / pattern approach of handling that Tx/Rx.
I have made some tests for GPS and tried to put every RX char into queue but that generates too much Interrupts, also using DMA has issue because you can easily miss ending \r\n and then you are in wait.
Tnx in advance.