diff --git a/configs/open1788/src/lpc17_bringup.c b/configs/open1788/src/lpc17_bringup.c index e2d8667a473..abe8a4941e0 100644 --- a/configs/open1788/src/lpc17_bringup.c +++ b/configs/open1788/src/lpc17_bringup.c @@ -389,7 +389,7 @@ int lpc17_bringup(void) } #ifdef CONFIG_VIDEO_FB - /* Initialize and register the simulated framebuffer driver */ + /* Initialize and register the framebuffer driver */ ret = fb_register(0, 0); if (ret < 0) diff --git a/configs/stm32f429i-disco/README.txt b/configs/stm32f429i-disco/README.txt index 7bfd00c1819..c2d03508b31 100644 --- a/configs/stm32f429i-disco/README.txt +++ b/configs/stm32f429i-disco/README.txt @@ -677,10 +677,12 @@ Where is one of the following: external RS-232 line driver to the UART1 pins of the DISCO board on PA9 and PA10 of connector P1. - ltdc: - ---- - STM32F429I-DISCO LTDC Framebuffer demo example. See - configs/stm32f429i-disco/ltdc/README.txt for additional information. + fb + -- + + STM32F429I-DISCO LTDC Framebuffer demo example. This is a simple + configuration used for some basic (non-graphic) debug of the framebuffer + character drivers using apps/examples/fb. nsh: --- diff --git a/configs/stm32f429i-disco/fb/README.txt b/configs/stm32f429i-disco/fb/README.txt new file mode 100644 index 00000000000..4e07cea3925 --- /dev/null +++ b/configs/stm32f429i-disco/fb/README.txt @@ -0,0 +1,70 @@ +README.txt +========== + +STM32F429I-DISCO LTDC Framebuffer demo example + +Configure and build +----------------------------------------------- +cd tools +./configure -a stm32f429i-disco/ltdc +cd .. +make + +Note! +In the current implementation the DMA2D driver only supports clut pixel format +if the LTDC driver it does. Otherwise it will not be compatible with the nx +framework. If CONFIG_FB_CMAP is configured, nx expects that any pixel format +supports color lookup tables. This is also the case for non CLUT formats e.g. +FB_FMT_RGB16_565. This may result in wrong color representation by nx if the +pixel format is unequal to FB_FMT_RGB8. + +On the other hand layers with CLUT pixel format are not supported by the DMA2D +controller, in the case they will be used as destination layer for the following +operations: +- blit +- blend +- fillarea + +To enable clut support in both LTDC and DMA2D driver the following +configurations are valid: + +1. +- Enable LTDC_INTERFACE and LAYER1/LAYER2 +- Layer1 FB_FMT_RGB8 +- Layer2 any non clut format + +But Layer2 can only be used as destination layer for dma2d operations above. +This configuration is not compatibly to nx because LAYER2 will be referenced +by up_fbgetvplane and is an invalid CLUT pixel format. + +2. +- Enable LTDC_INTERFACE and LAYER1/LAYER2 +- Layer2 FB_FMT_RGB8 +- Layer1 any non clut format + +But Layer1 can only be used as destination layer for dma2d operations above. +This configuration should be compatibly to nx because LAYER2 will be referenced +by up_fbgetvplane and is an valid CLUT pixel format. + +All other non clut configuration work fine. + +If using the DMA2D controller without the LTDC controller e.g. camera interface +than enable CONFIG_FB_CMAP and optional CONFIG_FB_TRANSPARENCY in your board +specific configuration. + + +Loading +----------------------------------------------- +st-flash write nuttx.bin 0x8000000 + +Executing +----------------------------------------------- +The ltdc is initialized during boot up. +Interaction with NSH is via the serial console at 115200 8N1 baud. +From the nsh comandline execute one (or both) of the examples: +- nx (default nx example) +- ltdc (trivial ltdc interface test) + +Note! The ltdc example ends in an infinite loop. To get control of the nsh +start this example in the background with 'ltdc &'. + diff --git a/configs/stm32f429i-disco/fb/defconfig b/configs/stm32f429i-disco/fb/defconfig new file mode 100644 index 00000000000..d7c7afb6de8 --- /dev/null +++ b/configs/stm32f429i-disco/fb/defconfig @@ -0,0 +1,78 @@ +# CONFIG_ARCH_FPU is not set +# CONFIG_NX_DISABLE_16BPP is not set +# CONFIG_STM32_DMA2D_RGB888 is not set +# CONFIG_STM32_FLASH_PREFETCH is not set +CONFIG_ARCH_BOARD_STM32F429I_DISCO=y +CONFIG_ARCH_BOARD="stm32f429i-disco" +CONFIG_ARCH_BUTTONS=y +CONFIG_ARCH_CHIP_STM32=y +CONFIG_ARCH_CHIP_STM32F429Z=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARCH="arm" +CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y +CONFIG_BOARD_INITIALIZE=y +CONFIG_BOARD_LOOPSPERMSEC=16717 +CONFIG_BUILTIN=y +CONFIG_DEBUG_CUSTOMOPT=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DISABLE_POLL=y +CONFIG_DRIVERS_VIDEO=y +CONFIG_EXAMPLES_FB=y +CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y +CONFIG_EXAMPLES_NSH=y +CONFIG_EXAMPLES_NX_BPP=16 +CONFIG_EXAMPLES_NX=y +CONFIG_FS_PROCFS_REGISTER=y +CONFIG_FS_PROCFS=y +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +CONFIG_HEAP2_BASE=0xD0000000 +CONFIG_HEAP2_SIZE=8081408 +CONFIG_INTELHEX_BINARY=y +CONFIG_MAX_TASKS=16 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_MM_REGIONS=2 +CONFIG_MQ_MAXMSGSIZE=64 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_READLINE=y +CONFIG_NX_BLOCKING=y +CONFIG_NX=y +CONFIG_NXFONT_MONO5X8=y +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_PREALLOC_TIMERS=4 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_RAM_SIZE=114688 +CONFIG_RAM_START=0x20000000 +CONFIG_RAW_BINARY=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_WAITPID=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_SPI_CMDDATA=y +CONFIG_START_DAY=6 +CONFIG_START_MONTH=12 +CONFIG_START_YEAR=2011 +CONFIG_STM32_CCM_PROCFS=y +CONFIG_STM32_CCMEXCLUDE=y +CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y +CONFIG_STM32_DMA2D_NLAYERS=4 +CONFIG_STM32_DMA2D=y +CONFIG_STM32_FSMC_SRAM=y +CONFIG_STM32_FSMC=y +CONFIG_STM32_JTAG_SW_ENABLE=y +CONFIG_STM32_LTDC_FB_BASE=0xD07B5000 +CONFIG_STM32_LTDC_FB_SIZE=307200 +CONFIG_STM32_LTDC_INTERFACE=y +CONFIG_STM32_LTDC=y +CONFIG_STM32_PWR=y +CONFIG_STM32_SPI5=y +CONFIG_STM32_USART1=y +CONFIG_STM32F429I_DISCO_ILI9341=y +CONFIG_TASK_NAME_SIZE=0 +CONFIG_USART1_SERIAL_CONSOLE=y +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_VIDEO_FB=y +CONFIG_WDOG_INTRESERVE=0 diff --git a/configs/stm32f429i-disco/src/stm32_appinit.c b/configs/stm32f429i-disco/src/stm32_appinit.c index d7c352f344b..fabc7862d87 100644 --- a/configs/stm32f429i-disco/src/stm32_appinit.c +++ b/configs/stm32f429i-disco/src/stm32_appinit.c @@ -55,6 +55,10 @@ # include #endif +#ifdef CONFIG_VIDEO_FB +# include +#endif + #ifdef CONFIG_USBMONITOR # include #endif @@ -340,9 +344,19 @@ int board_app_initialize(uintptr_t arg) #endif /* CONFIG_MTD */ #endif /* CONFIG_STM32_SPI4 */ - /* Create a RAM MTD device if configured */ +#ifdef CONFIG_VIDEO_FB + /* Initialize and register the framebuffer driver */ + + ret = fb_register(0, 0); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret); + } +#endif #if defined(CONFIG_RAMMTD) && defined(CONFIG_STM32F429I_DISCO_RAMMTD) + /* Create a RAM MTD device if configured */ + { uint8_t *start = (uint8_t *) kmm_malloc(CONFIG_STM32F429I_DISCO_RAMMTD_SIZE * 1024); mtd = rammtd_initialize(start, CONFIG_STM32F429I_DISCO_RAMMTD_SIZE * 1024);