WSL v3 - Serial1

Hello,

Did anyone manage to use UART1 of Wireless Stick Lite v3?

I am switching my project from Wireless Stick Lite v2 to v3.
My project is using UART1 (HardwareSerial Serial1). Everything was ok with v2.
Not so easy with v3…

First step, pinout of WSL v3 indicates :

  • GPIO18 / U1RxD / ADC2_CH7 / CLK_OUT3
  • GPIO17 / U1TxD / ADC2_CH6
    => I plugged my equipment to GPIO18 and GPIO17, taking care that I don’t invert Tx and Rx.
    => I configured my Arduino IDE with new framework and librairies (Tests of LoRa examples are ok on my WSL v3)
    => I rebuilt the same code as for WSL v2 implementing UART1 and loaded it in my WSL v3
    => It doesn’t work… Tested with a scope : continuous 0V on U1TxD.

Second step, quick look at the “ESP32S3 Technical Reference Manual”
=> I supected that the new library did not implement the selection of the functions U1RxD and U1TxD on GPIO17 and GPIO18
=> I added the following code at the beginning of my setup():

/-------------------------------------------------------------------------------------------------------------------------------/
// activation fonctionnalité U1TxD sur GPIO17 (cf. ESP32S3 Technical Reference Manual, p.499)
REG_CLR_BIT(IO_MUX_GPIO17_REG, BIT12);
REG_SET_BIT(IO_MUX_GPIO17_REG, BIT13);
REG_CLR_BIT(IO_MUX_GPIO17_REG, BIT14);
// configuration de GPIO18 en Entrée (cf. ESP32S3 Technical Reference Manual, p.499)
REG_SET_BIT(IO_MUX_GPIO18_REG, BIT9);
// activation fonctionnalité U1RxD sur GPIO18 (cf. ESP32S3 Technical Reference Manual, p.499)
REG_CLR_BIT(IO_MUX_GPIO18_REG, BIT12);
REG_SET_BIT(IO_MUX_GPIO18_REG, BIT13);
REG_CLR_BIT(IO_MUX_GPIO18_REG, BIT14);
/-------------------------------------------------------------------------------------------------------------------------------/

=> Tested with a scope : data outputs from TxD1 and answers from my equipment come back on RxD1. But the 2 signals have noisy/unstable high and low levels (I don’t observe this on my WSL v2 in the same hardware configuration). => answers are badly received by UART1 of the WSL v3.

Third step, quick look at HardwareSerial.cpp => I found this :
/-----------------------------------------------------------------------------------/
#if SOC_UART_NUM > 1

#ifndef RX1
#if CONFIG_IDF_TARGET_ESP32
#define RX1 9
#elif CONFIG_IDF_TARGET_ESP32S2
#define RX1 18
#elif CONFIG_IDF_TARGET_ESP32C3
#define RX1 18
#elif CONFIG_IDF_TARGET_ESP32S3
#define RX1 15
#endif
#endif

#ifndef TX1
#if CONFIG_IDF_TARGET_ESP32
#define TX1 10
#elif CONFIG_IDF_TARGET_ESP32S2
#define TX1 17
#elif CONFIG_IDF_TARGET_ESP32C3
#define TX1 19
#elif CONFIG_IDF_TARGET_ESP32S3
#define TX1 16
#endif
#endif

void serialEvent1(void) _ attribute _((weak));
void serialEvent1(void) {}
#endif / SOC_UART_NUM > 1 /
/----------------------------------------------------------/

=> It seems that for ESP32S3, this library defines RxD1 on 16 and TxD1 on 15.
The WSL v3 schematic indicates that 15 and 16 are connected to 32K XP and XN (Quartz 32kHz).
=> I looked with a scope and I can see my data output on pin 15 (GPIO16) of my WSL v3.
=> It doesn’t work if I connect my equipment to 15 and 16. Answers of my equipment are badly received by UART1 of the WSL v3.

So my questions are :

  • did anyone manage to use UART1 of WSL v3?
  • what are the correct pins for TxD1 and RxD1 ?
  • GPIO15 and GPIO16 are they connected to the 32kHz quartz?

Thanks in advance for your help! I have to design my PCB…

Hi @lcv, this work for me

#define RX 18
#define TX 17 
void setup()
{
    Serial.begin(115200);
    Serial1.begin(BAUDRATE, SERIAL_8N1, RX, TX);
}