Loading Images at Runtime STM32F764
Hi,
I am building an application for a Custom Board using STM32F746 and TouchGFX.
I followed all the instructions found : https://support.touchgfx.com/docs/development/ui-development/scenarios/loading-images-at-runtime/
But i can not print an image stored in SD .
//-----------------------------------------------------------------------------------------------------------------------
// BoardConfiguration.cpp
//-----------------------------------------------------------------------------------------------------------------------
static LCD16bpp display;
static uint16_t bitdepth = 16;
static uint32_t bmpCache = (uint32_t)(0xC0008000); // SDRAM
namespace touchgfx
{
void touchgfx_init()
{
uint16_t dispWidth = 800;
uint16_t dispHeight = 480;
HAL& hal = touchgfx_generic_init<STM32F7HAL>(dma, display, tc, dispWidth, dispHeight, (uint16_t*)bmpCache, 232000, 3);
...

//-----------------------------------------------------------------------------------------------------------------------
// ScreenView.cpp
//-----------------------------------------------------------------------------------------------------------------------
void Screen1View::updateValues(void){
...
/***************This Part Works Fine***************************/
* if( myBinarySem01Handle != NULL ){
*
* /* See if we can obtain the semaphore. If the semaphore is not
* available wait 10 ticks to see if it becomes free. */
* if( xSemaphoreTake( myBinarySem01Handle, ( TickType_t ) 10 ) == pdTRUE )
* {
*********************************************************
BMPFileLoader::getBMP24Dimensions(&MyFile, width, height);
bmpId = Bitmap::dynamicBitmapCreate(width, height, Bitmap::RGB565);
if (bmpId != BITMAP_INVALID)
{
//read the bitmap file into the dynamic bitmap
BMPFileLoader::readBMP24File(Bitmap(bmpId), (BMPFileLoader::FileHdl)&MyFile);
image.setBitmap(Bitmap(bmpId));
image.setXY(20, 20);
image.invalidate();
}
}
//-----------------------------------------------------------------------------------
// SD card Read (In Other Task)
//-----------------------------------------------------------------------------------
case MOUNTED:
//Find the first .bmp file
// r = f_findfirst(&d, &info, sdpath, "*.jpg");
r=0;
if (r == 0)
{
r = f_open(&f, "trees.bmp"/*info.fname*/, FA_READ);
if (r == 0)
{
sdstate = FILE_OPENED;
/*Test Variables*/
MyFile = f;
if( myBinarySem01Handle != NULL )
{
if( xSemaphoreGive( myBinarySem01Handle ) != pdTRUE )
{
// We would expect this call to fail because we cannot give
// a semaphore without first "taking" it!
asm("nop");
}
}
//---------------------------------------------------------------------------------------
The Question :
As i can see from the debug f_open Finds the file and stores it to f variable. I can also see the data in f in the touchGFX task , So i think this part works.
But the function
BMPFileLoader::getBMP24Dimensions(&MyFile, width, height);
returns Huge width and height

and
bmpId = Bitmap::dynamicBitmapCreate(width, height, Bitmap::RGB565);
returns Invalid ID
