For uart i used the pins from the layout. I tried to use the rts/cts pins manually and with the provide nrf52 uarte hal.
For the baudrate i used 921600.
Before i started the transmission i set wifi_en and boot_mode high. (I got this from the cpp file)
As of now i tried a lot of different parameters but cannot get a response from the esp32. I tried uart with an external device and sending and receiving data works fine there.
I kind of have the same issue trying to bootstrap the communication. It seems @heusini uses the proper pins, is it maybe that the UARTE is not capable of directly speaking to them?
This is the code I used to test communicating with the ESP32 from Device OS. I was able to send AT commands and get responses with this.
// Disable ESP32. It appears to be turned on by default even in SEMI_AUTOMATIC mode
WiFi.off();
delay(5000);
// Enable ESP32
_log.trace("rebooting ESP32");
pinMode(ESPBOOT, OUTPUT);
pinMode(ESPEN, OUTPUT_OPEN_DRAIN);
digitalWrite(ESPBOOT, 1);
delay(100);
digitalWrite(ESPEN, 0);
delay(100);
digitalWrite(ESPEN, 1);
delay(100);
// Set up serial
_log.trace("Starting serial");
Serial2.begin(921600, SERIAL_FLOW_CONTROL_RTS_CTS); // 115200
You do need an \r\n after the AT command because you need a line terminator, and the OK is uppercase, but yes. It might take a couple tries after rebooting the ESP32. I had a loop of up to 4 retries.
Thanks for the help. I could fix it. I selected the wrong pins
I used P1.04 as TX and P1.05 as RX and so on. I marked the pins in the image so maybe it helps someone in the future Such a silly mistake…