News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Turby

#1
Im running this on a Teensy 4.1 which has a builtin SD card, bang for buck these have massive perfomance and great support, only downside is no hardware debugging.

I have come up with a reasonable compromise which uses EVE_memWrite_sram_buffer, and a small 2KB buffer for streaming.
I simply read all raw data files (from EAB) into RAM_G from the SD card at startup. As the raw data does not include the data structure (width, height, format etc) I encode this into the file name and decode and store in a small asset manager data structure on startup.

I've not explored the inflate options, but I suspect that you would still need to reserve the same size uncompressed / raw image size in RAM_G? So apart from smaller image files, no real gain to be had, but I might (hopefully) be wrong!


struct AssetData
{
    char name[32];
    int width;
    int height;

    // when decoding filename, we expect the format and compression to be in the filename, e.g., "my_image_1024x600_ASTC_8X8.raw"
    char format[16];      // e.g., "ASTC"
    char compression[16]; // e.g., "8X8"
    bool isValid;

    uint32_t eveFormat;  // EVE format for this asset, e.g., EVE_COMPRESSED_RGBA_ASTC_8x8_KHR
    uint32_t eveAddress; // Start address in RAM_G (4-byte aligned)
    uint32_t eveSize;    // Total size of the asset in bytes
}; // AssetData


uint32_t GetEveFormat(const char *formatStr, const char *compressionStr)
{
    if (strcmp(formatStr, "ASTC") == 0)
    {
        if (strcmp(compressionStr, "4x4") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_4x4_KHR;
        if (strcmp(compressionStr, "5x4") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_5x4_KHR;
        if (strcmp(compressionStr, "5x5") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_5x5_KHR;
        if (strcmp(compressionStr, "6x5") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_6x5_KHR;
        if (strcmp(compressionStr, "6x6") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_6x6_KHR;
        if (strcmp(compressionStr, "8x5") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_8x5_KHR;
        if (strcmp(compressionStr, "8x6") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_8x6_KHR;
        if (strcmp(compressionStr, "8x8") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_8x8_KHR;
        if (strcmp(compressionStr, "10x5") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_10x5_KHR;
        if (strcmp(compressionStr, "10x6") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_10x6_KHR;
        if (strcmp(compressionStr, "10x8") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_10x8_KHR;
        if (strcmp(compressionStr, "10x10") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_10x10_KHR;
        if (strcmp(compressionStr, "12x10") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_12x10_KHR;
        if (strcmp(compressionStr, "12x12") == 0)
            return EVE_COMPRESSED_RGBA_ASTC_12x12_KHR;

        return EVE_COMPRESSED_RGBA_ASTC_8x8_KHR;
    }

    if (strcmp(formatStr, "RGB332") == 0)
        return EVE_RGB332;

    if (strcmp(formatStr, "RGB565") == 0)
        return EVE_RGB565;

    if (strcmp(formatStr, "L1") == 0)
        return EVE_L1;

    if (strcmp(formatStr, "L2") == 0)
        return EVE_L2;

    if (strcmp(formatStr, "L4") == 0)
        return EVE_L4;

    if (strcmp(formatStr, "L8") == 0)
        return EVE_L8;

    // Default fallback
    return EVE_RGB565;
} // GetEveFormat



AssetData ParseAssetFilename(const char *inputFilename)
{
    AssetData meta = {"", 0, 0, "", "", false};
    char buffer[128];
    strncpy(buffer, inputFilename, sizeof(buffer) - 1);
    buffer[sizeof(buffer) - 1] = '\0';

    // 1. Get the Name
    char *namePart = strtok(buffer, "_");
    if (namePart)
        strncpy(meta.name, namePart, 31);

    // 2. Get the Resolution string (e.g., "448x456")
    char *resPart = strtok(NULL, "_");

    // 3. Get the Format (e.g., "ASTC")
    char *formatPart = strtok(NULL, "_");
    if (formatPart)
        strncpy(meta.format, formatPart, 15);

    // 4. Get the Compression (e.g., "8X8.raw" -> "8X8")
    char *compPart = strtok(NULL, ".");
    if (compPart)
        strncpy(meta.compression, compPart, 15);

    meta.eveFormat = GetEveFormat(meta.format, meta.compression);

    // Now, safely parse the resolution string separately
    if (resPart)
    {
        char *wStr = strtok(resPart, "x");
        char *hStr = strtok(NULL, "x");
        if (wStr && hStr)
        {
            meta.width = atoi(wStr);
            meta.height = atoi(hStr);
        }
    }

    meta.isValid = true;
    return meta;
} // ParseAssetFilename


void StreamRawFileToEVE(SdFile &file, uint32_t dest_ramg_address)
{
    uint8_t buffer[2048]; // 2KB buffer for streaming
    int bytesRead;
    while ((bytesRead = file.read(buffer, sizeof(buffer))) > 0)
    {
        EVE_memWrite_sram_buffer(dest_ramg_address, buffer, bytesRead);
        dest_ramg_address += bytesRead;
    }
} // StreamRawFileToEVE

#2
I've decided to go down the ASTC route, a simple application will run EAB in command line mode to generate the necessary raw data file. This will be placed on SD card. The boot screen (full colour ASTC 8x8) can be loaded into RAM_G at startup along with approx 20 small icons (60x60) in L1 format.

The final part for me, is how to get the data from the file on the sdcard to RAMG_G in small 2048 byte chunks, using Rudolph's library. I'm using Rudolph's library extensively at the moment.
#3
How would I got about loading and displaying a large image (1024x600) from sd card on a Riverdi 7" display which uses a BT817?

Its for a boot screen which only needs to be displayed once at startup. I don't really want to have to get the user to convert images to ASTC format first, nor do I want to store the file in external eeprom either.

All the examples I see are for small images which fit into EVEs memory nicely... but what about full screen images?

Is there a a simple "picture frame" application which supports files from SD card for larger display sizes?

Cheers
Toby
#4
Thanks for the tips on font sizes 32 to 34, not sure how I missed that - these larger sizes are very useful.

Regards limit of 255 font size in EAB, this size is very close to what I need, so will make do with it, though I'm sure others would find it useful to be able to go larger particularly when converting symbol based fonts. Would it be possible to also extend EAB by having the option to specify font size by pixel height as well ?

Kind regards
Toby
#5
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 ?
#6
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!





#7
Hi,

I'm looking to purchase a 7" display with the new Eve4 BT817 controller. I am migrating an existing application which uses a 5" display which has square pixels. From reading 7" TFT datasheets I see that pretty much all of them have non-square pixels. For example the 7" 1024x600 Riverdi RVT70HSBFWN00 has a pixel size of 0.1506 (width) × 0.1432 (height).

The main reason why I want this is to display round circles, not ellipses, it also makes any math for coordinates easier.

I've searched the various datasheets but not finding much in the way of how to use Horizontal Scanout Filter. Even how its actually set (see https://brtchip.com/wp-content/uploads/Support/Documentation/Datasheets/ICs/EVE/DS_BT817_8.pdf)

If I were to keep 1024 x 600 and set HSF to get square pixels, would I then see an unused region on the right hand edge of the display? If so, could I then increase the resolution to (for example) 1060 x 600 to use the entire width of the display?

Is there an example of this being used I could look at?

As an aside does the Eve Screen Builder / Design software (or any other similar tools) take HSF into consideration?

Many thanks
Toby