Skip to content

Conversation

@toonst
Copy link
Contributor

@toonst toonst commented Jan 5, 2024

Add support for display on stm32h750b_dk. samples/drivers/display is compiling and flashing correctly now. Still getting a white screen however, will investigate when I have some free time.
This is git based on #67120 and #67221

devicetree definition for quad spi

Signed-off-by: Toon Stegen <[email protected]>
@toonst toonst force-pushed the stm32h750b_dk_display branch 2 times, most recently from 44df81e to 8bfb1fe Compare January 10, 2024 09:34
@kartben
Copy link
Contributor

kartben commented Jan 10, 2024

@toonst you need to enable the memory controller for sdram to actually be available :) Something like:

if DISPLAY
# MEMC needs to be enabled in order to store
# display buffer to external SDRAM connected to FMC
config MEMC
default y
endif # DISPLAY

BTW, looking at https://github.com/STMicroelectronics/stm32h750b-dk-bsp/blob/main/stm32h750b_discovery_sdram.h#L22, the SDRAM might rather be SDRAM2, available at 0xd0000000?

Similarly, memory config might need some updating? https://github.com/STMicroelectronics/stm32h750b-dk-bsp/blob/main/stm32h750b_discovery_sdram.c#L191-L208

128 Mbit sdram devicetree definition

Signed-off-by: Toon Stegen <[email protected]>
ltdc devicetree definition

Signed-off-by: Toon Stegen <[email protected]>
@toonst toonst force-pushed the stm32h750b_dk_display branch from 8bfb1fe to 09118c0 Compare January 11, 2024 17:32
@toonst toonst marked this pull request as ready for review January 16, 2024 09:38
@zephyrbot zephyrbot added the platform: STM32 ST Micro STM32 label Jan 16, 2024
@toonst
Copy link
Contributor Author

toonst commented Jan 16, 2024

@kartben
Fixed the Kconfig and the SDRAM configuration. samples/drivers/display is compiling and flashing correctly now. Still getting a white screen however, will investigate when I have some free time.

@erwango erwango added the block: HW Test Testing on hardware required before merging label Jan 16, 2024
@erwango
Copy link
Member

erwango commented Jan 16, 2024

@kartben Fixed the Kconfig and the SDRAM configuration. samples/drivers/display is compiling and flashing correctly now. Still getting a white screen however, will investigate when I have some free time.

Adding "Block HW Test" tag to notify this work is not yet ready to review.

@toonst Please update PR description if not accurate anymore. In general PR description should contain description of the change (what you're adding) and a note on status if not ready, which can be updated, with more details on the follow up messages. Alternatively, if submitting a work which is not complete yet, please use "Draft" PR.

@toonst
Copy link
Contributor Author

toonst commented Jan 16, 2024

@erwango Thanks. The title still accurately describes what this PR is about. Maybe this is not clear because the changed files also contain changes of two other PRs that this PR is based on.

@ajarmouni-st ajarmouni-st self-requested a review January 17, 2024 14:16
@ajarmouni-st
Copy link
Contributor

@erwango Thanks. The title still accurately describes what this PR is about. Maybe this is not clear because the changed files also contain changes of two other PRs that this PR is based on.

@toonst since the PR's title says "add support for display", but we are still getting a white screen when running the display sample, that means the PR is still a work in progress & not ready for review.

@ajarmouni-st ajarmouni-st marked this pull request as draft January 17, 2024 14:34
@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Mar 23, 2024
@github-actions github-actions bot closed this Apr 6, 2024
@pcornu
Copy link

pcornu commented May 17, 2024

Hi :-)
I manage to make the display example running based on @toonst display patch + few changes: disp-on-gpios (D7), pll3, ltdc pixel clock, and sdram2 as external-sdram.
https://gist.github.com/pcornu/45809dff1ae4121da2a6f7384f10d2d6
I will try to find more time next week to fully check ltdc node: pinctrl, blanking values, backlight gpio...
Have fun & many thanks,
Philippe :-)

@erwango
Copy link
Member

erwango commented May 17, 2024

Hi :-)

I've seen this face somewhere ;)
Great, we'll welcome your contribution!

@toonst
Copy link
Contributor Author

toonst commented May 18, 2024

Hi @pcornu, thanks for your improvements. I've added them in a commit and updated the branch here main...toonst:zephyr:stm32h750b_dk_display. For some reason this PR doesn't reflect these changes (probably becaus it is closed).

@toonst
Copy link
Contributor Author

toonst commented May 18, 2024

Btw, I again get some linking errors with that version when building west build -b stm32h750b_dk zephyr/samples/drivers/display:

[138/143] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map zephyrproject/build/zephyr/zephyr_pre0.map
: && ccache zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -fuse-ld=bfd  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=zephyrproject/build/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/drivers/interrupt_controller/libdrivers__interrupt_controller.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/display/libdrivers__display.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/reset/libdrivers__reset.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/stm32/stm32cube/lib..__modules__hal__stm32__stm32cube.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L"zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp"  -Lcode/zephyrproject/build/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m7  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -DPICOLIBC_LONG_LONG_PRINTF_SCANF  --specs=picolibc.specs  -lc  -lgcc && cd zephyrproject/build/zephyr && /opt/homebrew/Cellar/cmake/3.29.1/bin/cmake -E true
zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: warning: orphan section `.stm32_sdram2' from `zephyr/drivers/display/libdrivers__display.a(display_stm32_ltdc.c.obj)' being placed in section `.stm32_sdram2'
ephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `.stm32_sdram2' will not fit in region `IDT_LIST'
zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: section .stm32_sdram2 VMA wraps around address space
zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `IDT_LIST' overflowed by 228513 bytes
collect2: error: ld returned 1 exit status

I remember having this issue before, but forgot how it was resolved

@pcornu
Copy link

pcornu commented May 21, 2024

Hi, I tested the patch just now on the main branch (sha1 id b21b50b) and it works fine. I only have 2 build warnings linked to quadspi dt node but it is not linked to the display patch.
As written last friday, I will take some time this week to do more checks :-)
Thanks :-)

@ajarmouni-st
Copy link
Contributor

Btw, I again get some linking errors with that version when building west build -b stm32h750b_dk zephyr/samples/drivers/display:

I remember having this issue before, but forgot how it was resolved

@toonst west build -p always -b... could solve the issue.

@ajarmouni-st
Copy link
Contributor

@toonst @pcornu just tested it on my board, samples/drivers/display is working like a charm

Here is the branch rebased on b21b50b
https://github.com/ajarmouni-st/zephyr_dev/tree/dev_stm32h750b_dk_display

@ajarmouni-st
Copy link
Contributor

For some reason this PR doesn't reflect these changes (probably becaus it is closed).

@toonst yes you need to reopen the PR to see the updates to the branch.

@toonst
Copy link
Contributor Author

toonst commented May 21, 2024

I didn't cherry-pick the complete patch before, it is working now. New PR with patch by @pcornu available here: #73107 (I can't seem to re-open this one).

@pcornu
Copy link

pcornu commented May 24, 2024

My check results: pinctrl are fine, timings are fine excepted "de-active" that should be 1 instead of 0, fixing the screen artifact on the right hand side of the panel, pll3 values looks fine, pixel clocks is around ((25/5)*192)/99=9.7Mhz that is fine.

-		de-active = <0>;
+		de-active = <1>;

Hope it helps :-)
Philippe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Display block: HW Test Testing on hardware required before merging platform: STM32 ST Micro STM32 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants