cancel
Showing results for 
Search instead for 
Did you mean: 

DMA2D transfer error, incorrect blitOp src address in STM32DMA::setupDataCopy()

GMeur
Senior II

Hi,

I'm having a problem that's driving my crazy. After running my program for a little while, I start getting DMA2D transfer errors because the src address of the blitOp struct in the function void STM32DMA::setupDataCopy(const BlitOp& blitOp) starts getting invalid values (like 0x40 for instance) instead of pointing to the external flash where all the images are saved (addresses starting at 0x90000000).

It's hard to tell who is responsible for putting an invalid address as this function is called directly from the touchgfx library and there is no way to debug really what's going on under the hood. It seems to always happen right after the function HAL::lcd().drawPartialBitmap() is called inside the draw function of a own made button class (but looks almost identical to the standard touchgfx button). This function is called with valid bmp, x and y coordinates, dirty rectangle, alpha value and with the useOptimized set to true).

We thought for a while it was due to a memory leak or something of the sort, but after removing all tasks to only keep the GUI task and another small one to read/write from EEPROM, we still get the issue. Plus, this code is an old code which was running just fine without any memory leak on STM32F767BI and that was just ported to STM32U5G9ZJ and upgraded from touchgfx16 to touchgfx25.

Any idea or any help is more than welcome !

 

Guillaume.

2 REPLIES 2
ahsrabrifat
Senior

 

Confirm that blitOp.srcAddress isn’t being overwritten after setupDataCopy() gets called.

Add a watchpoint or log to catch corruption:

if ((uint32_t)blitOp.srcAddress < 0x90000000)
{
    printf("Invalid blitOp.srcAddress: 0x%08lx\n", (uint32_t)blitOp.srcAddress);
    __BKPT(0); // Break if possible
}

 

GMeur
Senior II

The function is entered with an invalid address already!