Skip to content

Fix some DisplayIO crashes, add ESP32-S2 debugging capability #3392

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

Merged
merged 5 commits into from
Sep 14, 2020
Merged

Fix some DisplayIO crashes, add ESP32-S2 debugging capability #3392

merged 5 commits into from
Sep 14, 2020

Conversation

hierophect
Copy link
Collaborator

This PR fixes null reference exceptions in DisplayIO related to the use of I2CDevice, which were causing crashes if the user entered the wrong I2C address for an I2C OLED screen, or did not include a reset pin in the construct function. These issues were identified by @ladyada in #3334, but were apparently occurring across all ports, not just the ESP32-S2.

This PR also adds an openocd configuration file and linker flag required to use GDB with the ESP32-S2, which assisted in tracking this issue. Correct behavior has been tested and confirmed using the I2C OLED Featherwing on the ESP32-S2 Saola Wrover and STM32F405 Feather Express. Test script here.

I snooped around DisplayIO a little looking for similar possible null reference exceptions. The only definite one I found was for the optional FourWire reset pin, but I'm wary of the Fourwire reset and other DisplayIO resets that assume a valid display object - there's no specific error that "skips" setting required variables in the construct function, the way there was for I2CDisplay, but maybe there are other ways to create an incomplete displayio object? It might be worth adding in a bunch of pointer validity checks, even if they're redundant most of the time.

Resolves #3334

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor things. Thanks for the fixes! Nice job finding them!

@hierophect hierophect mentioned this pull request Sep 14, 2020
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks great!

@tannewt tannewt merged commit a60906d into adafruit:main Sep 14, 2020
@hierophect hierophect deleted the esp32-displayio-fix branch September 14, 2020 21:57
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.

ESP32-S2: Null reference exception somewhere in DisplayIO
3 participants