-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display sometimes gets messed up with Teensy 4 #64
Comments
FWIW there was a similar issue in the OG firmware. At least the symptoms match :) The cause there was app processing in the ISR handler taking too long occasionally. This shifted the timing for the next two ISRs (one is short and late, then the next back on time, if that makes sense). It would then toggle the CS pin and update the DAC before the screen transfer was complete -- it wasn't waiting, just assumed it would be fine, so waiting for completion fixed it. I might have a `scope shot somewhere, I eventually I tracked it down by triggering on deviation from the normal ISR timing. |
@PaulStoffregen
where 'd' is DAC update, 'xxxx' the 128byte screen DMA, 'a' app processing which happens in parallel to DMA. |
The DMA transfer corruption theory seems quite plausible. Another theory: maybe something is somehow drawing graphics out of bounds, occasionally corrupting memory beyond the framebuffer? |
There were some paths in the graphics code that don't clip so that's not impossible :) The original fix (and a gfx bugfix) are in this branch On the OG o_C the corruption was pretty random even if the app was fairly consistently using too much time (e.g. Piqued was pretty high load). IIRC it became more obvious (i.e. no longer ignorable) after a compiler change which probably shifted some timing around. Since it doesn't recover I assume it's mostly the DC pin being inconveniently toggled and reconfiguring something... |
So from a quick skim (I don't have hardware here to run anything) it looks to me like the new implementation is susceptible to the same scenario. At least if I'm parsing the
I think At test of the theory (and fix) might be to simulate a "complex app" with a delay of 100us in every 1000th ISR call? |
I am a brand new o_C user with a new module that uses a teensy 4.0. I've also observed these display glitches, and was also mucking around with the game of life applet around the time it glitched out. Anything I can do to help debug? I am new to the teensy but not to dev. I will try to get a build with the patch above to see if I can reproduce it. It's still a lot of fun so far though - thanks! |
@grsr This build has the patch: https://github.com/djphazer/O_C-Phazerville/actions/runs/8614265432 Or if you get your toolchain set up, build from the |
Thanks @djphazer - I have installed your build and haven't seen any glitches yet. In particular the scope applet seems to behave more like I would expect (yesterday I saw some glitches there as well). I don't see the potentially problematic game of life applet in hemispheres any more, so haven't tested that. Did you remove it from the build? |
Passencore is also display crashing as soon as you plug some trigger or cv in - v1.7 Teensy 4.0 |
This is fixed in v1.7.1 with patch #66 The display doesn't crash on Teensy 4.x anymore, but excessive processing can cause timing inaccuracies. Eventually, it should be tested/profiled to see how bad it is and maybe correct it. |
Pretty sure I made a mistake somewhere in the display driver for Teensy 4. Happens only rarely, but when it does the screen gets reversed or swapped or garbled.
HELP WANTED with finding ways to reproduce the problem. Game/Life applet (removed) was said to sometimes cause it, in Discord conversation on Feb 6, 2024.
The text was updated successfully, but these errors were encountered: