Skip to content

feat(examples): F469-Disco display examples with panel auto-detection#867

Closed
Amperstrand wants to merge 16 commits intostm32-rs:masterfrom
Amperstrand:pr2-f469disco-examples
Closed

feat(examples): F469-Disco display examples with panel auto-detection#867
Amperstrand wants to merge 16 commits intostm32-rs:masterfrom
Amperstrand:pr2-f469disco-examples

Conversation

@Amperstrand
Copy link

Summary

Add 6 display examples for the STM32F469I-DISCO board with runtime auto-detection of panel type (NT35510 on RevC boards vs OTM8009A on RevA boards):

  • f469disco-hello-eg — "Hello World" with embedded-graphics
  • f469disco-paint — Touch-to-draw paint application with palette
  • f469disco-slideshow — Animated color transitions
  • f469disco-image-slider — Image display demo
  • f469disco-lcd-test — Display test patterns and panel diagnostics
  • f469disco-touch-debug — Touch coordinate visualization

Shared Board Support

Board-specific initialization lives in examples/f469disco/board.rs — a shared helper module providing:

  • DSI/LTDC/panel initialization with correct PLL and timing for the F469-Disco
  • Runtime panel detection (reads LCD ID register to distinguish NT35510 vs OTM8009A)
  • Both RevA and RevC board variants supported

Key Features

  • Touch input via FT6X06 I2C touch controller with panic-safe initialization
  • IWDG watchdog in paint example for crash recovery
  • DSI error diagnostics — periodic ISR register polling for debugging
  • defmt-optional — all examples compile with and without the defmt feature
  • RGB565 pixel format for optimal performance

Dependencies

Testing

  • All 6 examples compile with cargo check --features=stm32f469,stm32-fmc,framebuffer,dsihost --examples
  • Examples compile both with and without defmt feature
  • Hardware tested on STM32F469I-DISCO RevC (NT35510) — 1,735 touch events over 6 minutes, 0 errors
  • memory.x updated to STM32F469NIH6 values (2048K Flash, 320K RAM)

Supersedes #843 (split into focused PRs). Requires #866 to be merged first.

@Amperstrand Amperstrand marked this pull request as draft February 28, 2026 04:21
amperstand and others added 13 commits March 2, 2026 21:19
The ft6x06 v0.1.2 crate panics when the touch controller reports
more than FT6X06_MAX_NB_TOUCH (2) simultaneous touches, which can
happen due to electrical noise or ghost touches.

This patch applies PR #5 (commit cc352f8) which clamps the touch
count instead of asserting, preventing device crashes.

Refs: Srg213/ft6x06#4
Refs: Srg213/ft6x06#5

Testing: cargo check passes with patched dependency
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The FT6X06 touch interrupt is active-LOW and requires a pull-down
resistor for a defined idle state. Without this, the pin floats and
wait_touch_interrupt() never returns properly.

The sdio::init() function returns PC1 for touch interrupt use, but
was returning it without any pull configuration. Now configures
it as pull-down input before returning.
When building a BSP that depends on the HAL, both build.rs scripts
were running and potentially conflicting. Now the HAL only generates
memory.x when it's the primary package being built.

BSPs have their own board-specific memory.x (flash/RAM sizes vary
by chip package) and should use that instead of the HAL's generic
defaults.
Complete BSP for STM32F469I-DISCO board including:
- build.rs with memory.x generation
- memory.x for F469 (2M flash, 320K RAM)
- Examples: display, touch, SDRAM, GPIO
- README with usage instructions
- Embed.toml for probe-rs
- License (0BSD)
For future AI agents using this HAL:

- PIN-CONSUMPTION.md: Documents which 52 pins SDRAM consumes and
  which remain available (PC1, PC8-12, PD2, PH7). Hardware constraint
  not obvious from code.

- USB-GUIDE.md: USB OTG FS setup with 48MHz PLL48CLK requirement,
  CDC-ACM pattern, and troubleshooting table. The USB module IS
  functional (contrary to previous misinformation).

- usb_cdc_serial.rs: Working CDC-ACM example that compiles and
  demonstrates virtual serial port with echo test.

- README.md: Updated with correct doc links and USB example.

- Cargo.toml: Added USB dev-dependencies (usb-device, usbd-serial,
  static_cell).
Allows external code to change SDIO clock speed after initialization.
This is needed for SDXC cards that require 400KHz for init but can
benefit from higher speeds (e.g., 12MHz) for data transfer.
@Amperstrand Amperstrand closed this Mar 7, 2026
@Amperstrand Amperstrand deleted the pr2-f469disco-examples branch March 7, 2026 16:04
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