ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2.01k stars 638 forks source link

display.init() crashes serial on ESP32-C3-01M #379

Closed EBTEAM3 closed 1 year ago

EBTEAM3 commented 1 year ago

Hi, I am having a bit of an issue using this screen library with an ESP32-C3-01M using version 2.0.6 for the ESP core. I am using a 64x32 white screen over I2C connected to pin 21 and 20 respectively. I am using a TTL converter to upload and handle the serial to the ESP. Serial works perfectly before running display.init(); but after it I only get random characters printed once, even if there is a continuous serial print happening. As far as I can tell, Serial is the only thing which stops working, the screen still continues to update and the normal loop happens as expected. Code to recreate this:

#include <Wire.h>
#include "SSD1306Wire.h"
SSD1306Wire display(0x3c, 21, 20, GEOMETRY_64_32);
void setup() {
  Serial.begin(115200);
  Serial.println("hi");
  Serial.println("hi");
  Serial.println("hi");
  delay(50);
  display.init();
}

void loop() {
  Serial.println("hi");
}

This what gets printed: image

Any help for this issue would be much appreciated.

EBTEAM3 commented 1 year ago

Found the issue, seems that using the secondary UART port for the screen (i2c) has some effect on the main one used for serial, so I just changed the pins and vola! It sometimes even crashed the chip so very happy I found it.