cancel
Showing results for 
Search instead for 
Did you mean: 

partial bitmap copy in Touchgfx

amb
Senior

Hello everyone:

I came to a need,that I need to copy part of a dynamic Bitmap to another postion of the same bitmap.I current use a for loop and memcpy func,It works but cost 4ms each run.How can I use touchgfx's blockCopy functions to do this? as DMA2D was already enabled.

000.png

3 REPLIES 3
amb
Senior

I found blitCopy() func in HAL.hpp,but it seems it only use to FRAMEBUFFER.

Hi amb

We don't have that operation, but I think you can make one.

first call HAL::lockFrameBuffer. This will wait for the DMA to finish all operations.

call unlockFrameBuffer also.

Now, DMA2D is idle and we can use it.

Two ways:

Go to your CubeFW for the board (or another board with DMA2D and display), find the DMA2D examples.

For F746Discovery, for example this:
STM32Cube_FW_F7_V1.17.0/Projects/STM32746G-Discovery/Examples/DMA2D/DMA2D_MemToMemWithPFC/Src/

Use this code to setup DMA2D and start it.

Second:

Take the code from STM32DMA::setupDataCopy. Find the default case, marked with /* BLIT_OP_COPY */.

Use this to make a specific function for your need.

 

Let me know if you have questions.

 

Note, using DMA2D within TouchGFX requires caution. It is not recommended, unless you need to.

 

 

amb
Senior

Hello:@Flemming Gram CHRISTENSEN 

Thanks for your reply.I will try it.

And I have another question: the touchgfx framebuffer is RGB565,Can I make a dynamic bitmap of ARGB8888?  I made one by cacheable container and display the dynamic bitmap by a texturemapper but no image came out. but if I change bitmap type to rgb565,the image can be seen. There is enough  cache,I confirm the dynamic bitmap is created successfully on both type.