7 years, 10 months ago.

How to use different Layers on Display of STM32F469?

Hello,

I am using an STM32F469NI Discovery Board. I want to use the two layers for the display with the library LCD_DISCO_F469NI from mbed. The Display itself works as it should, but I can't select another display layer than the background layer. When I use the functions SelectLayer(1):

#include "mbed.h"
  /**
    * @brief  Selects the LCD Layer.
    * @param  LayerIndex: Layer foreground or background
    */
  void SelectLayer(uint32_t LayerIndex);

and SetLayerVisible(1, ENABLE);

#include "mbed.h"
  /**
    * @brief  Sets an LCD Layer visible
    * @param  LayerIndex: Visible Layer
    * @param  State: New state of the specified layer
    *          This parameter can be one of the following values:
    *            @arg  ENABLE
    *            @arg  DISABLE
    */
  void SetLayerVisible(uint32_t LayerIndex, FunctionalState State);

the display is not showing any difference and everything that is send to the display after SelectLayer is not shown. I know there are functions called LayerDefaultInit():

#include "mbed.h"
  /**
    * @brief  Initializes the LCD layers.
    * @param  LayerIndex: Layer foreground or background
    * @param  FB_Address: Layer frame buffer
    * @retval None
    */
  void LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address);

and SetLayerAdress():

#include "mbed.h"
 /**
    * @brief  Sets an LCD layer frame buffer address.
    * @param  LayerIndex: Layer foreground or background
    * @param  Address: New LCD frame buffer value
    */
  void SetLayerAddress(uint32_t LayerIndex, uint32_t Address);

but I don't know how to use them, the background layer is working without this functions, I have to set an FB_Address but I don't know which address I could use.

Sorry for my bad english, I hope that You understand what my problem is.

3 Answers

4 years, 4 months ago.

Let me answer with more background info. LTDC is using external RAM for both layer buffers (unless you are going monochrome or indexed, then you may think of putting one buffer inside MCU RAM, but it will be hard task anyway). On both STM32F469NI and STM769NI memory interface has too low bandwidth to refresh whole screen represented in two ARGB8888 layers without flickering. In case of two layers you must use 16- or 8-bit color representation (RGB565, ARGB1555, ARGB4444 or luminance based ones). BSP package provided by ST was written for ARGB8888 so you need to modify it to fit your needs.

7 years, 2 months ago.

I have similiar problem with STM32F469 Discovery. I use this sequence:

BSP_TS_Init(800, 480); BSP_QSPI_Init(); BSP_TS_ITConfig(); BSP_LCD_Init(); BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS); BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS+(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4)); BSP_LCD_DisplayOn(); BSP_LCD_SelectLayer(0); BSP_LCD_Clear(LCD_COLOR_YELLOW); BSP_LCD_SelectLayer(1); BSP_LCD_Clear(LCD_COLOR_WHITE); BSP_LCD_SetTransparency(0, 0); BSP_LCD_SetTransparency(1, 255);

But without sucess. Only one LayerDefaultInit work OK 0 or 1 is same. But with two LayerDefaultInit together is problem. Display show only garbage.

I find many examples and code with this initialisation sequence for others Discovery kits. I am confused...

6 years, 2 months ago.

Hello! You have to hide the current layer too, and enable the other:

BSP_LCD_Init(); BSP_LCD_DisplayOn();

/* Initialize the LCD Layers */ BSP_LCD_LayerRgb565Init(1, LCD_FB_START_ADDRESS); BSP_LCD_LayerRgb565Init(0, LCD_FB_START_ADDRESS+(480*272*2)); Reserve memory art SRAM acc. resolution and color format

BSP_LCD_SelectLayer(0); BSP_LCD_SetLayerVisible(0, ENABLE); BSP_LCD_SetLayerVisible(1, DISABLE); Draw something on layer 0

At a given event change to layer 1: BSP_LCD_SelectLayer(1); BSP_LCD_SetLayerVisible(0, DISABLE); BSP_LCD_SetLayerVisible(1, ENABLE);