Skip to content

Fix SSD130x uninitialized GDDRAM on init and guard invalid GPIO pins - #732

Open
atommarvel wants to merge 1 commit into
daisyaudio:masterfrom
atommarvel:fix/oled-init-clear-and-invalid-gpio
Open

atommarvel wants to merge 1 commit into
daisyaudio:masterfrom
atommarvel:fix/oled-init-clear-and-invalid-gpio

Conversation

@atommarvel

@atommarvel atommarvel commented Nov 19, 2026 •

Copy link
Copy Markdown

NOTICE

This is one of two PRs that provide a fix for daisyaudio/DaisyExamples#318
Beyond this section, this PR's body and the PR's code changes were generated by Google Gemini from a conversation I had with it to get examples running on a Daisy Field + Seed3 seated in it. My day job is Android development so I currently don't have the knowledge to vet these changes deeply. The testing section of this PR body is true though, I did validate all daisy field examples worked with both seed3 and seed2.

Summary

Fixes two issues causing the SSD1309 OLED on Daisy Field with a Seed3 to display uninitialized pixel static after boot when a firmware does not immediately overwrite the framebuffer, as well as guarding invalid (PORTX) GPIO pin operations:

  1. Clear OLED framebuffer & GDDRAM during Init() (src/dev/oled_ssd130x.h):
    • Restores Fill(false); Update(); in SSD130xDriver::Init() (before 0xAF Display On) and SSD1307Driver::Init() (after 0xAF).
    • This behavior was present in the legacy OledDisplay::Init() prior to PR Proof of concept for configurable OLED display support (#166) #326 (a6a8038d), and without it the SSD1309 powers on with random SRAM pixel noise whenever an application doesn't call display.Fill(false) + display.Update().
  2. Guard invalid/unconnected reset GPIO pins (src/dev/oled_ssd130x.h, src/per/gpio.cpp):
    • DaisyField::Init() passes Pin(PORTX, 0) for the OLED reset pin because Field uses hardware POR rather than a GPIO pin.
    • Added cfg_.pin.IsValid() guards to GPIO::Read(), GPIO::Write(), and GPIO::Toggle() (matching GPIO::Init() and GPIO::DeInit()), and guarded reset pin initialization/pulsing in SSD130x4WireSpiTransport::Init() and SSD130x4WireSoftSpiTransport::Init() with if(config.pin_config.reset.IsValid()).

Testing

  • Rebuilt libDaisy and tested all field examples on a Daisy Field with both Daisy Seed3 and Daisy Seed2 — OLED static is gone and examples behaved as expected.

@github-actions

Copy link
Copy Markdown

Test Results

167 tests  ±0   164 ✅  - 3   0s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     3 ❌ +3 

For more details on these failures, see this check.

Results for commit 00a21c0. ± Comparison against base commit 1289a00.

@atommarvel

atommarvel commented Nov 21, 2026 •

Copy link
Copy Markdown
Author

AI's assessment for the PR's failures:

The two failing jobs are both unrelated upstream CI issues from GitHub moving ubuntu-latest to ubuntu-26.04 (and another unrelated open PR, exact-audio-clock, hit the exact same failures).

Throwing an agent at the issue now.

@atommarvel

Copy link
Copy Markdown
Author

This should hopefully fix the CI issues: #734

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant