Skip to content

Commit

Permalink
arm/stm32h753bi: Add support to lvgl
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Guzman <[email protected]>
  • Loading branch information
JorgeGzm authored and acassis committed Dec 22, 2024
1 parent e26e8bd commit e55966d
Show file tree
Hide file tree
Showing 9 changed files with 257 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -813,3 +813,57 @@ Configures the board to use the SPI4 and enables RFID driver with MFRC522::
MOSI PE6
CS PE4
======== =====

lvgl
----

Configures the board to use display of 7 inch with lvgl example.

To verify if the display is functioning correctly, use the **fb** command. You should see the display change colors.::

nsh> fb
VideoInfo:
fmt: 11
xres: 1024
yres: 600
nplanes: 1
noverlays: 1
OverlayInfo (overlay 0):
fbmem: 0xc0000000
fblen: 1228800
stride: 2048
overlay: 0
bpp: 16
blank: 0
chromakey: 0x00000000
color: 0x00000000
transp: 0xff
mode: 0
area: (0,0) => (1024,600)
accl: 1
PlaneInfo (plane 0):
fbmem: 0xc0000000
fblen: 1228800
stride: 2048
display: 0
bpp: 16
Mapped FB: 0xc0000000
0: ( 0, 0) (1024,600)
1: ( 93, 54) (838,492)
2: (186,108) (652,384)
3: (279,162) (466,276)
4: (372,216) (280,168)
5: (465,270) ( 94, 60)
Test finished

Once the **fd** command work, run the lvgl exemple. ::

nsh> lvgldemo

**WARNING:** This example at the moment is not working correctly yet and have a bug fix to be done.
In the lvgl file **./apps/graphics/lvgl/lvgl/src/drivers/nuttx/lv_nuttx_fbdev.c**
search the function **lv_nuttx_fbdev_set_file** and modify line 156 as follows:

dsc->mem_off_screen = malloc(data_size);
to
dsc->mem_off_screen = (void*)0xC00000000;
8 changes: 5 additions & 3 deletions arch/arm/src/stm32f7/stm32_ltdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2623,7 +2623,7 @@ static int stm32_setchromakey(struct fb_vtable_s *vtable,
struct stm32_ltdcdev_s *priv = (struct stm32_ltdcdev_s *)vtable;

DEBUGASSERT(vtable != NULL && priv == &g_vtable && oinfo != NULL);
lcdinfo("vtable=%p, overlay=%d, chromakey=%08x\n", vtable,
lcdinfo("vtable=%p, overlay=%d, chromakey=%08" PRIx32 "\n", vtable,
oinfo->overlay, oinfo->chromakey);

if (oinfo->overlay < LTDC_NLAYERS)
Expand Down Expand Up @@ -2689,7 +2689,8 @@ static int stm32_setcolor(struct fb_vtable_s *vtable,
const struct fb_overlayinfo_s *oinfo)
{
DEBUGASSERT(vtable != NULL && vtable == &g_vtable.vtable && oinfo != NULL);
lcdinfo("vtable=%p, overlay=%d, color=%08x\n", vtable, oinfo->color);
lcdinfo("vtable=%p, overlay=%d, color=%08" PRIx32 "\n",
vtable, oinfo->overlay, oinfo->color);

if (oinfo->overlay < LTDC_NOVERLAYS)
{
Expand Down Expand Up @@ -2737,7 +2738,8 @@ static int stm32_setblank(struct fb_vtable_s *vtable,
struct stm32_ltdcdev_s *priv = (struct stm32_ltdcdev_s *)vtable;

DEBUGASSERT(vtable != NULL && priv == &g_vtable && oinfo != NULL);
lcdinfo("vtable=%p, overlay=%d, blank=%02x\n", vtable, oinfo->blank);
lcdinfo("vtable=%p, overlay=%d, blank=%02x\n",
vtable, oinfo->overlay, oinfo->blank);

if (oinfo->overlay < LTDC_NLAYERS)
{
Expand Down
8 changes: 5 additions & 3 deletions arch/arm/src/stm32h7/stm32_ltdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,7 @@ static int stm32_setchromakey(struct fb_vtable_s *vtable,
struct stm32_ltdcdev_s *priv = (struct stm32_ltdcdev_s *)vtable;

DEBUGASSERT(vtable != NULL && priv == &g_vtable && oinfo != NULL);
lcdinfo("vtable=%p, overlay=%d, chromakey=%08x\n", vtable,
lcdinfo("vtable=%p, overlay=%d, chromakey=%08" PRIx32 "\n", vtable,
oinfo->overlay, oinfo->chromakey);

if (oinfo->overlay < LTDC_NLAYERS)
Expand Down Expand Up @@ -2692,7 +2692,8 @@ static int stm32_setcolor(struct fb_vtable_s *vtable,
const struct fb_overlayinfo_s *oinfo)
{
DEBUGASSERT(vtable != NULL && vtable == &g_vtable.vtable && oinfo != NULL);
lcdinfo("vtable=%p, overlay=%d, color=%08x\n", vtable, oinfo->color);
lcdinfo("vtable=%p, overlay=%d, color=%08" PRIx32 "\n",
vtable, oinfo->overlay, oinfo->color);

if (oinfo->overlay < LTDC_NOVERLAYS)
{
Expand Down Expand Up @@ -2739,7 +2740,8 @@ static int stm32_setblank(struct fb_vtable_s *vtable,
struct stm32_ltdcdev_s *priv = (struct stm32_ltdcdev_s *)vtable;

DEBUGASSERT(vtable != NULL && priv == &g_vtable && oinfo != NULL);
lcdinfo("vtable=%p, overlay=%d, blank=%02x\n", vtable, oinfo->blank);
lcdinfo("vtable=%p, overlay=%d, blank=%02x\n",
vtable, oinfo->overlay, oinfo->blank);

if (oinfo->overlay < LTDC_NLAYERS)
{
Expand Down
74 changes: 74 additions & 0 deletions boards/arm/stm32h7/linum-stm32h753bi/configs/lvgl/defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_STANDARD_SERIAL is not set
# CONFIG_STM32H7_FB_CMAP is not set
# CONFIG_STM32H7_LTDC_L1_CHROMAKEYEN is not set
# CONFIG_STM32H7_LTDC_L2 is not set
# CONFIG_STM32H7_USE_LEGACY_PINMAP is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="linum-stm32h753bi"
CONFIG_ARCH_BOARD_LINUM_STM32H753BI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32H753BI=y
CONFIG_ARCH_CHIP_STM32H7=y
CONFIG_ARCH_CHIP_STM32H7_CORTEXM7=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_DCACHE=y
CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y
CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_BOARD_LOOPSPERMSEC=43103
CONFIG_BUILTIN=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DRIVERS_VIDEO=y
CONFIG_EXAMPLES_ALARM=y
CONFIG_EXAMPLES_FB=y
CONFIG_EXAMPLES_LVGLDEMO=y
CONFIG_FB_OVERLAY=y
CONFIG_FS_PROCFS=y
CONFIG_GRAPHICS_LVGL=y
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBM=y
CONFIG_LV_USE_CLIB_MALLOC=y
CONFIG_LV_USE_CLIB_SPRINTF=y
CONFIG_LV_USE_CLIB_STRING=y
CONFIG_LV_USE_DEMO_WIDGETS=y
CONFIG_LV_USE_NUTTX=y
CONFIG_MM_REGIONS=5
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_DISABLE_IFUPDOWN=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=245760
CONFIG_RAM_START=0x20010000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC_ALARM=y
CONFIG_RTC_DATETIME=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_STM32H7_FMC=y
CONFIG_STM32H7_LTDC=y
CONFIG_STM32H7_LTDC_FB_BASE=0xC0000000
CONFIG_STM32H7_LTDC_FB_SIZE=1228800
CONFIG_STM32H7_PWR=y
CONFIG_STM32H7_RTC=y
CONFIG_STM32H7_USART1=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_TESTING_RAMTEST=y
CONFIG_USART1_SERIAL_CONSOLE=y
CONFIG_VIDEO_FB=y
Loading

0 comments on commit e55966d

Please sign in to comment.