Skip to content

Do not perform redundant reset on ST7789 displays#2475

Open
JosiahWI wants to merge 1 commit intomeshcore-dev:devfrom
uwl-cpe-2025:fix/ST7789-reset-timing
Open

Do not perform redundant reset on ST7789 displays#2475
JosiahWI wants to merge 1 commit intomeshcore-dev:devfrom
uwl-cpe-2025:fix/ST7789-reset-timing

Conversation

@JosiahWI
Copy link
Copy Markdown

@JosiahWI JosiahWI commented May 4, 2026

The ::init method in the Adafruit ST7789 library is responsible to initialize the device. This includes performing a reset, which can be found in the Adafruit source for Adafruit_SPITFT.

Before this change, MeshCore performed its own ST7789 display reset sequence, which consisted of three steps.

  • Pull reset low
  • Wait 10ms
  • Pull reset high

Importantly, there was no fixed delay after pulling reset high. The ST7789 driver requires a delay (TRT) of 5ms in Sleep In Mode and 120ms in Sleep Out Mode before it will properly receive commands. When Adafruit_SPITFT resets the device after MeshCore has already reset it, the mandatory time may not have elapsed, leading to strange behavior. In the author's case, this issue caused the initial fillScreen to fail, such that the display showed an uninitialized framebuffer.

This removes the MeshCore delay, leaving the responsibility of reset to Adafruit_SPITFT, where they have the correct delays in place with extra safety margin. The change was briefly tested by Josiah VanderZee and Ben Zignego on a custom hardware build using an nRF52840 Dongle and an Adafruit 4311 TFT display. The user button seemed to behave strangely, but the display looked correct.

The `::init` method in the Adafruit ST7789 library is responsible to
initialize the device. This includes performing a reset, which can be
found in the Adafruit source for `Adafruit_SPITFT`.

Before this change, MeshCore performed its own ST7789 display reset
sequence, which consisted of three steps.

* Pull reset low
* Wait 10ms
* Pull reset high

Importantly, there was no fixed delay after pulling reset high. The
ST7789 driver requires a delay (T<sub>RT</sub>) of 5ms in Sleep In Mode
and 120ms in Sleep Out Mode before it will properly receive commands.
When `Adafruit_SPITFT` resets the device after MeshCore has already
reset it, the mandatory time may not have elapsed, leading to strange
behavior. In the author's case, this issue caused the initial
`fillScreen` to fail, such that the display showed an uninitialized
framebuffer.

This removes the MeshCore delay, leaving the responsibility of reset to
`Adafruit_SPITFT`, where they have the correct delays in place with
extra safety margin. The change was briefly tested by Josiah VanderZee
and Ben Zignego on a custom hardware build using an nRF52840 Dongle and
an Adafruit 4311 TFT display. The user button seemed to behave
strangely, but the display looked correct.
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