Library 51- Chrom-ART Accelerator (DMA2D) graphic library on STM32F429-Discovery

ST’s Chrom-ARTTM Accelerator function or DMA2D is supported in this library. This is powerful tool in STM32F429/39 or STM32F427/29 devices. It is based on DMA transmission from graphic to memory in top possible speed. This can be used to draw moving objects, rectangles, circles very fast without a lot of work.

My DMA2D GRAPHIC library was designed in a way that can support any LCD. Because anything that DMA2D knows is writing “data” (color) in memory at some locations. You still need some way to transmit data from memory to LCD. So library was designed that you can custom set start memory address, LCD width, LCD height and LCD orientation. Then the magic to writing in memory can start.

In case of STM32F429-Discovery, external SD-RAM is connected to MCU. In this case, SD-RAM has some logical address, in our case is 0xD0000000. DMA2D just knows that there is starting address and that LCD is 240px width and 320px height. When you want rectangle on x = 10, y = 10 location, library will calculate memory location where to transmit data for you.

Also, you need separate driver to transmit your data from memory to LCD. In case of STM32F429-Discovery board, LTDC periperal is in use. Again, LTDC peripheral knows start address of LCD memory (0xD0000000) and it can start work.

These 2 settings (LCD width, LCD height, memory start address) are by default set for STM32F429-Discovery compatibility, but you can set it to your needs any time. More below.

Library

Features

  • LCD independent
  • LCD orientation supported
  • Easy to port to another application with just 3 settings
  • Writing to memory with DMA2D fastest speed
  • Supported on STM32F429-Discovery board
  • Draw rectangles, lines, circles, triangles, rounded rectangles with fastest speed
  • Unlimited layers if they are supported by your peripheral to transmit data to LCD
    • In case of STM32F429-Discovery, LTDC can use 2 layers
    • Memory offset is used for new address

Dependencies

  • CMSIS
    • STM32F4xx
    • STM32F4xx RCC
    • STM32F4xx DMA2D
  • TM
    • defines.h

If you want to use this powerfull DMA2D tool on your custom application to work with memory, you need to specify some defines.

Functions and enumerations

Example

In example, DMA2D graphic library was used with connection to ILI9341 LCD via LTDC transfer from memory to LCD. DMA2D is used to draw graphic to memory.

Project available on Github, download library below.

tilz0R

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!