DMA2D (Chrom-ART Accelerator) demonstration
(EvoPrimer STM32F429I only)
Presentation
The DMA2D integration is the keystone to graphics potential of the STM32F429. Through a set of registers, it provides graphics management features that include:
- handling of bitmap files (up to 32 bits per pixel),
- management of image overlays, with or without transparency/blending,
- handling of object display to include multiple objects and their positions, sizes and layering (Z-order).
The CircleOS provides a specific API for easily implement these features by integration of the DMA2D peripheral and SDRAM driver.
This API covers:
- Handling of bit maps (display, overlaying and moving)
- Using transparency (pixel-level, global and blending)
- Dynamic versus Read-Only objects
- Management of objects and touch sensing
- Use of layering (Z-order)
DMA2D Integration in STM32F429 and CircleOS
The DMA2D hardware
The DMA2D particularly is advantageous for managing displayed graphics.
These integrated features include:
- Two input pixel formats converters (PFC). These blocks are able to read and to decode the bitmaps files.
- The blender, which computes and mixes the data from the two input PFC.
- The ouput PFC, that decodes the information to be sent to the destination.
- The FIFOs used for both the inputs and the outputs connected to a specific DMA controller.
Integrating blending, encoding and decoding functionality in the microcontroller itself, relieves these requirements from the application and the core that would otherwise be required for this.
Large Internal Memory
The STM32F429 contains up to 2MB of internal FLASH.
In FLASH, a 320 x 240 pixel image requires a bit more than 75 K bytes when the colors are indexed in a 256-byte palette. Therefore, a few background images can be stored without problems.
SDRAM Controller
Storing bitmaps in FLASH is easy as long as there are not too many big pictures. But storing an editable object in RAM is more difficult to manage, since the size of the internal SRAM is always much smaller than the size of the internal FLASH.
Instead of embedding a very large internal SRAM, the new STM32F429 features an internal controller for an external SDRAM.
The STM32F429 EvoPrimer is equipped with 2Mb SDRAM, which can be used for large dynamic graphic objects.
Image of the Screen in RAM
The CircleOS version for STM32F429 EvoPrimer/Open4 kepts an image of the screen in the SDRAM.
This is because it is not convenient to address the RAM of the LCD on these hardware platforms.
This image is sent (using the DMA) to the LCD when a DMA2D_ScreenRedraw has been executed.
This mode allows management of several screen images in SDRAM, and performing of rapid switches between these screens.
In the case of CircleOS, one Megabyte (half of the SDRAM) is reserved for the use of the DMA2D:
- Two screen images occupy 300 K bytes (2 x 320 x 240 x 16-bit pixels)
- The rest (724 K bytes) can be used for objects
Take a look at this document for more information.
DMA2D Demonstration
The DMA2D demonstration takes place with 2 parts:
- first part : example of graphic objects management with CircleOS,
- presentation slides about DMA-2D functionalities.
Screenshots
Slides
Notes :
- The "Evo_Circle_STM3242x.elf", "FAT.elf" and "FAT_OP4.elf" files location depends on your Ride installation; delete them from the projet and add it back before building the project.
- This example runs only on STM32F429I platform.
- The screenshots have been made thanks to the "UTIL_SaveScreenBMP" API function.
- For more information about the CircleOS API's, see : Circle OS Conception document