touch and display example for STM32F469I-DISCO B08 board revision (NT35510 LCD controller)#843
touch and display example for STM32F469I-DISCO B08 board revision (NT35510 LCD controller)#843Amperstrand wants to merge 16 commits intostm32-rs:masterfrom
Conversation
tegimeki
left a comment
There was a problem hiding this comment.
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.
examples/f469disco-lcd-test.rs
Outdated
| // 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 |
There was a problem hiding this comment.
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.
examples/f469disco-lcd-test.rs
Outdated
| None, | ||
| PixelFormat::ARGB8888, | ||
| DISPLAY_CONFIGURATION, | ||
| NT35510_DISPLAY_CONFIG, // NT35510 timing works for both controllers |
There was a problem hiding this comment.
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)?
…-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
|
I tried your latest on a B01 board with the OTM8009A display: it looks good with auto-detect but when running with Also, I get |
Cargo.toml
Outdated
| i2c3 = [] | ||
| lptim1 = [] | ||
| ltdc = ["dep:micromath"] | ||
| nt35510-only = [] |
There was a problem hiding this comment.
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/ ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
You could convert the PR into draft until it is complete.
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
- 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
|
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). |
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:
feat(ltdc): DSI constructor, framebuffer DrawTarget, and layer management APIsfeat(display): NT35510 driver and F469DISCO board init helpersfeat(examples): F469DISCO display examples with runtime panel autodetectionfix(examples): Improved lcd-test panel detection and init sequenceAttribution:
Hardware Tested
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.