Skip to main content
Luca G.
Associate III
September 15, 2020
Solved

Firmware crashes with dynamicBitmap in TouchGFX

I'm using TouchGFX's dynamicBitmaps to load an image that I have in a buffer.

The problem is that, even just using the example I found at this link https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/dynamic-bitmaps:

BitmapId bmpId;
 
 
//Create dynamic bitmap
 
const int width = 32;
 
const int height = 24;
 
bmpId = Bitmap::dynamicBitmapCreate(32, 24, Bitmap::RGB565);
 
//set all pixels white
if (bmpId != BITMAP_INVALID)
{
 memset(Bitmap::dynamicBitmapGetAddress(bmpId), 0xFF, width*height*2);
}
 
//Make Image widget show the dynamic bitmap
image.setBitmap(Bitmap(bmpId));
 
//Position image and add to View
image.setXY(20, 20);
 
container1.add(image);
 

and I set up the cache in the constructor of view as follows:

.
.
.
uint32_t bitmapCache[32 * 24 * 3];
.
.
.
 Bitmap::setCache((uint16_t*)bitmapCache, sizeof(bitmapCache), 1);
.
.
.

As soon as the container where I add the dynamicBitmap appears (in this case I do it in the setupScreen function and assign the image to a container that is in a swipe container) the firmware crashes at the code point shown in the image below:

0693W000003Rl5nQAC.png

What could be the problem?

I hope I was clear.

Regards

This topic has been closed for replies.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
September 15, 2020

Looks like you're hitting an assert in LCD24bpp beause you're trying to create a RGB565 dynamic bitmap when you're expected to use a format like RGB888 for 24-bit (or even ARGB8888).

/Martin

3 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
September 15, 2020

Looks like you're hitting an assert in LCD24bpp beause you're trying to create a RGB565 dynamic bitmap when you're expected to use a format like RGB888 for 24-bit (or even ARGB8888).

/Martin

Luca G.
Luca G.Author
Associate III
September 22, 2020

Thank you very much @Martin KJELDSEN​  and sorry for delay.

I solved my problem!

Martin KJELDSEN
Principal III
September 23, 2020

That's great news :) Awesome!