General Category > Discussion - EVE

Moving 1024x600 JPG / PNG from SD Card to Flash then displaying

(1/2) > >>

Turby:
Hi,

I'm working on a embedded system using a Teensy 4.1 with SD Card, and Riverdi 7" 1024x600 EVE4 BT817 display with 512Mb flash chip. I'm also using the excellent EVE library from Rudolph.

The idea is to place a standard JPG or PNG file on to the SD card with a known name eg boot.jpg and this is displayed at startup.

When the power is applied the SD card is scanned for the file boot.jpg and then the image is transferred from SD Card to the EVE flash, and then removed from the SD card.

The next time the power is cycled the boot image is displayed from flash.

So my questions are:
1.Is this actually possible with large 1024x600 jpg / png images
2. How do I transfer the file boot.jpg from SD card to Image flash using the Rudolph library ? I Assume I need to do this in chunks
3. Do I need to convert image into ASTC format or can I leave as native JPG / PNG ?
4. Lastly how do I display image directly from flash using the Rudolph library ?

For info, my test app using the Rudolph library is working perfectly so far on the Teensy 4.1 using DMA and have got my ASTC 5x5 icon font working well.

Hopefully someone (like Rudolph) and point me in the right direction!





Rudolph:
Hello,

the BT81x can only display ASTC compressed images directly from flash and 1024x600 is too large for RAM_G, at least in full color, so you need to convert the images to ASTC first.

In my example code I am using EVE_cmd_flashupdate() to write an flash image with an UTF-8 font from RAM_G to the external flash. This flash image is zlib compressed which in case of the example has two reasons, the first is that the .glyph files are highly compressable due to a combination of redundant structures since every glyh is one image and depending on the font there are a number of empty glyphs.
The second reason is that CMD_INFLATE only works with correct data, so the data also gets verified.

I have a function EVE_memWrite_sram_buffer() as means of transferring data from the host to EVE.
So first you just loop thru reading the data from sd-card to a buffer and writing that buffer to RAM_G in EVE.
And then you call EVE_cmd_flashupdate() to write that data from RAM_G to the flash.

Noteworthy is that CMD_FLASHREAD only accepts data in multiples of 4096.
And it helps to have the binary blob already in place that is needed by EVE to initialise the flash to full speed.

Annother consideration is that the ASTC format needs to be fixed.
On the one side to make the flash-layout planable, on the other side to display it correctly.
I usually go with 8x8 which is 2 bits per pixel, so a 1024x600 image would come out as 150k compressed.
Note, table 12 in the programming guide is partly wrong: https://en.wikipedia.org/wiki/Adaptive_scalable_texture_compression

Turby:
Thanks for the tips Rudolph,

I have managed to load several compressed ASTC 5x5 images into flash, each of which contain a number of "stacked" images. I can then display any these stacked images directly from flash just like a font. I have also managed to load a small PNG file from SD card to RAM_G (using EVE_cmd_loadimage) , though even a single 224 x 224 png comes out at 100KB which limits its effectiveness. I'm wondering if I can use flash with EVE_cmd_loadimage.

I'm working on a 7" 1024x600 display and have found that the largest font 31 is quite small, is there a way to display zoomed font bitmaps using the inbuilt fonts ?

I notice that the largest font that EVE Asset Builder can convert is limited to a size of 255, which come out at "only" 190 pixels high. Is this a feature of EAB ?

BRT Community:
Hello,

Unfortunately it is not possible to scale the inbuilt fonts in an efficient manner, we would recommend converting these to a larger point size with the font conversion tool.
I can provide the details on the font files used for the inbuilt fonts if desired.

And yes currently the largest conversion possible in EAB is 255, is this too small for your application?

Best Regards,
BRT Community

Rudolph:

--- Quote from: Turby on August 02, 2021, 12:25:14 AM ---I'm wondering if I can use flash with EVE_cmd_loadimage.

--- End quote ---

There is OPT_FLASH or in case of my library EVE_OPT_FLASH which makes the flash memory the source
for image data but I am not aware that I ever used this feature.


--- Quote ---I'm working on a 7" 1024x600 display and have found that the largest font 31 is quite small,

--- End quote ---

31 is not the largest font, 34 is.
But in order to use 32 to 34 you need to use CMD_ROMFONT to assign these to a bitmap-handle.

Navigation

[0] Message Index

[#] Next page

Go to full version