Writing to a R/W Register

Hello!

I've been having issues with my UART port on my ESP32-S3-USB-OTG board with potential data loss due to my RX buffer size. I read that I can expand this buffer size by writing a value of 0x140014 to a UART Memory Configuration Register at address 0x0060 (retrieved from the technical manual for the ESP32-S3).

I was wondering if there is a way to write to this register built into Arduino, or through some library.

I previously tried doing this using the Wire library, but when trying to read the contents of the register at that address I received a -1 back, so I'm not sure if this was the correct library to use.

No need to use a library, the definition files should have given this register a name, normally the name of the register in the data sheet. Just use that on the left hand side of an =

Evidently the Arduino core for ESP32 does not support directly writing to ESP32 registers. You need to use the ESP-IDF interface instead: ESP-IDF Programming Guide - ESP32 - — ESP-IDF Programming Guide latest documentation

This seems particularly relevant to the UART: Universal Asynchronous Receiver/Transmitter (UART) - ESP32 - — ESP-IDF Programming Guide latest documentation

Please do not cross post.

This is a continuation of Serial data issues when writing to SD - ESP32

Do you have something against Serial.setRxBufferSize() in setup(), as discussed on the page referenced by the the other thread?

Yes. It doesn't work.

Correct me if I am wrong, but I believe it is used for the USB CDC library/functionality of the board, and doesn't work for UART. (Although I would eventually like to get the USB host port on my board working, but none of the example code on the ESP32 arduino github seemed to work for my board).

The only "solution" seems to be what jremington posted about using the ESP-IDF (something I absolutely do not want to do, since I have had horrible luck setting up the code base and do not want to convert my arduino code to ESP-IDF unless I absolutely have to).

Edit: I also tried Grumpy_Mike's solution with no success.

What makes you think you have to convert anything? Just call the appropriate function!

You are making completely unwarranted assumptions about how hard this is.

Here is an example from a perfectly ordinary Arduino program for ESP32:

  // set up the OLED power, tested on pin 2 and 33, working
  pinMode(2, OUTPUT); //supposed to source up to 40 mA max domain 3
  gpio_set_drive_capability((gpio_num_t)2, GPIO_DRIVE_CAP_3);
  digitalWrite(2, HIGH); // power up display

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.