2020-10-06 09:32 AM
Hi,
I have a problem when using a dynamic bitmap (no problems in simulator, only on MCU).
No problems arise when calling the Bitmap::dynamicBitmapCreate() function, it returns a valid bitmap_id, but then when I set an Image with this bitmap_id, things go wrong.
We keep getting into the DMA2D_IRQHandler() untill the watchdog resets the MCU.
When inspecting the registers, I saw that in DMA2D->ISR the CEIF (configuration error) is set.
void DMA2D_IRQHandler(void)
{
if (DMA2D->ISR & 2)
{
DMA2D->IFCR = 2;
//invalidate D-Cache after DMA transfer
SCB_CleanInvalidateDCache();
touchgfx::HAL::getInstance()->signalDMAInterrupt();
}
Does anyone have an idea what can be the problem?
Thanks in advance!
Kind regards,
Jens Jonckheere
Platform info:
Solved! Go to Solution.
2020-10-07 08:41 AM
This problem was "solved" by changing:
HAL& hal = touchgfx_generic_init<STM32F7HAL>(dma, display, tc, 480, 272, (uint16_t*)bitmap_cache, sizeof(bitmap_cache), 1);
to:
HAL& hal = touchgfx_generic_init<STM32F7HAL>(dma, display, tc, 480, 272, (uint16_t*)bitmap_cache, sizeof(bitmap_cache), 4);
So by changing the param numberOfDynamicBitmaps in touchgfx_generic_init to 4, the function Bitmap::dynamicBitmapGetAddress() returns a 32-bit aligned address.
It's not a nice solution but it works because I only use 1 dynamic bitmap, so it will always return the same address, I hope.
I guess this is a bug in touchgfx, the address of a dynamic bitmap (atleast of type Bitmap::ARGB8888) should always be aligned I think. Otherwise it can give an error in the DMA2D peripheral.
This was in touchgfx version 4.12.3.
Kind regards,
Jens Jonckheere
2020-10-07 05:41 AM
uint8_t* ram_mask_data_uint8 = Bitmap::dynamicBitmapGetAddress(dynamic_bitmap_id);
I figured out that the address returned by Bitmap::dynamicBitmapGetAddress() is not 32-bit aligned.
This address is then used in the DMA2D->FGMAR (foreground memory address) register, which needs to be 32-bit aligned for 32-bit per pixel images. This triggers the configuration error interrupt.
Is this normal that Bitmap::dynamicBitmapGetAddress() can return an address that is not aligned? Or is something wrong in my configuration of touchgfx?
2020-10-07 08:41 AM
This problem was "solved" by changing:
HAL& hal = touchgfx_generic_init<STM32F7HAL>(dma, display, tc, 480, 272, (uint16_t*)bitmap_cache, sizeof(bitmap_cache), 1);
to:
HAL& hal = touchgfx_generic_init<STM32F7HAL>(dma, display, tc, 480, 272, (uint16_t*)bitmap_cache, sizeof(bitmap_cache), 4);
So by changing the param numberOfDynamicBitmaps in touchgfx_generic_init to 4, the function Bitmap::dynamicBitmapGetAddress() returns a 32-bit aligned address.
It's not a nice solution but it works because I only use 1 dynamic bitmap, so it will always return the same address, I hope.
I guess this is a bug in touchgfx, the address of a dynamic bitmap (atleast of type Bitmap::ARGB8888) should always be aligned I think. Otherwise it can give an error in the DMA2D peripheral.
This was in touchgfx version 4.12.3.
Kind regards,
Jens Jonckheere