Destiny
Destiny

Reputation: 1

ESP32 C3 Super Mini resets after reading serial line with C#

I would like to read the serial data with a C# Windows Forms Application. The data is send with an ESP32 C3 Super Mini. When I use the Serial Monitor from the Arduino IDE everything works fine.

If I'm reading the serial data with my C# Application (serialPort1.ReadLine(); or serialPort1.ReadExisting();) I will get the data only once and then the ESP resets with this reason: rst:0x15 (USB_UART_CHIP_RESET),boot:0xc (SPI_FAST_FLASH_BOOT)

C# Code

private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
    lblState1.Invoke(new MethodInvoker(ProcessData1));
}

private async void ProcessData1()
{
    //MessageBox.Show(serialPort1.ReadLine());
    MessageBox.Show(serialPort1.ReadExisting());
}

Arduino Code

unsigned long last_time = 0;

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    // Print a heartbeat
    if (millis() > last_time + 2000)
    {
        Serial.println("Arduino is alive!!");
        last_time = millis();
    }
}

A few days ago the application worked fine. After I upload a new programm to the ESP32 I got this problem and can't fix it.

Edit

DtrEnable and RtsEnable are set to false.

Upvotes: 0

Views: 165

Answers (1)

Destiny
Destiny

Reputation: 1

Problem got solved over night by just leaving the Arduino unpluged. Thanks to @kunif for your help.

Upvotes: 0

Related Questions