cancel
Showing results for 
Search instead for 
Did you mean: 

FatFs + SD card (Digital photo frame), using STM32F746G-DISCO

Danny_UNSJO
Associate

Excuse me guys, I'm working on the project(Digital photo frame) using TouchGFX and STM32CubeIDE. I set up 2 screen by TouchGFX, screen 1 is for setting the time to change to the next image. screen 2 is for display those images. And I have 5 BMP files stored in the SD Card, then I need to use FatFs to read the 5 bmp files and display on the LCD screen. But I don't know how to use FatFs to read bmp files and display on screen 2, can anybody help? 

3 REPLIES 3
Edmantanar
Associate

If your BMPs are large, consider reading and displaying them in chunks to save memory. Also, double-check your color format (e.g., RGB565) to match the LCD's requirements.

I'd probably start by getting FATFS working, and enumerating through the files, reading the .BMP headers, determining if the size fits the screen, and you have enough RAM or if you need to process or decimate the content.

If you're unfamiiar with .BMP files, content and format, perhaps write some PC side C code to process/inspect. It will be easier to debug the logic and functionality on the host rather than the target.

Multiple .BMP forms with different color depths, and palette tables.

Similarly if you expect to process JPG or GIF, etc too

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Criskanda
Associate

I worked on something similar a while back for a DIY digital picture frame. While I didn’t use TouchGFX or STM32CubeIDE, I did wrestle with getting images from an SD card to display correctly. With FatFs, the key is to make sure your BMP files are in a format your system can handle (e.g., 24-bit uncompressed).You’ll want to start by using FatFs to open the file, read the header to confirm the format, and then stream the pixel data to your framebuffer. TouchGFX has great support for custom image loaders, so you might want to write a small function that reads the BMP line by line and pushes it to the display buffer.