Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions boards/shields/st_lcd_dsi_mb1835/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2025 Charles Dias
# SPDX-License-Identifier: Apache-2.0

if SHIELD_ST_LCD_DSI_MB1835

orsource "boards/*.defconfig"

if LVGL

config LV_Z_BITS_PER_PIXEL
default 32

config LV_Z_FLUSH_THREAD
default y

choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_32
endchoice

endif # LVGL

endif # SHIELD_ST_LCD_DSI_MB1835
5 changes: 5 additions & 0 deletions boards/shields/st_lcd_dsi_mb1835/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 Charles Dias
# SPDX-License-Identifier: Apache-2.0

config SHIELD_ST_LCD_DSI_MB1835
def_bool $(shields_list_contains,st_lcd_dsi_mb1835)
6 changes: 6 additions & 0 deletions boards/shields/st_lcd_dsi_mb1835/boards/stm32u5g9j_dk1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Heap memory pool configuration
CONFIG_HEAP_MEM_POOL_SIZE=65536

# Display configuration
CONFIG_STM32_LTDC_ARGB8888=y
CONFIG_DISPLAY_HX8379C_INIT_PRIORITY=87
124 changes: 124 additions & 0 deletions boards/shields/st_lcd_dsi_mb1835/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
.. _st_lcd_dsi_mb1835:

ST LCD DSI MB1835
#################

Overview
********

The MB1835 shield (revision B-01) provides a 2.47-inch round TFT-LCD with MIPI DSI interface
and capacitive touch screen, specifically designed for STM32U5G9J-DK1 Discovery kit.

The shield features:

- 2.47-inch round TFT-LCD with 480x480 pixel resolution
- 16.7M color depth (RGB888)
- J025F1CN0201W display module with Himax HX8379C LCD controller
- MIPI DSI |reg| 2-data lane interface
- Capacitive touch panel (CTP)
- LED backlight with GPIO control

.. figure:: mb1835_front.webp
:alt: MB1835 Display shield front image
:align: center

MB1835 Display Shield Front Image

.. figure:: mb1835_back.webp
:alt: MB1835 Display shield back image
:align: center

MB1835 Display Shield Back Image

The MB1835 display board connects to the STM32U5G9J-DK1 through the CN1 connector:

+------+--------------+------------+-------+--------------+-----------------+
| CN1 | Description | Interface | CN1 | Description | Interface |
| odd | | | even | | |
+======+==============+============+=======+==============+=================+
| 1 | GND | - | 2 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 3 | DSI_CK_P | DSI | 4 | TOUCH_INT | Interrupt out |
+------+--------------+------------+-------+--------------+-----------------+
| 5 | DSI_CK_N | DSI | 6 | GND | - |
+------+--------------+------------+-------+--------------+-----------------+
| 7 | GND | - | 8 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 9 | DSI_D0_P | DSI | 10 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 11 | DSI_D0_N | DSI | 12 | GND | - |
+------+--------------+------------+-------+--------------+-----------------+
| 13 | GND | - | 14 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 15 | DSI_D1_P | DSI | 16 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 17 | DSI_D1_N | DSI | 18 | GND | - |
+------+--------------+------------+-------+--------------+-----------------+
| 19 | GND | - | 20 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 21 | BLVDD(+5V) | - | 22 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 23 | BLVDD(+5V) | - | 24 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 25 | - | - | 26 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 27 | BLGND | - | 28 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 29 | BLGND | - | 30 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 31 | - | - | 32 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 33 | - | - | 34 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 35 | - | - | 36 | 3.3V | - |
+------+--------------+------------+-------+--------------+-----------------+
| 37 | - | - | 38 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 39 | - | - | 40 | I2C_SDA | I2C |
+------+--------------+------------+-------+--------------+-----------------+
| 41 | - | - | 42 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 43 | - | - | 44 | I2C_SCL | I2C |
+------+--------------+------------+-------+--------------+-----------------+
| 45 | - | - | 46 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 47 | - | - | 48 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 49 | DSI_TE | DSI | 50 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 51 | - | - | 52 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 53 | BL_CTRL | GPIO | 54 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 55 | - | - | 56 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 57 | RESET | GPIO | 58 | - | - |
+------+--------------+------------+-------+--------------+-----------------+
| 59 | - | - | 60 | 1.8V | - |
+------+--------------+------------+-------+--------------+-----------------+

Requirements
************

Your board needs to have a ``mipi_dsi`` device tree label to work with this shield.

Usage
*****

The shield can be used in any application by setting ``SHIELD`` to
``st_lcd_dsi_mb1835`` and adding the necessary device tree properties.

Set ``--shield "st_lcd_dsi_mb1835"`` when you invoke ``west build``. For example:

.. zephyr-app-commands::
:zephyr-app: samples/drivers/display
:board: stm32u5g9j_dk1
:shield: st_lcd_dsi_mb1835
:goals: build

References
**********

- `STM32U5G9J-DK1 User Manual <https://www.st.com/resource/en/user_manual/um2967-discovery-kits-with-stm32u5x9nj-mcus-stmicroelectronics.pdf>`_

- `MB1835 Schematic (Rev B-01) <https://www.st.com/resource/en/schematic_pack/mb1835-vdd1v8-b01-schematic.pdf>`_
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions boards/shields/st_lcd_dsi_mb1835/shield.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
shields:
- name: st_lcd_dsi_mb1835
full_name: ST LCD DSI MB1835
vendor: st
supported_features:
- display
113 changes: 113 additions & 0 deletions boards/shields/st_lcd_dsi_mb1835/st_lcd_dsi_mb1835.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* Copyright (c) 2025 Charles Dias
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/mipi_dsi/mipi_dsi.h>

/ {
chosen {
zephyr,display = &zephyr_lcd_controller;
};
};

&pll3 {
div-m = <4>; /* Input divider: 16MHz / 4 = 4MHz */
mul-n = <125>; /* Multiplier: 4MHz * 125 = 500MHz VCO */
div-p = <8>; /* P output: 500MHz / 8 = 62.5MHz (for DSI clock lane) */
div-q = <2>; /* Q output: 500MHz / 2 = 250MHz */
div-r = <24>; /* R output: 500MHz / 24 = 20.83MHz (for LTDC pixel clock) */
clocks = <&clk_hse>;
status = "okay";
};

&zephyr_mipi_dsi {
status = "okay";

pll-ndiv = <125>; /* PLLDSINDIV = 125 */
pll-idf = <4>; /* DSI_PLL_IN_DIV4 */
pll-odf = <2>; /* DSI_PLL_OUT_DIV2 */
pll-vco-range = <0x1>; /* DSI_DPHY_VCO_FRANGE_800MHZ_1GHZ */
pll-charge-pump = <0x0>;/* DSI_PLL_CHARGE_PUMP_2000HZ_4400HZ */
pll-tuning = <0x0>; /* DSI_PLL_LOOP_FILTER_2000HZ_4400HZ */

phy-freq-range = <0x8>; /* DSI_DPHY_FRANGE_450MHZ_510MHZ */
phy-low-power-offset = <0x0>; /* PHY_LP_OFFSSET_0_CLKP */

hs-active-high;
vs-active-high;
de-active-high;
largest-packet-size = <0>;

host-timeouts = <1>, /* TimeoutCkdiv */
<0>, /* HighSpeedTransmissionTimeout */
<0>, /* LowPowerReceptionTimeout */
<0>, /* HighSpeedReadTimeout */
<0>, /* LowPowerReadTimeout */
<0>, /* HighSpeedWriteTimeout */
<0>, /* HighSpeedWritePrespMode */
<0>, /* LowPowerWriteTimeout */
<0>; /* BTATimeout */

phy-timings = <11>, /* ClockLaneHS2LPTime */
<40>, /* ClockLaneLP2HSTime */
<12>, /* DataLaneHS2LPTime */
<23>, /* DataLaneLP2HSTime */
<0>, /* DataLaneMaxReadTime */
<7>; /* StopWaitTime */

hx8379c: hx8379c@0 {
status = "okay";
compatible = "himax,hx8379c";
reg = <0x0>; /* Virtual channel 0 */
width = <480>;
height = <480>;
data-lanes = <2>;
pixel-format = <MIPI_DSI_PIXFMT_RGB888>;

reset-gpios = <&dsi_lcd_qsh_030 57 GPIO_ACTIVE_HIGH>;

display-timings {
compatible = "zephyr,panel-timing";
hsync-active = <1>;
vsync-active = <1>;
de-active = <0>;
pixelclk-active = <0>;
hsync-len = <2>;
hback-porch = <1>;
hfront-porch = <1>;
vsync-len = <1>;
vback-porch = <13>;
vfront-porch = <50>;
};
};
};

&zephyr_lcd_controller {
status = "okay";
width = <480>;
height = <480>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB_888>;

bl-ctrl-gpios = <&dsi_lcd_qsh_030 53 GPIO_ACTIVE_HIGH>;

def-back-color-red = <0>;
def-back-color-green = <0>;
def-back-color-blue = <0>;

/* J025F1CN0201W display module */
display-timings {
compatible = "zephyr,panel-timing";
hsync-active = <1>;
vsync-active = <1>;
de-active = <0>;
pixelclk-active = <0>;
hsync-len = <2>;
hback-porch = <1>;
hfront-porch = <1>;
vsync-len = <1>;
vback-porch = <13>;
vfront-porch = <50>;
};
};
38 changes: 18 additions & 20 deletions boards/st/stm32u5g9j_dk1/stm32u5g9j_dk1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,6 @@
};
};

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 &gpioe 8 0>, /* TOUCH_INT */
<22 0 &gpiod 8 0>, /* SPI chip SEL */
<24 0 &gpiob 13 0>, /* SPI CLK */
<26 0 &gpiod 4 0>, /* SPI MOSI */
<28 0 &gpiod 11 0>, /* SPI DCX */
<35 0 &gpioe 5 0>, /* SCLK/MCLK */
<37 0 &gpioe 4 0>, /* LRCLK */
<40 0 &gpioh 4 0>, /* I2C5_SDA */
<43 0 &gpioi 7 0>, /* SWIRE */
<44 0 &gpioh 5 0>, /* I2C5_SCL */
<49 0 &gpiof 11 0>, /* DSI_TE */
<53 0 &gpioi 6 0>, /* LCD_BL_CTRL */
<57 0 &gpiod 5 0>; /* DSI_RESET */
};

aliases {
led0 = &green_led_0;
led1 = &red_led_0;
Expand All @@ -75,6 +55,18 @@
volt-sensor0 = &vref1;
volt-sensor1 = &vbat4;
};

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 &gpioe 8 0>, /* TOUCH_INT */
<40 0 &gpioh 4 0>, /* I2C5_SDA */
<44 0 &gpioh 5 0>, /* I2C5_SCL */
<53 0 &gpioi 6 0>, /* DSI_BL_CTRL */
<57 0 &gpiod 5 0>; /* DSI_RESET */
};
};

&clk_hsi48 {
Expand Down Expand Up @@ -318,3 +310,9 @@ zephyr_udc0: &usbotg_hs {
&vbat4 {
status = "okay";
};

/* alias used by display shields */
zephyr_mipi_dsi: &mipi_dsi {};

/* alias used by LCD display shields */
zephyr_lcd_controller: &ltdc {};
Loading