cancel
Showing results for 
Search instead for 
Did you mean: 

DMA2D seems not to work, at all.......

STM32U575, FreeRTOS, CubeMX, latest versions.

Schema is graphics writes to virtual memory (32 bit display image).... simplifies high level stuff.

Virtual memory translated to display format (ILI9341, SPI interface, 320 * 240).

Display format memory then read and sent to chip.

This all works.

I want to use Chrom-art/DMA2D (and the labels are not allowing me to select that) to do the usual: block fill, block translate from virtual image to display image, and then use DMA2D to write to the display (which can write to a rectangular 2D area).

It is not working.  I can set up the DMA2D but memory is not written to.

I've tried M2M mode and R2M mode.

I've managed to acquire some small understanding of the hardware, but I seem to be missing something.

code does follow:

							result = ili9341->chip_init(ROTATE_180,DISPLAY_CONTROLLER_ILI9341);	//

							clear_PAGE(0,cl_blue);
							clear_PAGE(0,cl_black);

							// dot test
//							ili9341->write_DOT(0, 0, 0, cl_red);
//							ili9341->write_DOT(0, 1, 1, cl_red);

							draw_string(0, 0, 0, &sdata[0], cl_red);
							trectangle				drect;
							rectangle_build_XY (&drect, 0,0, 319, 239);
							ili9341->COPY_PIXELS_TO_CHIP(0,drect,false);

vTaskDelay(10);
DMA2D_FillRect_virtual(cl_green.C, 5, 10, 30, 5);

							rectangle_build_XY (&drect, 0,0, 319, 239);
							ili9341->COPY_PIXELS_TO_CHIP(0,drect,false);

All of these things work with the exception of  DMA2D_FillRect_Virtual

code below:  

void DMA2D_FillRect_virtual(uint32_t color, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
{
	//	hdma2d;

	uint32_t psrc=cl_green.C;
	uint32_t pDst = 0x200580e4;
	uint16_t xSize = width;

	hdma2d.Instance = DMA2D;
	hdma2d.Init.Mode = DMA2D_R2M;
	hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;
	hdma2d.Init.OutputOffset = 0;

	/* Foreground Configuration */
	hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
	//hdma2d.LayerCfg[1].InputAlpha = 0xFF;
	hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;
	hdma2d.LayerCfg[1].InputOffset = 0;

	/* DMA2D Initialization */
	if(HAL_DMA2D_Init(&hdma2d) == HAL_OK)
	{
		if(HAL_DMA2D_ConfigLayer(&hdma2d, 1) == HAL_OK)
		{
			HAL_DMA2D_Start(&hdma2d, (uint32_t)pSrc, (uint32_t)pDst, xSize, 1);
			HAL_DMA2D_PollForTransfer(&hdma2d, 25);
		}
	}
	vTaskDelay(10);
}

 

The task delays are useful breakpoints.

I'm missing something.  

The processor's DMA2D can access (supposedly) the entire memory area, so that shouldn't be a problem.  The source and destination are within normal system memory, so, that shouldn't be a problem.

One problem I have is that apparently the HAL calls for the U575 do not contain some routines for the more complicated U5 processors.  Some of the mode select calls would be nice to have for the U575.

Any ideas?

 

 

 

0 REPLIES 0
Announcement

We’re moving the ST Community to a new platform to give you a better and more reliable community experience.