OLED SSD1306_SWITCHCAPVCC Display getting stuck

I have this code snippet to display with my 128x32 pixel OLED display. It works wo far and I can display my stuff.

But often, my Arduino get stuck. Then I can see

PRE

log message, but not

POST

void display2Rows(char firstRow[10], char secondRow[10]) {
  Serial.println("---- PRE ----");
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(5, 0);
  display.cp437(true);
  display.println(firstRow);
  display.setCursor(5, 16);
  display.cp437(true);
  display.println(secondRow);
  display.display();
  Serial.println("---- POST ----");
}

So it looks like it get stuck somewhere in between.. Further debugging shows that the code is executed until display.display();
This is not executed.

Anyone has any advise for me?

Thank you in advance

L3spaul

Maybe a missing zero terminator error. But we can't know, as you didn't post the complete code!

Thanks for using code windows!

Please post a link to your actual display.
Please paste / attach a complete sketch.

SSD1306 can control a 128x64 OLED. 128x32 is fine. 132x32 is not possible.

David.