2023-10-26 06:20 PM
Hi,
So I'm pretty sure I've discovered a bug of varying severity related to having a bitmap image in memory and trying to add it to TouchGFX with the dynamicBitmapCreateExternal() function.
I found this in our project board using a STM32H750 with 480x800 display using 16-bit colour depth. But something similar/also wrong appears to occur in the Simulator (using 4.20.0) and on a STM32F429 Disco board.
I've narrowed the scenario down to the following, having tried to isolate all our code from the problem.
When drawing, various things will go wrong.
For every one of these though if instead I use a dynamic bitmap of ARGB8888 format, it always appears with no problem and exactly as I created it, e.g. solid grey or white etc.
I think there's a bug in the use of the external bitmap in the RGB565 format. There's also no problem if I use an 'embedded' image (i.e. appears in bitmap_database.cpp).
Can anyone assist or confirm if they've seen this work? I've attached a zip of my F429/simulator project for anyone interested enough/STM support to investigate or at least I would have done if zips were allowed.
2023-10-27 09:44 AM
Hello
Im not sure can I help you, but you can attach your project as rar- package, they are allowed. You probably need to split your package to three 5 megabyte part (select 'split to volumes' from winrar and put size bit under 5 MB). You can delete folder 'core' from \Middlewares\ST\touchgfx\lib\ to get your project to fit under 15MB since only three file is allowed here. Also folder 'bin' under \build can be deleted, it is regenerated when start simulator from tgfx designer.
Make sure that you copy your project first and then delete files from that if something goes wrong !
Br JTP
2023-11-06 05:25 AM
Hello,
I stumbled today across the same issue (STM32H723). The function Bitmap::dynamicBitmapCreateExternal() doesn't work with RGB565 as parameter. I used the Bitmap loader to load a dynamic bitmap and store it in the external flash memory.
When I tried to load the image with Bitmap::dynamicBitmapCreateExternal() the application crashed (not immediately, but as soon as the image should be rendered, with a Hard-fault - PRECISERR).
There are no problems, when using Bitmap::dynamicBitmapCreateExternal() with RGB888 as parameter.
The following workaround is working for me:
BitmapId bmpId = Bitmap::dynamicBitmapCreate(200, 200, Bitmap::BitmapFormat::RGB565);
uint8_t* bitmapPointer = Bitmap::dynamicBitmapGetAddress(bmpId);
memcpy(bitmapPointer, (void const*)0x93FB0000, 200* 200 * 2);
image.setBitmap(Bitmap(bmpId));
Greetings,
PBull
2023-11-07 02:43 PM
Thank you @PBull for confirming that I'm not an idiot or doing something wrong; good to know that somebody else has seen this.
Yep, your workaround is certainly one way to deal with it. I'm dealing with a slightly different scenario in that the image data is generated already rather than dynamically inflated, and I've chosen to force the generated image to ARGB8888 instead of RGB565 - but I like your solution too.
Thanks for the response.