Skip to content

Commit 14dc474

Browse files
committed
boards: st: add pllsai for ltdc & mipi-dsi support on stm32f469 disco
Extension of support of pllsai for display configuration of stm32f469 discovery board. Enable Display panel through LTDC & DSI-HOST blocks. Enable Touch screen. Enable FMC/SDRAM for Framebuffer. Signed-off-by: Philippe Peurichard <[email protected]>
1 parent 9b59ccd commit 14dc474

File tree

6 files changed

+152
-0
lines changed

6 files changed

+152
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Copyright 2025 P. Peurichard
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
# Add custom linker section to relocate framebuffers to PSRAM
8+
zephyr_linker_sources_ifdef(CONFIG_LV_Z_VDB_CUSTOM_SECTION
9+
SECTIONS dc_ram.ld)

boards/st/stm32f469i_disco/Kconfig.defconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,36 @@ config SPI_STM32_INTERRUPT
99
default y
1010
depends on SPI
1111

12+
if LVGL
1213

14+
# Double frame buffer maintained by lvgl.
15+
config STM32_LTDC_FB_NUM
16+
default 0
17+
18+
config LV_Z_DOUBLE_VDB
19+
default y
20+
21+
config LV_Z_VDB_CUSTOM_SECTION
22+
default y
23+
24+
config LV_Z_FULL_REFRESH
25+
default y
26+
27+
config INPUT
28+
default y
29+
30+
config LV_Z_BITS_PER_PIXEL
31+
default 32
32+
33+
config LV_DPI_DEF
34+
default 128
35+
36+
config LV_Z_FLUSH_THREAD
37+
default y
38+
39+
choice LV_COLOR_DEPTH
40+
default LV_COLOR_DEPTH_16
41+
endchoice
42+
43+
endif #LVGL
1344
endif # BOARD_STM32F469I_DISCO
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2025 P. Peurichard
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(sdram1), okay)
8+
GROUP_START(SDRAM1)
9+
10+
SECTION_PROLOGUE(_STM32_SDRAM1_SECTION_NAME, (NOLOAD),)
11+
{
12+
*(.lvgl_buf)
13+
} GROUP_LINK_IN(SDRAM1)
14+
15+
GROUP_END(SDRAM1)
16+
#endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Philippe Peurichard <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Initialize after LTDC and MIPI-DSI
5+
CONFIG_DISPLAY_OTM8009A_INIT_PRIORITY=87

boards/st/stm32f469i_disco/stm32f469i_disco.dts

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
zephyr,sram = &sram0;
2121
zephyr,flash = &flash0;
2222
zephyr,ccm = &ccm0;
23+
zephyr,display = &ltdc;
24+
zephyr,touch = &ft5336;
2325
};
2426

2527
sdram1: sdram@c0000000 {
@@ -53,6 +55,12 @@
5355
};
5456
};
5557

58+
lvgl_pointer {
59+
compatible = "zephyr,lvgl-pointer-input";
60+
input = <&ft5336>;
61+
invert-y;
62+
};
63+
5664
gpio_keys {
5765
compatible = "gpio-keys";
5866

@@ -86,6 +94,17 @@
8694
mul-n = <336>;
8795
div-p = <2>;
8896
div-q = <7>;
97+
div-r = <6>;
98+
clocks = <&clk_hse>;
99+
status = "okay";
100+
};
101+
102+
&pllsai {
103+
div-m = <8>;
104+
mul-n = <266>;
105+
div-p = <2>;
106+
div-r = <5>;
107+
div-divr = <2>;
89108
clocks = <&clk_hse>;
90109
status = "okay";
91110
};
@@ -116,6 +135,13 @@
116135
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
117136
pinctrl-names = "default";
118137
status = "okay";
138+
139+
ft5336: ft5336@2a {
140+
compatible = "focaltech,ft5336";
141+
reg = <0x2a>;
142+
int-gpios = <&gpioj 5 0>;
143+
status = "okay";
144+
};
119145
};
120146

121147
&spi2 {
@@ -199,3 +225,59 @@ zephyr_udc0: &usbotg_fs {
199225
};
200226
};
201227
};
228+
229+
&mipi_dsi {
230+
status = "okay";
231+
otm8009a: otm8009a@0 {
232+
status = "okay";
233+
compatible = "orisetech,otm8009a";
234+
reg = <0x0>;
235+
height = <800>;
236+
width = <480>;
237+
reset-gpios = <&gpioh 7 0>;
238+
bl-gpios = <&gpioa 3 0>;
239+
data-lanes = <2>;
240+
pixel-format = <MIPI_DSI_PIXFMT_RGB888>;
241+
rotation = <90>;
242+
};
243+
244+
/* DSI HOST dedicated PLL
245+
* F_VCO = CLK_IN / pll-idf * 2 * pll-ndiv
246+
* PHI = F_VCO / 2 / (1 << pll-odf) = lane_byte_clk
247+
* = 8 MHz / 2 * 2 * 125 / 2 / (1<<0) / 8 = 62.5 MHz
248+
*/
249+
pll-ndiv = <125>;
250+
pll-idf = <2>;
251+
pll-odf = <0>;
252+
253+
vs-active-high;
254+
hs-active-high;
255+
de-active-high;
256+
};
257+
258+
&ltdc {
259+
status = "okay";
260+
width = <800>;
261+
height = <480>;
262+
pixel-format = <PANEL_PIXEL_FORMAT_RGB_888>;
263+
ext-sdram = <&sdram1>;
264+
/* orisetech, otm8009a */
265+
display-timings {
266+
compatible = "zephyr,panel-timing";
267+
hsync-active = <0>;
268+
vsync-active = <0>;
269+
de-active = <0>;
270+
pixelclk-active = <0>;
271+
hsync-len = <2>;
272+
vsync-len = <1>;
273+
hback-porch = <34>;
274+
vback-porch = <15>;
275+
hfront-porch = <34>;
276+
vfront-porch = <16>;
277+
};
278+
279+
def-back-color-red = <0>;
280+
def-back-color-green = <0>;
281+
def-back-color-blue = <0>;
282+
283+
};

boards/st/stm32f469i_disco/stm32f469i_disco_defconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,12 @@ CONFIG_UART_CONSOLE=y
1414

1515
# enable GPIO
1616
CONFIG_GPIO=y
17+
18+
# Enable External Memory
19+
CONFIG_MEMC=y
20+
21+
# Configure Display
22+
CONFIG_STM32_LTDC_ARGB8888=y
23+
24+
# Size Memory Heap pool from Framebuffer
25+
# CONFIG_HEAP_MEM_POOL_SIZE=131072

0 commit comments

Comments
 (0)