Picking up and old thread, I know, but I’m having a similar issue with an oled screen - not with static on the screen, but occasionally on booting the saber , the screen just doesn’t start up. Shutdown the saber, reboot again and it works.
There isn’t a 100 percent definitive pattern, but the problem does seem more likely if the saber has been powered off for any length of time (i.e. more than a few minutes). Once it’s worked once, you can keep booting and shutting down in relatively quick succession and it keeps working. But if you leave ti for a while, odds are the first boot won’t work.
I’m horribly afraid it’s hardware, but as it will be fiddly to replace, I just wanted to exhaust any potential software hacks first.
I can only wild guess at the moment.
What if you add a boot delay with #define CONFIG_STARTUP_DELAY 1000
Maybe giving it a chance to receive power for a moment before being initialized helps?
Just tried 1000. Still no good. It does seem to be the first boot after standing for a while pretty consistently.
So unless I can hack the code to send two boot commands in quick succession (which I suspect in reality would cause more problems than it solves, even if I could figure out how to do it) it looks like I’m going to have to swap it out! Sigh!
C’est la vie - no rest for the smiths! LOL!
Thanks for your help Brian - appreciated as always.
The problem might be in the star sequence itself.
The display has three different off states, but the code only uses one of them during standby.
Maybe transitioning from real off requires larger timeouts than transitioning from standby?
(Although I don’t think the display would remain in standby for more than a second when power is turned off…)
Another possibility would be that there is a register on the display that ends up in a random state, and the Proffie bootup sequence doesn’t reset that particular register for some reason.
The sequence of commands sent to the display on startup lives here:
Once upon a time this was written based on the adafruit ssd1306 library, and it’s startup sequence can be seen here:
Theirs have changed a bit since then. Wonder if mirroring those changes would help?