zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.75k stars 6.56k forks source link

Add STM32 LCD-TFT Display Controller (LTDC) Driver #15591

Closed matthew-koch closed 2 years ago

matthew-koch commented 5 years ago

Is your feature request related to a problem? Please describe. Add support for STM32's LTDC on STM32F4, F7, H7, etc.

Describe the solution you'd like Initially, an API specific to the LTDC implemented with a long-term objective of enhancing the generic display API to support more advanced LCD drivers either on-board or in-MCU while supporting smaller displays with little overhead. This driver should be modular; able to be built such that unused feature sets can be removed. The STM32 HAL will not be used (greenfield implementation). Existing generic display API will have shortcomings (e.g., pixel format support). Use shim to provide API implementation; native and generic APIs will be exclusive from each other.

Would like to support:

Other considerations for features not supported by LTDC, but are common (to support in generic API enhancements):

Describe alternatives you've considered Crayons attached to steppers.

Additional context

carlescufi commented 5 years ago

Describe alternatives you've considered Crayons attached to steppers.

🥇

matthew-koch commented 5 years ago

FYI (no response required)

If it wasn't implied in the issue writeup, I intend to take a stab at this. I'm doing development on an stm32f746g_disco board.

Will be slow going to start - Zephyr's build system has a bit of a learning curve with some tools I'm not familiar with. However, nobody seems to be pounding the table for this driver. I will try to get a PR on a couple of things that might cause ugly merges later (pinmux, device tree) done first.

matthew-koch commented 5 years ago

Quick update.

Made progress on the driver, but have gotten stuck by not having a working memory controller for external SDRAM. Didn't quite realize how sparse support for STM32 was before diving into this, so I'm having to switch gears and work on getting enough memory to handle the framebuffer and sort out the current memory mapping (DTCM vs. SRAM).

k0d commented 4 years ago

@matthew-koch I'm working on this issue, are you still interested in having this working? I've got the memory side of things working, and have some code working for the LTDC which I'll commit in a day or 2 after cleaning it up.

Checkout the pull request #23453

matthew-koch commented 4 years ago

By all means! I ran into a big project at work and haven't had a lot of time for this. I kept chasing things that weren't implemented in Zephyr (clocks, SDRAM, etc.) and this ballooned beyond what time I had. I won't be able to pick this up again until late spring or early summer, so I'd appreciate having this working.

On Fri, Mar 13, 2020 at 2:19 PM Mark Olsson notifications@github.com wrote:

@matthew-koch https://github.com/matthew-koch I'm working on this issue, are you still interested in having this working? I've got the memory side of things working, and have some code working for the LTDC which I'll commit in a day or 2 after cleaning it up.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zephyrproject-rtos/zephyr/issues/15591#issuecomment-598915800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL2SMLFKGD2EWAUCDETJ3JTRHKPMPANCNFSM4HHNEDLQ .

DRNadler commented 4 years ago

@matthew-koch , @k0d - Any update on LTDC driver? Thanks! Best Regards, Dave

akshay-dandekar commented 4 years ago

I am working on STM32F429I-DISC1. Above patches seems to be for STM32F7. Do they need to be modified for STM32F429?

Regards, Akshay

tmilkovic51 commented 2 years ago

@matthew-koch , @k0d Are you still working on this issue? I would like to open a PR with my implementation if you aren't working on yours anymore.

I managed to get the driver working with LVGL sample on STM32H7B3I_DK board. The driver uses HAL library, and supports Kconfig-configurable pixel format and frame buffer location (internal/external SRAM). So far, it only supports blocking writes to frame buffer, but I plan to add non-blocking writes with DMA2D in the future.

k0d commented 2 years ago

@tmilkovic51 I'm not working on it anymore...feel free to submit your code.

gmarull commented 2 years ago

https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/display/display_stm32_ltdc.c