Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

ESP32 uart issue/observation

iiLawiiLaw United Kingdom
edited October 8 in mJS JavaScript engine

A. Issue .. maybe,
I know any GIPO pin can be a uart but I tried to using expressif documented uart pins as follows

    let uartNo = 1;   // Uart number used for this example
    // Configure UART at 115200 baud
    UART.setConfig(uartNo, {
      baudRate: 115200,
      rxBufSize: 1024,
      txBufSize: 1024,
      esp32: {
        gpio: {
           rx  9,
           tx: 10,
         }
      }   
    })

Tx worked fine but after receiving 8 chars/bytes on RX the esp332 crashed
So can you override the api_arch_uart.js settings?

B. Why are UART 1 & 2 set to these pins?
/ GPIO pin numbers, default values depend on UART.
UART 0: Rx: 3, Tx: 1, CTS: 19, RTS: 22
UART 1: Rx: 13, Tx: 14, CTS: 15, RTS: 16
UART 2: Rx: 17, Tx: 25, CTS: 26, RTS: 27

Most hookup guides use expressif documented ones it's a bit confusing for newbies

C. javascript documentation doesn't point out that UART 0 is used by the console, for clarity it should

Lawrence

Sign In or Register to comment.