cancel
Showing results for 
Search instead for 
Did you mean: 

Firmware crashes with dynamicBitmap in TouchGFX

Luca G.
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

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

View solution in original post

3 REPLIES 3
Martin KJELDSEN
Chief III

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

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

I solved my problem!

That's great news :) Awesome!