I have achieved to draw bmp, gif and jpg images with related DrawEx functions of stEmWin library. The library version of stEmWin is 544. My board is STM32F746G-DISCO.
In order to try png images, I downloaded png library from segger's web site. I imported the source files of the png library(V544) into my project succesfully. When I try to call GUI_PNG_DrawEx function, I am getting hardfault error.
You can find my project in the attachments. The project is really simple. We are using FATFS without OS. We are trying to show a simple logo.png file inside the SD card. However, we are getting hardfault error. We need to use png image files in our product. If someone helps us, we will be really happy.
Our get_data function for PNG is like this. What can be the source of our problem? I could not upload the project because of maximum file size limit. If you have questions, I can give you all details about the project.
You can also find and download the project from the following link.
community.st.com/s/question/0D…-is-wrong-with-my-project
/* Private functions ---------------------------------------------------------*/
int APP_GetData_PNG(void * p, const U8 * * ppData, unsigned NumBytesReq, U32 Off)
{
FIL* file;
uint32_t NumBytesRead;
U8 * pData;
pData = (U8 *)*ppData;
file = (FIL *) p;
// Set file pointer to the offset location
f_lseek(file, Off);
// Read data into buffer
f_read(file, pData, NumBytesReq, (UINT*)&NumBytesRead);
// Set data pointer to the beginning of the buffer
// Return number of available bytes
return NumBytesRead;
}
In order to try png images, I downloaded png library from segger's web site. I imported the source files of the png library(V544) into my project succesfully. When I try to call GUI_PNG_DrawEx function, I am getting hardfault error.
You can find my project in the attachments. The project is really simple. We are using FATFS without OS. We are trying to show a simple logo.png file inside the SD card. However, we are getting hardfault error. We need to use png image files in our product. If someone helps us, we will be really happy.
Our get_data function for PNG is like this. What can be the source of our problem? I could not upload the project because of maximum file size limit. If you have questions, I can give you all details about the project.
You can also find and download the project from the following link.
community.st.com/s/question/0D…-is-wrong-with-my-project
/* Private functions ---------------------------------------------------------*/
int APP_GetData_PNG(void * p, const U8 * * ppData, unsigned NumBytesReq, U32 Off)
{
FIL* file;
uint32_t NumBytesRead;
U8 * pData;
pData = (U8 *)*ppData;
file = (FIL *) p;
// Set file pointer to the offset location
f_lseek(file, Off);
// Read data into buffer
f_read(file, pData, NumBytesReq, (UINT*)&NumBytesRead);
// Set data pointer to the beginning of the buffer
// Return number of available bytes
return NumBytesRead;
}