Skip to content

Fix SPI initialization for libopencm3 update #268

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

avion23
Copy link

@avion23 avion23 commented Jun 29, 2025

Summary

Fixes black screen issue caused by commit c52ebac which updated libopencm3 and changed SPI reset method.

Root Cause

Commit c52ebac replaced spi_reset(SPI2) with rcc_periph_reset_pulse(RST_SPI2) during libopencm3 update. However, rcc_periph_reset_pulse() in newer libopencm3 doesn't properly complete the reset sequence, leaving SPI peripheral in undefined state and causing ILI9163C display controller initialization to fail.

Fix

Replace rcc_periph_reset_pulse(RST_SPI2) with explicit two-step reset:

  • rcc_periph_reset_hold(RST_SPI2) - Assert reset
  • rcc_periph_reset_release(RST_SPI2) - Release reset

This ensures proper reset timing and restores display functionality.

Testing

  • Tested on DPS5015 hardware with Black Magic Probe
  • Display now functions correctly after firmware flash
  • No other functionality affected

AI slop, but I tested it

Replace rcc_periph_reset_pulse() with explicit hold/release sequence
to restore display functionality after libopencm3 update.

Fixes black screen issue on DPS5015 after recent libopencm3 changes.
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