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
19 changes: 17 additions & 2 deletions boards/arm/stm32f746g_disco/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,29 @@ config NET_L2_ETHERNET

endif # NETWORKING

config I2C
default y if KSCAN
if DISPLAY

config KSCAN
default y

# MEMC needs to be enabled in order to store
# display buffer to external SDRAM connected to FMC
config MEMC
default y

endif # DISPLAY

if KSCAN

config I2C
default y

config KSCAN_FT5336
default y

config KSCAN_FT5336_INTERRUPT
default y

endif # KSCAN

config DISK_DRIVER_SDMMC
Expand Down
20 changes: 20 additions & 0 deletions boards/arm/stm32f746g_disco/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ The Zephyr stm32f746g_disco board configuration supports the following hardware
+-----------+------------+-------------------------------------+
| QSPI NOR | on-chip | off-chip flash |
+-----------+------------+-------------------------------------+
| FMC | on-chip | memc (SDRAM) |
+-----------+------------+-------------------------------------+
| LTDC | on-chip | display |
+-----------+------------+-------------------------------------+

Other hardware features are not yet supported on Zephyr porting.

Expand Down Expand Up @@ -147,6 +151,22 @@ configured as follows
- LD1 : PI1
- USB DM : PA11
- USB DP : PA12
- FMC SDRAM :

- D0-D15 : PD14/PD15/PD0/PD1/PE7/PE8/PE9/PE10/PE11/PE12/PE13/PE14/PE15/PD8/PD9/PD10
- A0-A11 : PF0/PF1/PF2/PF3/PF4/PF5/PF12/PF13/PF14/PF15/PG0/PG1
- A14/A15 : PG4/PG5
- SDNRAS/SDNCAS : PF11/PG15
- NBL0/NBL1 : PE0/PE1
- SDCLK/SDNWE/SDCKE0/SDNE0 : PG8/PH5/PC3/PH3

- LTDC :

- R0-R7 : PI15/PJ0/PJ1/PJ2/PJ3/PJ4/PJ5/PJ6
- G0-G7 : PJ7/PJ8/PJ9/PJ10/PJ11/PK0/PK1/PK2
- B0-B7 : PJ12/PK13/PJ14/PJ15/PK3/PK4/PK5/PK6
- DE/CLK/HSYNC/VSYNC : PK7/PI14/PI12/PI13


System Clock
============
Expand Down
80 changes: 80 additions & 0 deletions boards/arm/stm32f746g_disco/stm32f746g_disco.dts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
zephyr,flash = &flash0;
zephyr,dtcm = &dtcm;
zephyr,flash-controller = &n25q128a1;
zephyr,display = &ltdc;
};

leds {
Expand All @@ -38,6 +39,13 @@
};
};

sdram1: sdram@c0000000 {
compatible = "zephyr,memory-region", "mmio-sram";
device_type = "memory";
reg = <0xc0000000 DT_SIZE_M(16)>;
zephyr,memory-region = "SDRAM1";
};

aliases {
led0 = &green_led_1;
sw0 = &user_button;
Expand Down Expand Up @@ -185,3 +193,75 @@ zephyr_udc0: &usbotg_fs {
};
};
};

&fmc {
pinctrl-0 = <&fmc_nbl0_pe0 &fmc_nbl1_pe1
&fmc_sdclk_pg8 &fmc_sdnwe_ph5 &fmc_sdcke0_pc3
&fmc_sdne0_ph3 &fmc_sdnras_pf11 &fmc_sdncas_pg15
&fmc_a0_pf0 &fmc_a1_pf1 &fmc_a2_pf2 &fmc_a3_pf3 &fmc_a4_pf4
&fmc_a5_pf5 &fmc_a6_pf12 &fmc_a7_pf13 &fmc_a8_pf14
&fmc_a9_pf15 &fmc_a10_pg0 &fmc_a11_pg1
&fmc_a14_pg4 &fmc_a15_pg5 &fmc_d0_pd14 &fmc_d1_pd15
&fmc_d2_pd0 &fmc_d3_pd1 &fmc_d4_pe7 &fmc_d5_pe8 &fmc_d6_pe9
&fmc_d7_pe10 &fmc_d8_pe11 &fmc_d9_pe12 &fmc_d10_pe13
&fmc_d11_pe14 &fmc_d12_pe15 &fmc_d13_pd8 &fmc_d14_pd9
&fmc_d15_pd10>;
pinctrl-names = "default";
status = "okay";

sdram {
status = "okay";
power-up-delay = <100>;
num-auto-refresh = <8>;
mode-register = <0x220>;
/*
* Auto refresh command shall be issued every 15.625 us
* and is calculated as ((15.625 * SDRAM_CLK_MHZ) - 20)
* Note: SDRAM_CLK_MHZ = HCLK_MHZ / 2 (108 MHz)
*/
refresh-rate = <1667>;
bank@0 {
reg = <0>;
st,sdram-control = <STM32_FMC_SDRAM_NC_8
STM32_FMC_SDRAM_NR_12
STM32_FMC_SDRAM_MWID_16
STM32_FMC_SDRAM_NB_4
STM32_FMC_SDRAM_CAS_2
STM32_FMC_SDRAM_SDCLK_PERIOD_2
STM32_FMC_SDRAM_RBURST_ENABLE
STM32_FMC_SDRAM_RPIPE_0>;
st,sdram-timing = <2 6 4 6 2 2 2>;
};
};
};

&ltdc {
pinctrl-0 = <&ltdc_r0_pi15 &ltdc_r1_pj0 &ltdc_r2_pj1 &ltdc_r3_pj2
&ltdc_r4_pj3 &ltdc_r5_pj4 &ltdc_r6_pj5 &ltdc_r7_pj6
&ltdc_g0_pj7 &ltdc_g1_pj8 &ltdc_g2_pj9 &ltdc_g3_pj10
&ltdc_g4_pj11 &ltdc_g5_pk0 &ltdc_g6_pk1 &ltdc_g7_pk2
&ltdc_b0_pe4 &ltdc_b1_pj13 &ltdc_b2_pj14 &ltdc_b3_pj15
&ltdc_b4_pg12 &ltdc_b5_pk4 &ltdc_b6_pk5 &ltdc_b7_pk6
&ltdc_de_pk7 &ltdc_clk_pi14 &ltdc_hsync_pi10 &ltdc_vsync_pi9>;
pinctrl-names = "default";
disp-on-gpios = <&gpioi 12 GPIO_ACTIVE_HIGH>;
bl-ctrl-gpios = <&gpiok 3 GPIO_ACTIVE_HIGH>;
ext-sdram = <&sdram1>;
status = "okay";

width = <480>;
height = <272>;
hsync-pol = <STM32_LTDC_HSPOL_ACTIVE_LOW>;
vsync-pol = <STM32_LTDC_VSPOL_ACTIVE_LOW>;
de-pol = <STM32_LTDC_DEPOL_ACTIVE_LOW>;
pclk-pol = <STM32_LTDC_PCPOL_ACTIVE_LOW>;
hsync-duration = <1>;
vsync-duration = <10>;
hbp-duration = <43>;
vbp-duration = <12>;
hfp-duration = <8>;
vfp-duration = <4>;
def-back-color-red = <0xFF>;
def-back-color-green = <0xFF>;
def-back-color-blue = <0xFF>;
};
2 changes: 2 additions & 0 deletions boards/arm/stm32f746g_disco/stm32f746g_disco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ supported:
- sdhc
- usb_device
- kscan:touch
- display
- memc
6 changes: 3 additions & 3 deletions drivers/display/display_stm32_ltdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ static int stm32_ltdc_init(const struct device *dev)
#if defined(CONFIG_SOC_SERIES_STM32F7X)
LL_RCC_PLLSAI_Disable();
LL_RCC_PLLSAI_ConfigDomain_LTDC(LL_RCC_PLLSOURCE_HSE,
LL_RCC_PLLM_DIV_8,
192,
LL_RCC_PLLSAIR_DIV_4,
LL_RCC_PLLM_DIV_25,
384,
LL_RCC_PLLSAIR_DIV_5,
LL_RCC_PLLSAIDIVR_DIV_8);

LL_RCC_PLLSAI_Enable();
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/f4/stm32f429.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <st/f4/stm32f427.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
soc {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/f7/stm32f746.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <st/f7/stm32f745.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
soc {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/f7/stm32f767.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <st/f7/stm32f7.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
/* 128KB DTCM @ 20000000, 368KB SRAM1 @ 20020000,
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/h7/stm32h723.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <mem.h>
#include <st/h7/stm32h7.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
soc {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/h7/stm32h743.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <st/h7/stm32h7.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
soc {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/h7/stm32h745.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <st/h7/stm32h7_dualcore.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
soc {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/h7/stm32h750.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <st/h7/stm32h7.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
soc {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/h7/stm32h7a3.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <st/h7/stm32h7.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
soc {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/l4/stm32l4r9.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <mem.h>
#include <st/l4/stm32l4r5.dtsi>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
soc {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/mp1/stm32mp157.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <zephyr/dt-bindings/i2c/i2c.h>
#include <zephyr/dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/pwm/stm32_pwm.h>
#include <zephyr/dt-bindings/display/stm32_ltdc.h>

/ {
cpus {
Expand Down
2 changes: 2 additions & 0 deletions samples/subsys/display/lvgl/boards/stm32f746g_disco.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_LV_Z_POINTER_KSCAN=y
CONFIG_LV_Z_POINTER_KSCAN_DEV_NAME="FT5336"