Skip to content

Commit 0060c10

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 ceec76d commit 0060c10

File tree

6 files changed

+170
-0
lines changed

6 files changed

+170
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Copyright 2023 BrainCo Inc.
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_32
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) 2023 BrainCo Inc.
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: 100 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

@@ -63,6 +71,19 @@
6371
};
6472
};
6573

74+
dsi_lcd_qsh_030: connector_dsi_lcd {
75+
compatible = "st,dsi-lcd-qsh-030";
76+
#gpio-cells = <2>;
77+
gpio-map-mask = <0xffffffff 0xffffffc0>;
78+
gpio-map-pass-thru = <0 0x3f>;
79+
gpio-map = <4 0 &gpioj 5 0>, /* TOUCH_INT */
80+
<40 0 &gpiob 9 0>, /* I2C1_SDA */
81+
<44 0 &gpiob 8 0>, /* I2C1_SCL */
82+
<49 0 &gpioj 2 0>, /* DSI_TE */
83+
<53 0 &gpioa 3 0>, /* LCD_BL_CTRL */
84+
<57 0 &gpioh 7 0>; /* DSI_RESET */
85+
};
86+
6687
aliases {
6788
led0 = &green_led_1;
6889
led1 = &orange_led_2;
@@ -86,6 +107,17 @@
86107
mul-n = <336>;
87108
div-p = <2>;
88109
div-q = <7>;
110+
div-r = <6>;
111+
clocks = <&clk_hse>;
112+
status = "okay";
113+
};
114+
115+
&pllsai {
116+
div-m = <8>;
117+
mul-n = <266>;
118+
div-p = <2>;
119+
div-r = <5>;
120+
div-divr = <2>;
89121
clocks = <&clk_hse>;
90122
status = "okay";
91123
};
@@ -116,6 +148,13 @@
116148
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
117149
pinctrl-names = "default";
118150
status = "okay";
151+
152+
ft5336: ft5336@2a {
153+
compatible = "focaltech,ft5336";
154+
reg = <0x2a>;
155+
int-gpios = <&gpioj 5 0>;
156+
status = "okay";
157+
};
119158
};
120159

121160
&spi2 {
@@ -198,3 +237,64 @@ zephyr_udc0: &usbotg_fs {
198237
};
199238
};
200239
};
240+
241+
&mipi_dsi {
242+
243+
status = "okay";
244+
otm8009a: otm8009a@0 {
245+
status = "okay";
246+
compatible = "orisetech,otm8009a";
247+
reg = <0x0>;
248+
height = <800>;
249+
width = <480>;
250+
reset-gpios = <&gpioh 7 0>;
251+
bl-gpios = <&gpioa 3 0>;
252+
data-lanes = <2>;
253+
pixel-format = <MIPI_DSI_PIXFMT_RGB888>;
254+
rotation = <90>;
255+
};
256+
257+
/* DSI HOST dedicated PLL
258+
* F_VCO = CLK_IN / pll-idf * 2 * pll-ndiv
259+
* PHI = F_VCO / 2 / (1 << pll-odf) = lane_byte_clk
260+
* = 8 MHz / 2 * 2 * 125 / 2 / (1<<0) / 8 = 62.5 MHz
261+
*/
262+
pll-ndiv = <125>; // 125
263+
pll-idf = <2>; // 2
264+
pll-odf = <0>; // 1
265+
266+
// test-pattern = <0>; //for testing purpose
267+
268+
vs-active-high;
269+
hs-active-high;
270+
de-active-high;
271+
272+
};
273+
274+
/* alias used by LCD display shields */
275+
&ltdc {
276+
status = "okay";
277+
width = <800>;
278+
height = <480>;
279+
pixel-format = <PANEL_PIXEL_FORMAT_RGB_888>;
280+
ext-sdram = <&sdram1>;
281+
/* orisetech, otm8009a */
282+
display-timings {
283+
compatible = "zephyr,panel-timing";
284+
hsync-active = <0>;
285+
vsync-active = <0>;
286+
de-active = <0>;
287+
pixelclk-active = <0>;
288+
hsync-len = <2>;
289+
vsync-len = <1>;
290+
hback-porch = <34>;
291+
vback-porch = <15>;
292+
hfront-porch = <34>;
293+
vfront-porch = <16>;
294+
};
295+
296+
def-back-color-red = <0>;
297+
def-back-color-green = <0>;
298+
def-back-color-blue = <0>;
299+
300+
};

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)