Skip to main content
Senior
October 22, 2025
Question

Loading a PNG Image from USB

  • October 22, 2025
  • 1 reply
  • 222 views

Hello, I would like to know if there are any methods to load PNGs/JPGs from a USB for the stm32 (I am on stm32F7). I currently imported lodepng but, it seems the malloc used by it is way too large for the device. The png I am loading is relatively small, 185 x 43.

unsigned err = lodepng_decode24(&img, &w, &h, file, fileSize);
	if(err)
	{
		return MEMORY_ERROR;
	}

 

1 reply

Osman SOYKURT
Technical Moderator
October 27, 2025

Hello @Priyank ,

My colleague has answered a similar question few months before (same approach for USB and SD card) :
https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/using-sd-card-in-touchgfx-freertos-project/m-p/790174#M42758

I invite you to have a look at his answer.

Osman SOYKURTST Software Developer | TouchGFX
PriyankAuthor
Senior
November 3, 2025