Closed toomasz closed 5 years ago
Have you tried using https://github.com/espressif/arduino-esp32/pull/1961? He includes a timeout which should keep from triggering the watchdog.
Put a flush after your println. Changing baud in the middle of sending is bad.
@stickbreaker Tried, it doesn't help. @lbernstone Gsm module doesn't send data without me prompting for it so its different scenario
Serial.printf("trying baud rate: %d\n",baudRate);
delay(20);//ADD DELAY
Serial2.end();
delay(20);//ADD DELAY
Serial2.begin(baudRate, SERIAL_8N1, 16, 12, false);
delay(20); //ADD DELAY
Serial2.println("AT");
i++;
@NickChungVietNam Tried it, makes baud rate negotiation more stable when 460800 rate is excluded from list. With 460800 still getting said exception.
@NickChungVietNam Tried it, makes baud rate negotiation more stable when 460800 rate is excluded from list. With 460800 still getting said exception.
You need define type 460800 in "usigned long" or (uint32_t). To check the current baudrate value , use Serial.printf("Serial2 = %d \n" , Serial2.baudRate() );
I don't think unsigned long or int makes a difference in that case. int max value on esp32 is 2147483647
See this ::begin
Did you try like this ?Serial2.begin(460800 );
I updated arduino-esp32 to latest commit as I saw some serial related code was merged recently. Seems to work without crash when small delay is added after Serial.end() !
Im still experiencing problem. I narrowed it down to uartEnableInterrupt call from uartAttachRx. Seems uartEnableInterrupt is getting deadlock for some reason
Closing as I don't need to do trick with Serial.begin/end. Im using changeBaudRate introduced in #2223
Hardware:
Board: ESP32 OLED V2.0 TTGO Core Installation/update date: 04.11.2018 IDE name: Visual Micro Flash Frequency: 40Mhz PSRAM enabled: no Upload Speed: 115200 Computer OS: Windows 10
Description:
I'm building a library for sim800l modem which needs to find it's current baudrate. Guru meditation error occurs when program try to iterate through baudrates for the second time. It seems that Serial.begin hangs sometimes.
When im not initializing Wire in setup, Guru meditation error does not occur but Serial.begin is stuck anyway.
Debug Messages: