HAL library 12- LCD for STM32Fxxx

LCD is first big library provided from me. It’s the same as SDRAM, it works on STM32F429-Discovery, STM32F439-EVAL and STM32F7-Discovery boards. With one library you can control 3 boards just by selecting proper define in your target.

Library can be extended to other boards. Library requires FMC peripheral for SDRAM for display memory, DMA2D for fastest graphic accelerations and LTDC for transferring layers to LCD.


Read more about new HAL libraries


  • Supports STM32F429-Discovery board
  • Supports STM32F439-EVAL board
  • Supports STM32F7-Discovery board
  • Supports DMA2D graphic acceleration for fastest drawing operations
  • Supports screen rotation
  • Supports multiple fonts
  • And more


  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h
    • TM GPIO
    • TM SDRAM
    • TM FONTS
    • TM SPI when STM32F429-Discovery is used

Board pinouts

LCD pins are different for different board. Using proper defines (explained below) you can select which board is used.

For full pinout list, download and open LCD library and check header file with description.

Board selection

The most important thing is to tell library, which board is used in target system. There are 2 possible ways to do that. One (and I prefer it) is to check my DISCO library and follow instructions which define you have to set for proper board, and another, explained below.

If you choose option one, then you will have no worries in my future libraries where library needs to know exactly which board is used!

The second option (I don’t prefer it) is, to set define only for this library. Copy define corresponding to your board into defines.h file or make a global defines in compiler’s settings. I made global defines in Keil uVision under “Options for Target” -> “C/C++” tab.

Functions and enumerations


Single LCD library for different boards

Single LCD library for different boards

Project is available on Github, download all libraries below.



Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...

Read before commenting!

Before you make a new comment, make sure you agree with things listed below:

  • - Read post to make sure if it is already posted what you are asking for,
  • - Make sure you have the latest version of libraries used in your project,
  • - Make a clean and grammatically correct written message,
  • - Report as many details as possible, including what have you done so far,
  • - Do NOT post any code here. Use Pastebin,
  • - Do NOT post any error codes here. Use Pastebin,
  • - Specify STM32Fxxx family and used Discovery/EVAL/Nucleo or custom made board,
  • - Make sure your clock is set correct for PLL,
  • - If you are using my HAL drivers, please check this post how to start.
Comment will be deleted on breaking these rules without notification!