Need help with stm32_graphics_display_drivers?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

216 Stars 66 Forks 303 Commits 13 Opened issues


STM32 LCD drivers (currently: spi(dma), gpio, fsmc(dma), st7735, st7783, ili9325, ili9328, ili9341, ili9486, ili9488, hx8347g)

Services available


Need anything else?

Contributors list

No Data

STM32Fxxx graphics display drivers

Layer chart, examples circuits and settings:

  • Lcddrv.pdf ( )

LCD I/O and touchscreen I/O driver:

  • lcdiospi: software SPI, hardware SPI, hardware SPI with DMA
  • lcdiogpio8: 8 bit paralell without analog resistive touchscreen
  • lcdiogpio16: 16 bit paralell without analog resistive touchscreen
  • lcdiofsmc8: 8 bit paralell without analog resistive touchscreen + FSMC or FSMC with DMA
  • lcdiofsmc16: 16 bit paralell without analog resistive touchscreen + FSMC or FSMC with DMA
  • lcdtsiogpio8: 8 bit paralell with analog resistive touchscreen
  • lcdtsiofsmc8: 8 bit paralell with analog resistive touchscreen + FSMC or FSMC with DMA
  • ts_xpt2046: XPT2046 touchscreen driver, software and hardware SPI, 4 or 5 wires
  • lcdtsiospi_xpt2046: LCD and XPT2046 in common SPI, software and hardware SPI with DMA (DMA only in LCD)

|stm family|spi|gpio8|gpio16|fsmc8|fsmc16|tsgpio8|tsfsmc8|tsxpt2046|spixpt2046|note| |--|--|--|--|--|--|--|--|--|--|--| |STM32F0|+|+|+|||||||| |STM32F1|+|+|+|||+||+||| |STM32F2|+|+|+|+|+|+|+|+|+|| |STM32F3|+|+|+|||||||| |STM32F4|+|+|+|+|+|+|+|+|+|| |STM32F7|+|+|+|||||||| |STM32G0||+|+|||||||not tested| |STM32G4||+|+|||||||not tested| |STM32L0|+|+|+|||||||not tested| |STM32L1|+|+|+|||||||| |STM32L4|+|+|+|||||||not tested| |STM32L5||+|+|||||||not tested| |STM32H7||+|+||||||||

LCD driver:

  • st7735 (SPI mode tested)
  • st7783 (8 bit paralell mode tested)
  • ili9325 (8 bit paralell mode tested)
  • ili9328 (8 bit paralell mode tested)
  • ili9341 (SPI, 8 bit and 16 bit paralell mode, SPI with LTDC mode tested)
  • ili9486 (8 bit paralell mode tested)
  • ili9488 (SPI, 8 bit paralell mode tested)
  • hx8347g (8 bit paralell mode tested)


  • LcdSpeedTest: Lcd speed test
  • TouchCalib: Touchscreen calibration program
  • Paint: Arduino paint clone
  • JpgViewer: JPG file viewer from SD card or pendrive
  • AnalogClock: Analog Clock demo (printf: the result, i use the SWO pin for ST-LINK Serial Wire Viewer (SWV). See:examples/Src/syscalls.c)
  • 3d filled vector (from

How to use starting from zero?

  • stm32f103c8 - spi:
  • stm32f103c8 - gpio8:
  • stm32f103c8 - gpio8 with touchscreen:
  • stm32f407zet - fsmc16, sdcard, jpg:
  • stm32f429zi discovery - spi-dma, usbhost pendrive, jpg:
  1. Create project for Cubemx or CubeIDE
  2. setting the RCC (Crystal/ceramic resonator)
  3. setting the debug (SYS / serial wire or trace assyn sw)
  4. setting the timebase source (i like the basic timer for this)
  5. if FSMC : setting the FSMC (chip select, memory type = LCD, Lcd reg select, data = 8 or 16 bits, timing)
  6. if SDCARD : setting the SDIO mode, enable the FATFS, FATFS: USELFN, MAXSS = 4096, FS_LOCK = 5, RTC enabled
  7. if USB pendrive : setting the USB host, setting the USB power, enable the FATFS, USELFN, MAXSS = 4096, FS_LOCK = 5
  8. if JPG : enabled the LIBJPEG
  9. setting the clock configuration
  10. project settings: project name, toolchain = truestudio, stack size = 0x800
  11. generate source code
  12. Truestudio or CubeIDE
  13. open projects from file system (only Truestudio)
  14. open main.c
  15. add USER CODE BEGIN PFP: void mainApp(void);
  16. add USER CODE BEGIN WHILE: mainApp();
  17. open main.h
  18. add USER CODE BEGIN Includes (#include "stm32f1xxhal.h" or #include "stm32f4xxhal.h" or ...)
  19. add 2 new folder for Src folder (App, Lcd)
  20. copy file(s) from App/... to App
  21. copy 4 or 7 files from Drivers to Lcd (lcd.h, bmp.h, stm32adafruitlcd.h / c, if touch: ts.h, stm32adafruitts.h / c)
  22. copy Fonts folder to Lcd folder
  23. copy io driver to Lcd folder (lcdio...h / c or lcdts_io...h / c or...)
  24. copy lcd driver to Lcd folder (st7735.h / c or ili9325.h /c or...)
  25. if printf to SWO : copy syscalls.c to Src folder
  26. setting the configuration the io driver header file (pin settings, speed settings etc...)
  27. setting the LCD configuration (orientation, touchscreen)
  28. add include path : Src/Lcd
  29. setting the compile options (Enable paralell build, optimalization)
  30. compile, run ...

Example (please unzip the app you like):

  • f103c8t_app: (stm32f103c8t HAL applications, cubemx, truestudio)
  • f103c8tapprtos: (stm32f103c8t HAL-FreeRtos applications, cubemx, truestudio)
  • f407vet_app: (stm32f407vet HAL-applications, cubemx, truestudio)
  • f407vetapprtos: (stm32f407vet HAL-FreeRtos applications, cubemx, truestudio)
  • f407vetappfsmc: (stm32f407vet HAL applications, FSMC, cubemx, truestudio)
  • f407vetapprtos_fsmc: (stm32f407vet HAL-FreeRtos applications, FSMC, cubemx, truestudio)
  • f407vetappfsmc16: (stm32f407vet HAL applications, FSMC 16 bit, cubemx, truestudio)
  • f407zetappfsmc16_extsram: (stm32f407zet HAL applications, FSMC 16 bit, external 1MB SRAM, cubemx, truestudio)

How to adding the SWO support to cheap stlink ?

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.