Skip to content

Panel_M5HDMI: count the command sent right after a busy wait - #372

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:m5hdmi_busy_count
Oct 21, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:m5hdmi_busy_count

Conversation

@ainyan03

Copy link
Copy Markdown
Contributor

Panel_M5HDMI::_check_busy() reset _total_send to 0 after a busy wait, so the command it was called for went uncounted. After a long COPYRECT, the next _set_window(force) saw _total_send == 0, skipped the busy check and streamed the pixel data while the FPGA was still copying. The FPGA buffers about 2 KB of received bytes and drops the rest, so the WRITE_RAW never received all its pixels: Module Display then answers busy (0x00) until it is power-cycled; resetting the host does not recover it.

The fix counts that command (_total_send = length), so the next forced check waits for the copy to finish.

Test (ESP32-P4 + Module Display, bundled bitstream, 1280x720 24bpp, SPI 80 MHz): copyRect 617x341 followed by a 76x71 RGB888 pushImage hung 3 of 3 times before this change and 0 of 3 after. The bytes sent to the panel were recorded to confirm that the pixel stream followed the COPYRECT without a busy check.

Local build check across the upstream CI versions passed; fork CI passed.

_check_busy() reset _total_send to 0 after waiting, so the command it
was called for went uncounted. After a long COPYRECT the next
_set_window(force) skipped the busy check and streamed the pixel data
while the FPGA was still copying. The FPGA keeps about 2 KB of received
bytes and drops the rest, so the WRITE_RAW never got all its pixels and
the display answered busy until it was power-cycled.

Seen on ESP32-P4 with Module Display (bundled bitstream) at 1280x720
24bpp: copyRect 617x341 followed by a 76x71 RGB888 pushImage hung 3 of
3 times; with this change 0 of 3.
@lovyan03
lovyan03 merged commit 88e7ba9 into m5stack:develop Oct 21, 2026
25 checks passed
@ainyan03 ainyan03 mentioned this pull request Oct 25, 2026
@ainyan03
ainyan03 deleted the m5hdmi_busy_count branch October 25, 2026 02:31
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.

2 participants