BRT Community

General Category => Discussion - EVE => Topic started by: FlorianG on September 11, 2023, 09:57:11 PM

Title: Modularly load ASTC images
Post by: FlorianG on September 11, 2023, 09:57:11 PM
Hi :),
I have a problem with astc images.
I can't put multiple ASTC images one behind the other. Is this normal, and is there a way to fix it?
My goal is to be able to modularly load ASTC images into memory.
Title: Re: Modularly load ASTC images
Post by: BRT Community on September 12, 2023, 09:41:50 AM
Hi Florian,

For your images, is the issue related to their storage within flash or is it when you load them to RAM_G in consecutive locations?
Depending on where they are stored at the time of displaying, it may be a data alignment issue.
Does the first one display correctly but the following images are not displayed correctly?

Best Regards, BRT Community
Title: Re: Modularly load ASTC images
Post by: FlorianG on September 17, 2023, 02:09:47 AM
I load all the data into the flash.  I put the image data one after the other directly, then I indicate the address of the images before loading them.
And indeed the first image is displayed correctly but the following ones do not work at all and sometimes they crash the chip
Title: Re: Modularly load ASTC images
Post by: BRT Community on September 22, 2023, 12:48:30 PM
Hi Florian,

This should work well but we can try it here,

Do you load all images on the same screen or are you displaying one at a time?
Also, are they large images or just small icons?

Do you have some images which we could try so that we use the same ones?
You can email them if preferred to support.emea@brtchip.com and we can try them,
Please also include details of which addresses you load them to and if possible a screenshot of your asset builder for Image conversion and for the Bin file creation so that we can try to recreate it as closely as possible.

p.s. If you don't use EAB for loading the data, ensure that your flash alignment meets all requirements for SetBitmap (works in 32 byte blocks) and for the flash commands if you write the data using Flashupdate etc. (4096 byte alignment)

Best Regards, BRT Community




Title: Re: Modularly load ASTC images
Post by: FlorianG on September 27, 2023, 11:38:45 PM
Thank you for your help, I will send you all this by email as soon as possible
Title: Re: Modularly load ASTC images
Post by: HEYYA on February 01, 2024, 10:05:51 AM
May I know if this issue is resolved?

I want to update a few images(size of image is same as screen size) in the flash. My CMD_FLASHUPDATE is not working.

Title: Re: Modularly load ASTC images
Post by: BRT Community on February 01, 2024, 02:55:21 PM
Hi,

Could you post an example of your flash update routine and we can help to check it,

In general, you would write your data to RAM_G (must be 4-byte aligned). You always write multiples of 4096 and so note that you may wish to clear the full block of multiple 4096 within RAM_G and then write your content to RAM_G  if the content is not a multiple of 4096 bytes. The flash address must also be 4096 bytes aligned,

Then call the flashupdate command and await completion.

void cmd_flashupdate ( uint32_t dest,  uint32_t src,  uint32_t num );

Best Regards, BRT Community

Title: Re: Modularly load ASTC images
Post by: HEYYA on February 02, 2024, 08:24:40 AM
         Ft_Gpu_CoCmd_FlashRead(phost, ram_addr, flash addr, size);/* 480x272 */
         Ft_Gpu_CoCmd_FlashUpdate(phost, flash addr, ram addr, size);

The flash read command works properly and I am able to display the image through setbitmap function. But when I write code for flash update, the program crashes.



Title: Re: Modularly load ASTC images
Post by: BRT Community on February 02, 2024, 09:05:54 AM
Hi,

Could you please also advise example values used in your function calls, for your parameters,

Best Regards, BRT Community
Title: Re: Modularly load ASTC images
Post by: HEYYA on February 02, 2024, 09:11:37 AM
Hi,

ram addr = 526336
flash addr = 526336 is what I have written in the functions
Title: Re: Modularly load ASTC images
Post by: Rudolph on February 02, 2024, 09:16:53 AM
I have a working implementation of CMD_FLASHUPDATE that you can compare against.
The mentioned alignment requirements are strict, EVE does nothing if these are not met.
That "the program crashes" is not something I would expect from incorrect alignment though.
Title: Re: Modularly load ASTC images
Post by: HEYYA on February 02, 2024, 11:39:01 AM
Yes Rudolph, I have seen the code. But it isn't working for me.

 Isn't the CMD_FLASHREAD writing the flash image to RAM_G. Or is it writing it to some other memory?

Also I am trying to write the same image which I read from flash to memory earlier using CMD_FLASHREAD. Is there any extra thing to be done other than calling CMD_FLASHUPDATE in this case?
Title: Re: Modularly load ASTC images
Post by: BRT Community on February 02, 2024, 02:27:16 PM
Hi,

I think your addresses are not aligned to 4096 bytes, please check and maybe try address 4096 in RAM_G and Flash as a test if you can,

Best Regards, BRT Community
Title: Re: Modularly load ASTC images
Post by: FlorianG on April 23, 2024, 02:13:00 AM
Hi,

I really tried a lot of different combinations and different alignments in RAM but none worked.  Can you send us an example of two different images generated separately but both loaded at the same time in memory and which would be functional on the chips.  I will also be very curious to see how did you achieve this result.  Posting them here lets us know if the problem comes from our image generation or the way we load them into memory.
Title: Re: Modularly load ASTC images
Post by: BRT Community on April 26, 2024, 02:57:29 PM
Hi,
Yes we can post an example,
Are we correct that you want 2 or more ASTC images in Flash which are then copied to RAM_G and displayed simultaneously on the screen?
Best Regards, BRT Community

Title: Re: Modularly load ASTC images
Post by: FlorianG on April 28, 2024, 01:33:52 PM
Hi,
firstly I go directly from the CPU to the RAM G. but you can also show another example by having the method of going from the CPU to the flash then to the RAM G
Title: Re: Modularly load ASTC images
Post by: BRT Community on April 30, 2024, 09:45:10 PM
Hi,

No problem, we'll post an MCU to RAM_G example first and then provide a flash one too,

Best Regards, BRT Community