Skip to content

Commit cdc11f0

Browse files
CharlesDiasbillwatersiii
authored andcommitted
boards: shields: add ST MB1835 shield
Add support for the ST MB1835 2.47-inch round DSI TFT-LCD daughter board designed for STM32 Discovery kits. Signed-off-by: Charles Dias <[email protected]>
1 parent 9c76521 commit cdc11f0

File tree

9 files changed

+294
-20
lines changed

9 files changed

+294
-20
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2025 Charles Dias
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SHIELD_ST_LCD_DSI_MB1835
5+
6+
orsource "boards/*.defconfig"
7+
8+
if LVGL
9+
10+
config LV_Z_BITS_PER_PIXEL
11+
default 32
12+
13+
config LV_Z_FLUSH_THREAD
14+
default y
15+
16+
choice LV_COLOR_DEPTH
17+
default LV_COLOR_DEPTH_32
18+
endchoice
19+
20+
endif # LVGL
21+
22+
endif # SHIELD_ST_LCD_DSI_MB1835
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Charles Dias
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ST_LCD_DSI_MB1835
5+
def_bool $(shields_list_contains,st_lcd_dsi_mb1835)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Heap memory pool configuration
2+
CONFIG_HEAP_MEM_POOL_SIZE=65536
3+
4+
# Display configuration
5+
CONFIG_STM32_LTDC_ARGB8888=y
6+
CONFIG_DISPLAY_HX8379C_INIT_PRIORITY=87
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
.. _st_lcd_dsi_mb1835:
2+
3+
ST LCD DSI MB1835
4+
#################
5+
6+
Overview
7+
********
8+
9+
The MB1835 shield (revision B-01) provides a 2.47-inch round TFT-LCD with MIPI DSI interface
10+
and capacitive touch screen, specifically designed for STM32U5G9J-DK1 Discovery kit.
11+
12+
The shield features:
13+
14+
- 2.47-inch round TFT-LCD with 480x480 pixel resolution
15+
- 16.7M color depth (RGB888)
16+
- J025F1CN0201W display module with Himax HX8379C LCD controller
17+
- MIPI DSI |reg| 2-data lane interface
18+
- Capacitive touch panel (CTP)
19+
- LED backlight with GPIO control
20+
21+
.. figure:: mb1835_front.webp
22+
:alt: MB1835 Display shield front image
23+
:align: center
24+
25+
MB1835 Display Shield Front Image
26+
27+
.. figure:: mb1835_back.webp
28+
:alt: MB1835 Display shield back image
29+
:align: center
30+
31+
MB1835 Display Shield Back Image
32+
33+
The MB1835 display board connects to the STM32U5G9J-DK1 through the CN1 connector:
34+
35+
+------+--------------+------------+-------+--------------+-----------------+
36+
| CN1 | Description | Interface | CN1 | Description | Interface |
37+
| odd | | | even | | |
38+
+======+==============+============+=======+==============+=================+
39+
| 1 | GND | - | 2 | - | - |
40+
+------+--------------+------------+-------+--------------+-----------------+
41+
| 3 | DSI_CK_P | DSI | 4 | TOUCH_INT | Interrupt out |
42+
+------+--------------+------------+-------+--------------+-----------------+
43+
| 5 | DSI_CK_N | DSI | 6 | GND | - |
44+
+------+--------------+------------+-------+--------------+-----------------+
45+
| 7 | GND | - | 8 | - | - |
46+
+------+--------------+------------+-------+--------------+-----------------+
47+
| 9 | DSI_D0_P | DSI | 10 | - | - |
48+
+------+--------------+------------+-------+--------------+-----------------+
49+
| 11 | DSI_D0_N | DSI | 12 | GND | - |
50+
+------+--------------+------------+-------+--------------+-----------------+
51+
| 13 | GND | - | 14 | - | - |
52+
+------+--------------+------------+-------+--------------+-----------------+
53+
| 15 | DSI_D1_P | DSI | 16 | - | - |
54+
+------+--------------+------------+-------+--------------+-----------------+
55+
| 17 | DSI_D1_N | DSI | 18 | GND | - |
56+
+------+--------------+------------+-------+--------------+-----------------+
57+
| 19 | GND | - | 20 | - | - |
58+
+------+--------------+------------+-------+--------------+-----------------+
59+
| 21 | BLVDD(+5V) | - | 22 | - | - |
60+
+------+--------------+------------+-------+--------------+-----------------+
61+
| 23 | BLVDD(+5V) | - | 24 | - | - |
62+
+------+--------------+------------+-------+--------------+-----------------+
63+
| 25 | - | - | 26 | - | - |
64+
+------+--------------+------------+-------+--------------+-----------------+
65+
| 27 | BLGND | - | 28 | - | - |
66+
+------+--------------+------------+-------+--------------+-----------------+
67+
| 29 | BLGND | - | 30 | - | - |
68+
+------+--------------+------------+-------+--------------+-----------------+
69+
| 31 | - | - | 32 | - | - |
70+
+------+--------------+------------+-------+--------------+-----------------+
71+
| 33 | - | - | 34 | - | - |
72+
+------+--------------+------------+-------+--------------+-----------------+
73+
| 35 | - | - | 36 | 3.3V | - |
74+
+------+--------------+------------+-------+--------------+-----------------+
75+
| 37 | - | - | 38 | - | - |
76+
+------+--------------+------------+-------+--------------+-----------------+
77+
| 39 | - | - | 40 | I2C_SDA | I2C |
78+
+------+--------------+------------+-------+--------------+-----------------+
79+
| 41 | - | - | 42 | - | - |
80+
+------+--------------+------------+-------+--------------+-----------------+
81+
| 43 | - | - | 44 | I2C_SCL | I2C |
82+
+------+--------------+------------+-------+--------------+-----------------+
83+
| 45 | - | - | 46 | - | - |
84+
+------+--------------+------------+-------+--------------+-----------------+
85+
| 47 | - | - | 48 | - | - |
86+
+------+--------------+------------+-------+--------------+-----------------+
87+
| 49 | DSI_TE | DSI | 50 | - | - |
88+
+------+--------------+------------+-------+--------------+-----------------+
89+
| 51 | - | - | 52 | - | - |
90+
+------+--------------+------------+-------+--------------+-----------------+
91+
| 53 | BL_CTRL | GPIO | 54 | - | - |
92+
+------+--------------+------------+-------+--------------+-----------------+
93+
| 55 | - | - | 56 | - | - |
94+
+------+--------------+------------+-------+--------------+-----------------+
95+
| 57 | RESET | GPIO | 58 | - | - |
96+
+------+--------------+------------+-------+--------------+-----------------+
97+
| 59 | - | - | 60 | 1.8V | - |
98+
+------+--------------+------------+-------+--------------+-----------------+
99+
100+
Requirements
101+
************
102+
103+
Your board needs to have a ``mipi_dsi`` device tree label to work with this shield.
104+
105+
Usage
106+
*****
107+
108+
The shield can be used in any application by setting ``SHIELD`` to
109+
``st_lcd_dsi_mb1835`` and adding the necessary device tree properties.
110+
111+
Set ``--shield "st_lcd_dsi_mb1835"`` when you invoke ``west build``. For example:
112+
113+
.. zephyr-app-commands::
114+
:zephyr-app: samples/drivers/display
115+
:board: stm32u5g9j_dk1
116+
:shield: st_lcd_dsi_mb1835
117+
:goals: build
118+
119+
References
120+
**********
121+
122+
- `STM32U5G9J-DK1 User Manual <https://www.st.com/resource/en/user_manual/um2967-discovery-kits-with-stm32u5x9nj-mcus-stmicroelectronics.pdf>`_
123+
124+
- `MB1835 Schematic (Rev B-01) <https://www.st.com/resource/en/schematic_pack/mb1835-vdd1v8-b01-schematic.pdf>`_
56.9 KB
Loading
15 KB
Loading
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
shields:
2+
- name: st_lcd_dsi_mb1835
3+
full_name: ST LCD DSI MB1835
4+
vendor: st
5+
supported_features:
6+
- display
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
* Copyright (c) 2025 Charles Dias
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/display/panel.h>
7+
#include <zephyr/dt-bindings/mipi_dsi/mipi_dsi.h>
8+
9+
/ {
10+
chosen {
11+
zephyr,display = &zephyr_lcd_controller;
12+
};
13+
};
14+
15+
&pll3 {
16+
div-m = <4>; /* Input divider: 16MHz / 4 = 4MHz */
17+
mul-n = <125>; /* Multiplier: 4MHz * 125 = 500MHz VCO */
18+
div-p = <8>; /* P output: 500MHz / 8 = 62.5MHz (for DSI clock lane) */
19+
div-q = <2>; /* Q output: 500MHz / 2 = 250MHz */
20+
div-r = <24>; /* R output: 500MHz / 24 = 20.83MHz (for LTDC pixel clock) */
21+
clocks = <&clk_hse>;
22+
status = "okay";
23+
};
24+
25+
&zephyr_mipi_dsi {
26+
status = "okay";
27+
28+
pll-ndiv = <125>; /* PLLDSINDIV = 125 */
29+
pll-idf = <4>; /* DSI_PLL_IN_DIV4 */
30+
pll-odf = <2>; /* DSI_PLL_OUT_DIV2 */
31+
pll-vco-range = <0x1>; /* DSI_DPHY_VCO_FRANGE_800MHZ_1GHZ */
32+
pll-charge-pump = <0x0>;/* DSI_PLL_CHARGE_PUMP_2000HZ_4400HZ */
33+
pll-tuning = <0x0>; /* DSI_PLL_LOOP_FILTER_2000HZ_4400HZ */
34+
35+
phy-freq-range = <0x8>; /* DSI_DPHY_FRANGE_450MHZ_510MHZ */
36+
phy-low-power-offset = <0x0>; /* PHY_LP_OFFSSET_0_CLKP */
37+
38+
hs-active-high;
39+
vs-active-high;
40+
de-active-high;
41+
largest-packet-size = <0>;
42+
43+
host-timeouts = <1>, /* TimeoutCkdiv */
44+
<0>, /* HighSpeedTransmissionTimeout */
45+
<0>, /* LowPowerReceptionTimeout */
46+
<0>, /* HighSpeedReadTimeout */
47+
<0>, /* LowPowerReadTimeout */
48+
<0>, /* HighSpeedWriteTimeout */
49+
<0>, /* HighSpeedWritePrespMode */
50+
<0>, /* LowPowerWriteTimeout */
51+
<0>; /* BTATimeout */
52+
53+
phy-timings = <11>, /* ClockLaneHS2LPTime */
54+
<40>, /* ClockLaneLP2HSTime */
55+
<12>, /* DataLaneHS2LPTime */
56+
<23>, /* DataLaneLP2HSTime */
57+
<0>, /* DataLaneMaxReadTime */
58+
<7>; /* StopWaitTime */
59+
60+
hx8379c: hx8379c@0 {
61+
status = "okay";
62+
compatible = "himax,hx8379c";
63+
reg = <0x0>; /* Virtual channel 0 */
64+
width = <480>;
65+
height = <480>;
66+
data-lanes = <2>;
67+
pixel-format = <MIPI_DSI_PIXFMT_RGB888>;
68+
69+
reset-gpios = <&dsi_lcd_qsh_030 57 GPIO_ACTIVE_HIGH>;
70+
71+
display-timings {
72+
compatible = "zephyr,panel-timing";
73+
hsync-active = <1>;
74+
vsync-active = <1>;
75+
de-active = <0>;
76+
pixelclk-active = <0>;
77+
hsync-len = <2>;
78+
hback-porch = <1>;
79+
hfront-porch = <1>;
80+
vsync-len = <1>;
81+
vback-porch = <13>;
82+
vfront-porch = <50>;
83+
};
84+
};
85+
};
86+
87+
&zephyr_lcd_controller {
88+
status = "okay";
89+
width = <480>;
90+
height = <480>;
91+
pixel-format = <PANEL_PIXEL_FORMAT_RGB_888>;
92+
93+
bl-ctrl-gpios = <&dsi_lcd_qsh_030 53 GPIO_ACTIVE_HIGH>;
94+
95+
def-back-color-red = <0>;
96+
def-back-color-green = <0>;
97+
def-back-color-blue = <0>;
98+
99+
/* J025F1CN0201W display module */
100+
display-timings {
101+
compatible = "zephyr,panel-timing";
102+
hsync-active = <1>;
103+
vsync-active = <1>;
104+
de-active = <0>;
105+
pixelclk-active = <0>;
106+
hsync-len = <2>;
107+
hback-porch = <1>;
108+
hfront-porch = <1>;
109+
vsync-len = <1>;
110+
vback-porch = <13>;
111+
vfront-porch = <50>;
112+
};
113+
};

boards/st/stm32u5g9j_dk1/stm32u5g9j_dk1.dts

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,6 @@
4545
};
4646
};
4747

48-
dsi_lcd_qsh_030: connector_dsi_lcd {
49-
compatible = "st,dsi-lcd-qsh-030";
50-
#gpio-cells = <2>;
51-
gpio-map-mask = <0xffffffff 0xffffffc0>;
52-
gpio-map-pass-thru = <0 0x3f>;
53-
gpio-map = <4 0 &gpioe 8 0>, /* TOUCH_INT */
54-
<22 0 &gpiod 8 0>, /* SPI chip SEL */
55-
<24 0 &gpiob 13 0>, /* SPI CLK */
56-
<26 0 &gpiod 4 0>, /* SPI MOSI */
57-
<28 0 &gpiod 11 0>, /* SPI DCX */
58-
<35 0 &gpioe 5 0>, /* SCLK/MCLK */
59-
<37 0 &gpioe 4 0>, /* LRCLK */
60-
<40 0 &gpioh 4 0>, /* I2C5_SDA */
61-
<43 0 &gpioi 7 0>, /* SWIRE */
62-
<44 0 &gpioh 5 0>, /* I2C5_SCL */
63-
<49 0 &gpiof 11 0>, /* DSI_TE */
64-
<53 0 &gpioi 6 0>, /* LCD_BL_CTRL */
65-
<57 0 &gpiod 5 0>; /* DSI_RESET */
66-
};
67-
6848
aliases {
6949
led0 = &green_led_0;
7050
led1 = &red_led_0;
@@ -75,6 +55,18 @@
7555
volt-sensor0 = &vref1;
7656
volt-sensor1 = &vbat4;
7757
};
58+
59+
dsi_lcd_qsh_030: connector_dsi_lcd {
60+
compatible = "st,dsi-lcd-qsh-030";
61+
#gpio-cells = <2>;
62+
gpio-map-mask = <0xffffffff 0xffffffc0>;
63+
gpio-map-pass-thru = <0 0x3f>;
64+
gpio-map = <4 0 &gpioe 8 0>, /* TOUCH_INT */
65+
<40 0 &gpioh 4 0>, /* I2C5_SDA */
66+
<44 0 &gpioh 5 0>, /* I2C5_SCL */
67+
<53 0 &gpioi 6 0>, /* DSI_BL_CTRL */
68+
<57 0 &gpiod 5 0>; /* DSI_RESET */
69+
};
7870
};
7971

8072
&clk_hsi48 {
@@ -318,3 +310,9 @@ zephyr_udc0: &usbotg_hs {
318310
&vbat4 {
319311
status = "okay";
320312
};
313+
314+
/* alias used by display shields */
315+
zephyr_mipi_dsi: &mipi_dsi {};
316+
317+
/* alias used by LCD display shields */
318+
zephyr_lcd_controller: &ltdc {};

0 commit comments

Comments
 (0)