Skip to content

touch and display example for STM32F469I-DISCO B08 board revision (NT35510 LCD controller)#843

Closed
Amperstrand wants to merge 16 commits intostm32-rs:masterfrom
Amperstrand:NT35510
Closed

touch and display example for STM32F469I-DISCO B08 board revision (NT35510 LCD controller)#843
Amperstrand wants to merge 16 commits intostm32-rs:masterfrom
Amperstrand:NT35510

Conversation

@Amperstrand
Copy link

@Amperstrand Amperstrand commented Jun 22, 2025

Summary

This PR adds NT35510 LCD controller support for the STM32F469I-DISCO B08 board revision, enabling both display and touch functionality.

I'm not much of a rust person, and my main goal was just trying to get it to work (which it now does). The code has been restructured into what I hope are clean, reusable commits with proper attribution to the original sources.

What's Included

Commits:

  1. feat(ltdc): DSI constructor, framebuffer DrawTarget, and layer management APIs
  2. feat(display): NT35510 driver and F469DISCO board init helpers
  3. feat(examples): F469DISCO display examples with runtime panel autodetection
  4. fix(examples): Improved lcd-test panel detection and init sequence

Attribution:

  • NT35510 init sequence based on diybitcoinhardware/f469-disco (MIT license)
  • Display timing and patterns from STMicroelectronics STM32CubeF4 BSP (BSD-3-Clause)

Hardware Tested

  • ✅ STM32F469I-DISCO B08 revision (NT35510 LCD panel)
  • ✅ Display initialization and test patterns
  • ✅ Touch controller (FT6X06) calibration and input

Questions

NT35510 could possibly be its own crate like otm8009a is, or alternatively it could live in src/display/ as I've structured it here. Open to feedback on the best approach.

Copy link
Contributor

@tegimeki tegimeki left a comment

Choose a reason for hiding this comment

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

Glad to see support for the newer display, and have some comments on compatibility with the older one. A more modular BSP-level display support approach might resolve these issues, allowing code to first probe the display type with a minimal DSI host config and then initialize for the specific display from there.

Comment on lines +89 to +90
// Try to read RDID1 register - we don't care about the data, just if the command responds
// This matches the C reference behavior: nt35510_read_reg with length 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the OTM8009A display does actually respond to this query, and returns 0x40. To make this example run on a board with that display (the only one I have), it was necessary to check the value... but since I don't have the NT35510 display I can't tell what the expected value actually is. The ST Micro C code looks incorrect though, as it seems to check against 0x00 so maybe the check should be explicit here.

None,
PixelFormat::ARGB8888,
DISPLAY_CONFIGURATION,
NT35510_DISPLAY_CONFIG, // NT35510 timing works for both controllers
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the one board I tested on, it's true that this config works for ORM8009A, but is probably not optimal for that display given the longer sync times v.s. the spec. Since probing can't be done until the DSI interface is up, which requires the timing to already be known, I wonder if a #[cfg] for the display type would be better, even though it's not dynamic (i.e. you would need to target specific hardware v.s. detect at runtime)?

Copilot AI and others added 5 commits February 10, 2026 07:12
…-lcd-test

Co-authored-by: Amperstrand <141745238+Amperstrand@users.noreply.github.com>
…ottle helper

Co-authored-by: Amperstrand <141745238+Amperstrand@users.noreply.github.com>
…xtract I2C address constant

Co-authored-by: Amperstrand <141745238+Amperstrand@users.noreply.github.com>
…mplementations

Port multi-controller support and touchscreen integration from reference implementation
@tegimeki
Copy link
Contributor

I tried your latest on a B01 board with the OTM8009A display: it looks good with auto-detect but when running with otm8009a-only I see a black stripe down one side of the display. I haven't looked closely yet but can do that, unless you already know/expect the behavior there.

Also, I get detect_touch timed out after 3 attempts output continuously and can double-check that my touch controller is still working (it was last I tried a while back).

Cargo.toml Outdated
i2c3 = []
lptim1 = []
ltdc = ["dep:micromath"]
nt35510-only = []
Copy link
Member

Choose a reason for hiding this comment

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

I'm not happy with example related features here.

Maybe we should restructure examples directory to have its own Cargo.toml.
Integrate xtask maybe like in github.com/esp-rs/esp-hal/ ?

Copy link
Author

Choose a reason for hiding this comment

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

Apologies for spamming the pull request with AI generated content. At this point I am mostly experimenting and probably won't get back to it in the near future. NT35510 doesn't have its own crate like otm8009a does, but maybe it should.

My main goal was really mostly just to get the stm32f469 going with all revisions in a way where it's easy to just get it working

Copy link
Member

Choose a reason for hiding this comment

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

You could convert the PR into draft until it is complete.

Copilot AI and others added 6 commits February 15, 2026 05:18
Co-authored-by: Amperstrand <141745238+Amperstrand@users.noreply.github.com>
Resolve rustfmt/changelog CI failures in STM32F469 Disco display-touch updates
Co-authored-by: Amperstrand <141745238+Amperstrand@users.noreply.github.com>
fix(display): align OTM8009A LTDC timing with ST reference values on F469-DISCO
amperstand added 2 commits February 26, 2026 16:25
- Add 20ms delay after DSI bus turnaround for panel link settle
- Add 20ms settle delay in detect_lcd_controller before probing
- Move I2C init before LCD reset (proper hardware sequencing)
- Fix smart fallback: default to NT35510 when probe inconclusive
  (previously incorrectly fell back to OTM8009A on B08 boards)

Tested on STM32F469I-DISCO B08 (NT35510 panel) - display now works.
- Remove f469disco-animated-layers.rs (was showing green screen due to
  transparent layer config issue)
- Remove from Cargo.toml
- Add f469disco-touch-debug.rs for interactive touch calibration
- Add TOUCH_X_OFFSET / TOUCH_Y_OFFSET constants to paint.rs
  for future calibration adjustments
@Amperstrand
Copy link
Author

Closing in favor of two cleaner, split PRs: one for core DSI/LTDC improvements and one for F469-Disco examples. The NT35510 driver has been extracted to a standalone crate (https://crates.io/crates/nt35510).

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.

4 participants