Using bitmaps from flash

I am having a problem with assigning bitmap data into flash memory and then directly accessing it from there. i am using an arduino Uno and the u8g2 library.

is there any way i can store this bitmap into flash memory and then accessing it with u8g2.drawXBM()

every time i try using a bitmap in my sketch it gets loaded into ram and i am finding it difficult to instead load it onto Flash. i dont want to load onto ram because my ram is very small due to the full frame buffer in the u8g2 library.

is it even possible to load such bitmap into the flash

parts list:
u8g2 library
arduino UNO
ST790 display

Do you get an error message, or do you just want to know in general? Can you specialize your question, what do you like to do and what code do you use for it? That would always be very helpful!

For informed help, please read and follow the directions in the "How to get the best out of this forum" post.

State which Arduino you have, as accessing flash memory requires special considerations.

i have updated the post

see the updated the post

For some reason @stryxter flagged this topic and made the following comment

i think i found out that there is no solution to this particular problem . i tried forcing the program to store bitmaps into flash directly(that was a success), but when the bitmap would be printed on the screen, its printed with corruption, its just random pixels. So i think in conclusion the library (u8g2 library printing on the display) requires the bitmap data to be stored instead in RAM and RAM only, otherwise data collected in other memory type would return corrupted when used for bitmaps

See the U8g2 documentation, for PROGMEM images use drawXBMP().

yes thank you this exact command works.

just a small question: this will of course be slower than drawXBM() because its in flash instead of RAM right?

May be a slight bit slower, but the memory access time is likely insignificant compared to how long it takes to transfer the buffer to the display.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.