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
1.98k stars 636 forks source link

Using SSD1306Wire with multi-core ESP32 #352

Closed jerryg2003 closed 2 years ago

jerryg2003 commented 2 years ago

Just a note on how I got a multi-core ESP32 sketch using display functions to work properly.

I had successfully used SSD1306Wire with arduinos and was starting to use with ESP32s. I have a multi-task sketch to which I wanted to add display functions. Adding a start-up display of text and graphics in the setup() function worked like a charm. However, when I tried to clear and display some other text in a different task, the display only partially cleared and the text didn’t start in the place it was supposed to. After much experimenting (and hair-pulling), I tried changing the core my work task was running in and all worked fine. My prior setup had the work task in core 0 while the setup() had run in core 1. I’m not sure why this would have made a difference (both cores reference the same memory), but changing the work task to also run in task 1 solved the problem with the display clearing and the text drawing correctly.

FYI, I am using the arduino IDE.

Thanks for making this software available.

syvic commented 2 years ago

Same problem here. I'm using an specific task to drive the LCD. It that task lives on CPU 1 everything is OK, but if I move it to core 0, all I have is garbage on the screen. Using codium for develop...

syvic commented 2 years ago

Fixed by updating library from 4.1 to 4.2.1 and changing bus speed to 25000. Now the CPU 0 can handle the display, slowly but without garbage being printed.

thijstriemstra commented 2 years ago

Also see #326

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.