I am currently working on a project with the RAK3172 module and would like to know if it is possible to use both UART serial ports simultaneously. My goal is to connect two different sensors to the module, each using one of the serial ports, and read data from both at the same time.
Specifically, I have the following questions:
Does the RAK3172 firmware support simultaneous use of UART1 and UART2?
Can I configure both ports to read sensor data continuously without conflict?
Are there any special configurations or limitations I should be aware of when using both UART ports?
Thank you for your guidance!
Are you using RUI3 or a custom firmware based on STM32CubeIDE?
For RUI3, UART2 is assigned to AT commands and firmware updates.
You can use it for other purposes, but you will loose the ability to configure the module with AT commands and you need to use the SWD interface to update your firmware.
I don’t have an example to use UART2, I always avoid to use it for anything else than AT commands and firmware updates (and debug output).
In principle it is
// Setup UART2 == Serial for custom usage
Serial.begin(115200, RAK_CUSTOM_MODE);
// Setup UART1 == Serial1 for custom usage
Serial1.begin(115200, RAK_CUSTOM_MODE);
But once you have this lines in your code, you will need JLink or STM32Programmer over SWD to flash your firmware.
And you cannot setup any LoRa P2P or LoRaWAN credentials with AT commands anymore.