TouchGFX dynamicBitmapCreateExternal() not working for RGB565 bitmaps
- May 29, 2025
- 2 replies
- 697 views
I have successfully used dynamicBitmapCreateExternal() with RGB888 on another project but on a different project this causes a hard fault when the bitmap is used to render an image to the display when RGB565 is used. I have been able to change the parameter to RGB888 and it works but of course since the image loaded is RGB565 it is not formatted correctly on the display...but it proves that works with the only difference being the RGB565 entered for the format parameter...
FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap)
: FrontendApplicationBase(m, heap)
{
/*
* Initialize dynamic bitmap cache;
* bookkeeping memory for external bitmaps not stored in cache
*/
uint16_t* const cacheStartAddr = (uint16_t*)myBmpCache;
const uint32_t cacheSize = sizeof(myBmpCache);
Bitmap::setCache(cacheStartAddr, cacheSize, 1);
void* srcPtr = logoGetImagePtr();
BitmapId bmpId = Bitmap::dynamicBitmapCreateExternal(LCD_X_Size, LCD_Y_Size, srcPtr,
Bitmap::RGB888, 0);
oprSetLogoBmpId(bmpId);
}The above works but just changing the parameter from Bitmap::RGB888 to Bitmap::RGB565 does not work. See the hardfault in the attached screen capture when the framebuffer is accessed..
Any suggestions? Seen other post about this but nothing about it being addressed. I'm using TouchGFX v4.25.0 and STM32CubeIDE v1.17.0
