Inquiry About Simultaneous Use of UART2 for AT Commands and Serial Debugging

Dear RAK Development Team,

I hope this message finds you well. I am currently working on a project using the RAK3172 module as a master device. The setup involves utilizing the two available UART peripherals: UART1 and UART2.

Project Overview:

UART1: I plan to connect an RS485 interface to receive data from a temperature sensor.
UART2: I would like to use this UART for both sending AT commands and serial debugging, allowing me to output received data and diagnostic messages to a serial monitor simultaneously.

However, I have noticed in the datasheet that:

PA3/UART2_RX: Reserved - UART2/LPUART1 Interface (AT Commands and Firmware Update)
PA2/UART2_TX: Reserved - UART2/LPUART1 Interface (AT Commands and Firmware Update
PB6/UART1_TX UART1 Interface
PB7/UART1_RX UART1 Interface

Questions:

  1. Is it possible to use UART2 for both AT commands and serial debugging simultaneously, despite UART2 being reserved for AT commands and firmware updates?
  2. If yes, could you provide guidance or best practices on how to implement this? Specifically, Iā€™m interested in how to configure the UARTs and manage threading to avoid any conflicts.
  3. Are there any limitations or considerations I should be aware of regarding simultaneous UART usage in this manner?

I appreciate your assistance and look forward to your guidance on how to achieve this setup effectively.

Thank you for your support!

Best regards,

Anupam
[email protected]

Welcome to the forum @anupam

There are no special settings required to use the UART2 for AT commands, firmware upgrade and log output together.

Just initialize the UART2 with Serial.begin(115200); . 115200 as baudrate is important, to keep compatibility with the upload tools to flash firmware.

Examples where I use the Serial port for everything is in the RUI3-Best-Practices repository

1 Like

Dear Bernd,

Thank you for your prompt response and the clarification regarding the use of UART2 for AT commands, firmware upgrades, and log output. I appreciate the guidance you provided, and I will take a look at the RUI3-Best-Practices repository for additional examples.

I just wanted to confirm: can I indeed use RAK3172, UART2 Periferal for both AT commands and serial debugging simultaneously? If so, are there any specific considerations or best practices I should keep in mind to ensure smooth operation?

Thank you once again for your support!

Best regards,
Anupam
[email protected]