From 6b808132926feea91ae6c33a84705d5c271d1ecb Mon Sep 17 00:00:00 2001 From: Saravanan Sekar Date: Fri, 21 Jun 2024 19:07:58 +0530 Subject: [PATCH] boards: shield: add support for stm32f769i_disco board Add support for STMicroelectronics B-LCD40-DSI1 shield to stm32f769i_disco board. Default config for lvgl is adjusted to lower value to fix compilation issue on low memory footprint stm32f769i_disco. region `IDT_LIST' overflowed by 121081 bytes bss ' will not fit in region `RAM' ld.bfd: region `RAM' overflowed by 1220664 bytes collect2: error: ld returned 1 exit status Signed-off-by: Saravanan Sekar --- .../st_b_lcd40_dsi1_mb1166/Kconfig.defconfig | 10 +---- .../stm32f769i_disco.conf | 5 +++ .../stm32f769i_disco.overlay | 22 ++++++++++ .../boards/stm32f769i_disco.conf | 6 +++ .../boards/stm32f769i_disco.overlay | 41 +++++++++++++++++++ boards/st/stm32f769i_disco/doc/index.rst | 26 ++++++++++++ .../st/stm32f769i_disco/stm32f769i_disco.dts | 17 ++++++++ 7 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32f769i_disco.conf create mode 100644 boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32f769i_disco.overlay create mode 100644 boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32f769i_disco.conf create mode 100644 boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32f769i_disco.overlay diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.defconfig b/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.defconfig index 2fe69bcea0690d1..a1babe49dd88baf 100644 --- a/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.defconfig +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/Kconfig.defconfig @@ -8,19 +8,13 @@ if SHIELD_ST_B_LCD40_DSI1_MB1166 || SHIELD_ST_B_LCD40_DSI1_MB1166_A09 if LVGL config STM32_LTDC_FB_NUM - default 0 + default 1 config INPUT default y config LV_Z_VDB_SIZE - default 100 - -config LV_Z_DOUBLE_VDB - default y - -config LV_Z_VBD_CUSTOM_SECTION - default y + default 10 config LV_Z_FULL_REFRESH default y diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32f769i_disco.conf b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32f769i_disco.conf new file mode 100644 index 000000000000000..291a1df93279beb --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32f769i_disco.conf @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Linumiz +# SPDX-License-Identifier: Apache-2.0 + +# Initialize after LTDC and MIPI-DSI +CONFIG_DISPLAY_OTM8009A_INIT_PRIORITY=87 diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32f769i_disco.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32f769i_disco.overlay new file mode 100644 index 000000000000000..f2d973aac471028 --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/st_b_lcd40_dsi1_mb1166/stm32f769i_disco.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 Linumiz + * + * SPDX-License-Identifier: Apache-2.0 + */ + +<dc { + /* orisetech, otm8009a */ + display-timings { + compatible = "zephyr,panel-timing"; + hsync-active = <0>; + vsync-active = <0>; + de-active = <0>; + pixelclk-active = <0>; + hsync-len = <2>; + vsync-len = <1>; + hback-porch = <34>; + vback-porch = <15>; + hfront-porch = <34>; + vfront-porch = <16>; + }; +}; diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32f769i_disco.conf b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32f769i_disco.conf new file mode 100644 index 000000000000000..aec2c724a51ee29 --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32f769i_disco.conf @@ -0,0 +1,6 @@ +# Copyright (c) 2024 Linumiz +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_MEMC=y +CONFIG_STM32_LTDC_RGB888=y +CONFIG_HEAP_MEM_POOL_SIZE=65536 diff --git a/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32f769i_disco.overlay b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32f769i_disco.overlay new file mode 100644 index 000000000000000..bac5c57077605bb --- /dev/null +++ b/boards/shields/st_b_lcd40_dsi1_mb1166/boards/stm32f769i_disco.overlay @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 Linumiz + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + lvgl_pointer { + compatible = "zephyr,lvgl-pointer-input"; + input = <&ft5336>; + }; + + chosen { + zephyr,display = <dc; + }; +}; + +<dc { + status = "okay"; + ext-sdram = <&sdram1>; + width = <800>; + height = <480>; + def-back-color-red = <0>; + def-back-color-green = <0>; + def-back-color-blue = <0>; + pixel-format = ; +}; + +&mipi_dsi { + status = "okay"; + + pll-ndiv = <100>; + pll-idf = <5>; + pll-odf = <0>; + + vs-active-high; + hs-active-high; + de-active-high; +}; diff --git a/boards/st/stm32f769i_disco/doc/index.rst b/boards/st/stm32f769i_disco/doc/index.rst index 223c48a9dbe2843..f593e6c560471ac 100644 --- a/boards/st/stm32f769i_disco/doc/index.rst +++ b/boards/st/stm32f769i_disco/doc/index.rst @@ -120,6 +120,9 @@ The Zephyr stm32f769i_disco board configuration supports the following hardware +-----------+------------+-------------------------------------+ | TOUCH | off-chip | ft5336(FT6202) | +-----------+------------+-------------------------------------+ +| DISPLAY | off-chip | MIPI DSI Host with shield (MP1166) | +| | | st_b_lcd40_dsi1_mb1166 | ++-----------+------------+-------------------------------------+ Other hardware features are not yet supported on Zephyr porting. @@ -162,6 +165,29 @@ The STM32F769I Discovery kit has up to 8 UARTs. The Zephyr console output is ass which connected to the onboard ST-LINK/V2 Virtual COM port interface. Default communication settings are 115200 8N1. +Display +======= + +The STM32F769I Discovery kit has a dedicated DSI LCD connector **CN1**, where +the MB1166 (B-LCD40-DSI1) display extension board can be mounted. Enable display +support in Zephyr by adding the shield ``st_b_lcd40_dsi1_mb1166`` or +``st_b_lcd40_dsi1_mb1166_a09`` to your build command, for example: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/display + :board: stm32f769i_disco + :shield: st_b_lcd40_dsi1_mb1166 + :goals: build flash + +.. note:: + The shield comes in different hardware revisions, the MB1166-A09 + is utilizing a NT35510 panel controller and shall specifically + use ``st_b_lcd40_dsi1_mb1166_a09`` as SHIELD when building + Prior versions are utilizing an OTM8009a controller and shall + use shield name without postfix, that is: ``st_b_lcd40_dsi1_mb1166`` + Shield version is printed on a sticker placed below the two bottom + mounting holes and has the format: MB1166-Axx + Programming and Debugging ************************* diff --git a/boards/st/stm32f769i_disco/stm32f769i_disco.dts b/boards/st/stm32f769i_disco/stm32f769i_disco.dts index 0f274c7fa06ce35..36cfae282530837 100644 --- a/boards/st/stm32f769i_disco/stm32f769i_disco.dts +++ b/boards/st/stm32f769i_disco/stm32f769i_disco.dts @@ -80,6 +80,23 @@ zephyr,memory-region = "QSPI_AVAIL"; zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO) )>; }; + + dsi_lcd_qsh_030: connector_dsi_lcd { + compatible = "st,dsi-lcd-qsh-030"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <4 0 &gpioi 13 0>, /* TOUCH_INT */ + <35 0 &gpiod 12 0>, /* SCLK/MCLK */ + <39 0 &gpiod 11 0>, /* I2S */ + <40 0 &gpiob 9 0>, /* I2C4_SDA */ + <44 0 &gpiob 8 0>, /* I2C4_SCL */ + <45 0 &gpioa 8 0>, /* CEC_CLK */ + <47 0 &gpioa 15 0>, /* CEC */ + <49 0 &gpioj 2 0>, /* DSI_TE */ + <53 0 &gpioi 14 0>, /* LCD_BL_CTRL */ + <57 0 &gpioj 15 0>; /* DSI_RESET */ + }; }; qsh_030_i2c: &i2c4 {