int _GetData(void * p, const U8 ** ppData, unsigned NumBytes, U32 Off) { char _acBuffer[0x6000]; FILE * phFile; uint32_t NumBytesRead; phFile = (FILE *)p; // // Check buffer size // if (NumBytes > sizeof(_acBuffer)) { NumBytes = sizeof(_acBuffer); } // // Set file pointer to the required position // fseek(phFile, Off, SEEK_SET); // // Read data into buffer // NumBytesRead = fread(_acBuffer, sizeof(char), NumBytes, phFile); // // Set data pointer to the beginning of the buffer // *ppData = _acBuffer; // // Return number of available bytes // return NumBytesRead; } static void Display (void const *arg) { FILE * while (1) { etapa++; if (etapa >=3) etapa =1; switch(etapa){ case 1: GUI_Clear(); GUI_DrawBitmap(&bmLogo800x480px, 0, 0); //this bitmap is loaded in flash with bmp converter break; case 2: GUI_Clear(); //here we tried to load the file from sd card hFile = fopen ("Logo.bmp","r"); if (hFile !=NULL){ if (!GUI_BMP_DrawEx(_GetData, hFile, 0, 0)) { } fclose(hFile); } break; } osDelay(5000); } }