cancel
Showing results for 
Search instead for 
Did you mean: 

How can I save an BMP image at runtime, loaded from USB to flash or External Flash, for using it like images database.

Nino_Calarco
Associate

Good Morning

I'm developing a custom board derived from STM32F746G-Disco evaluation board as reference design, and using TouchGFX for creating HMI project.

This custom board is complete of STM32F746NGH6 micro controller, TFT Display RGB888, SDRAM, 16MB QSPI, OTG-USB, RTC Calendar clock, WiFi module, etc.

I completed all customer requested functions, except for last thing that is following:

the customer require the possibility to personalize the trademark logo image, loading it from USB and saving on Flash for using later during normal operation.

I was able to reading from USB, caching the dynamic image, converting and displaying the preview, but last remaining thing is how can I save it for using at runtime?

I was thinking to use last free Flash bank or QSPI that is half free for save it and reload later at runtime, like I did from USB.

Please could you suggest a solution for?

Thank you very much

Antonino Calarco

4 REPLIES 4
MM..1
Chief II

Direct use BMP is complicated, but you can go two ways:

  1. Store BMP to QSPI , write converter code and on runtime starting convert to ram bitmap cache.
  2. Load BMP to ram and convert to QSPI in converted format or externaly convert BMP to BIN

For simple use is good define one image size. For both you need fake image in bitmap database .

Nino_Calarco
Associate

Hi MM

the converted image from BMP to RAM using the dynamic bitmap loader, indexes the image to be used like all images database. Of course I made a fake image inside the screen like a sort of placeholder that is indexed inside images database, so could be useful to replace the empty placeholder with new image, but the problem is that QSPI is memory mapped and the writing operations are denied. So simplest way to save images at runtime is the internal flash and use it at runtime. Perhaps have you a sample code to do this?

Thank you

Antonino

If the source media disappears, perhaps you can detect and copy the image into a defined position in QSPI​ *before* you memory map it.

ST usually has examples of using FATFS with SDCARD or USB MSC Host​, this is perhaps as close to something drop in as you'll find.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Hi Nino,
for store to QSPI you simply stop mapped mode and write what you need, only condition is in save time don’t use QSPI on screen or pause GFX.
For store to internal flash you can use EEPROM simulation examples.