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
{
"prototype": "void cmd_swap( );",
"layout": [
"+0 CMD_SWAP(0xFFFF FF01)"
]
},
{
"prototype": "void cmd_append( uint32_t ptr, uint32_t num );",
"layout": [
"+0 CMD_APPEND(0xFFFF FF1E)",
"+4 ptr",
"+8 num"
]
},
{
"prototype": "void cmd_mediafifo ( uint32_t ptr, 119 Product Page Version 2.6 Document Reference No.: BRT_000225 Clearance No.: BRT#129 uint32_t size );",
"layout": [
"+0 CMD_MEDIAFIFO (0xFFFF FF39)",
"+4 ptr"
]
},
Quote
Regarding Q2, yes I presume resolution 1100x700 by itself is not a problem. The problem is my image. Find attached original and converted image, encoded with ASTC 4x4 and 6x6.
Quote from: TreeOone on May 30, 2025, 09:41:41 PM
Hi.
Sometimes, because of answers ,,Whatever the correct way is to calculate Stride and Height in BITMAP_LAYOUT for ASTC, just stop using it and switch to CMD_SETBITMAP", I begin to think who on earth would want to use Bridgetek's solutions.

Quote
Regarding your question, there is a function BITMAP_SOURCE in your library, but it is missing option to set FLASH as a source. One can not set bit No. 23 to 1.//#define BITMAP_SOURCE(addr) ((DL_BITMAP_SOURCE) | ((addr) & 0x3FFFFFUL))
/**
* @brief Set the source address of bitmap data in RAM_G or flash memory.
* @return a 32 bit word for use with EVE_cmd_dl()
*/
static inline uint32_t BITMAP_SOURCE(const uint32_t addr)
{
return (DL_BITMAP_SOURCE | (addr & 0x3FFFFFUL));
}
Quote
I have 2 more questions:
Q1: Can you perhaps say why EAB, when generating ASTC images, creates files with extension .astc and .raw. If .astc is given to BT817, image does not load well, whereas .raw generates image OK. What's the difference? I also tried creating ASTC images with ASTC encoder (downloaded from official ARM's GitHub page). Same problems. Results are not compressed.
Quote
Q2: I noticed some images encoded in ASTC_6x6_KHR display correctly, whereas when they are encoded in ASTC_4x4_KHR, they do not display at all. I am talking about same original image, for which EAB created two .raw files, one with 4x4 and other time with 6x6 encoding. What is the catch here? My test image has resolution 1100x700 px. The only difference which I can see is that result of 4x4 encoding has 1100x700 px, whereas if it is encoded with 6x6, resolution changes to 1104x702 px.
//#define BITMAP_SOURCE(addr) ((DL_BITMAP_SOURCE) | ((addr) & 0x3FFFFFUL))
/**
* @brief Set the source address of bitmap data in RAM_G or flash memory.
* @return a 32 bit word for use with EVE_cmd_dl()
*/
static inline uint32_t BITMAP_SOURCE(const uint32_t addr)
{
return (DL_BITMAP_SOURCE | (addr & 0x3FFFFFUL));
}
Quote
I am not sure this is OK:
EVE_cmd_dl(BITMAP_LAYOUT(EVE_GLFORMAT, image_width * bits_per_pixel / 8.0, image_height));

Quote
// Source is FLASH -> can NOT use Rudolph's library
char file_name[] = "Image 4_500x376_COMPRESSED_RGBA_ASTC_4x4_KHR.raw";
uint32_t image_width = 500;
uint32_t image_height = 376;
float_t bits_per_pixel = 8;
uint32_t bitmap_format = EVE_ASTC_4X4;
printf("Attempting to display image %s !\r\n", file_name);
demo_CoPro_13(buffer, file_size, image_width, image_height, bitmap_format, bits_per_pixel);/*
Use FLASH to display bitmaps in ASTC format.
*/
void demo_CoPro_13(uint8_t *image_location, uint32_t image_size, uint32_t image_width, uint32_t image_height, uint32_t bitmap_format, float_t bits_per_pixel)
{
if(EVE_memRead32(REG_FLASH_STATUS) != EVE_FLASH_STATUS_FULL)
{
printf("Error, flash is NOT in full speed status!\r\n");
return;
}
else
{
printf("EVE's flash is in full speed status!\r\n");
}
uint32_t flash_size = EVE_memRead32(REG_FLASH_SIZE);
printf("Flash size: %d Mbytes\r\n", flash_size);
write_to_EVE_flash_via_RAM_G(sizeof(bt817_blob), image_location, image_size);
uint8_t *result = read_from_EVE_flash_via_RAM_G(sizeof(bt817_blob), image_size, image_location, 0);
sdram_free(result);
uint32_t underrun_flag_status_start = EVE_memRead32(REG_UNDERRUN);
// Clear EVE's cache
EVE_cmd_clearcache();
EVE_cmd_dl(CMD_DLSTART); // tell EVE to start a new display-list
EVE_cmd_dl(DL_CLEAR_COLOR_RGB | WHITE); // sets the background color
EVE_cmd_dl(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG);
EVE_color_rgb(BLACK);
EVE_cmd_dl(BITMAP_HANDLE(0));
uint32_t source_value = (1UL << 23) | (sizeof(bt817_blob) / 32);
uint32_t command = DL_BITMAP_SOURCE | source_value;
// Source is FLASH -> can NOT use Rudolph's library
EVE_cmd_dl(command);
// Specify the source bitmap memory format and layout for the current handle.
EVE_cmd_dl(BITMAP_LAYOUT(EVE_GLFORMAT, image_width * bits_per_pixel / 8.0, image_height));
// Additional specification needed for GLFORMAT
EVE_cmd_dl(BITMAP_EXT_FORMAT(bitmap_format));
//This command is the extension command of BITMAP_SIZE for bitmap larger than 511 by 511 pixels.
EVE_cmd_dl(BITMAP_SIZE_H(image_width, image_height));
//Specify the screen drawing of bitmaps for the current handle
EVE_cmd_dl(BITMAP_SIZE(EVE_NEAREST, EVE_BORDER, EVE_BORDER, image_width, image_height));
EVE_begin(EVE_BITMAPS);
// Display image at coordinates 0, 0
EVE_cmd_dl(VERTEX2II(0, 0, 0, 0));
//To draw the graphics primitives beyond the coordinate range [(0,0), (511, 511)], use VERTEX2F instead.
EVE_end();
EVE_cmd_dl(DL_DISPLAY); // put in the display list to mark its end
EVE_cmd_dl(CMD_SWAP); // tell EVE to use the new display list
uint32_t underrun_flag_status_end = EVE_memRead32(REG_UNDERRUN);
printf("underrun_flag_status_start = %d\r\n", underrun_flag_status_start);
printf("underrun_flag_status_end = %d\r\n", underrun_flag_status_end);
}EVE_cmd_dl(BITMAP_LAYOUT(EVE_GLFORMAT, image_width * bits_per_pixel / 8.0, image_height)); 