BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

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

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.

Messages - rascalito

Pages: [1] 2
1
Discussion - EVE / Re: Linux ASTC encoder
« on: July 27, 2022, 08:30:32 AM »
Hello!

What I would like to know is how to convert with Linux. Apparently you are also using a program named astcenc.
There is a program with a similar name on Linux. I have noticed that the linux version has a 16-byte header,
and the asset builder's raw format doesn't. What I would need to know s whether the asset builder is a regular
astcenc  like the one that can be found on GitHub, or whether it's a BridgeTek proprietary format.
For instance Linux' astc encoder does not have a -f option and -g either.

Thanks for any hint.

R

Hello,

The method we advise using utilises Eve Asset Builder’s (EAB) command line mode and should save you a lot of time.

After installing EAB, you can run the image converter from the installation folder, for example:

“eab_tools  img_cvt  -i C:/Users/Pictures/appleicon.png -f 20 -o C:/Users/Pictures/temp -e thorough -x "C:/Users/Public/Documents/EVE Asset Builder 2.6.0_3.0.0/tools/astcenc.exe" -g”

The input file is “appleicon” and output folder is “C:/Users/Pictures/temp”.

Best regards, BRT Community

2
Discussion - EVE / Re: Linux ASTC encoder
« on: July 23, 2022, 06:09:55 AM »
Hello!

Thanks for your reply.
Quote
The ASTC blocks for EVE are arranged in a pattern of larger blocks.

Does it mean that it's not true ASTC?

Is there any documentation explaining how it's encoded from the regular ASTC encoding?

Quote
I'd recommend encoding an image with a number on each square block,

What do you mean? I'm using ASTC8x8 with option thorough.

Do you mean that I should subdivide into 8x8 blocks and write a number in each of these blocks?
8x8 is not very big for writing a number.
Or divide in some larger blocks? In this case which size?

Thanks,

R

3
Discussion - EVE / Linux ASTC encoder
« on: July 16, 2022, 11:14:05 AM »
Hello!

I'm trying to make it easier to display bitmaps (i.e. without having to fetch width, height, data name, etc.. here and there).
I made a php script with Ubuntu (PHP8).
Basically I dump a bunch of files in a folder, run the script, and get all the corresponding .h and .cpp files with an option to copy
them directly in the bitmaps folder of my application. And I can call the bitmaps by name.
I'm using Linux' astc encoder (called astcenc), and here is the problem. There are quite a few parameters, a bit obscure to me.
Here is the result. It looks like the keyboard is splitted in two parts, there is a kind of interlace, etc. I'm sure there are people
here who know what happens and could help me.
There are myriads of parameters, and I can't try them one by one.
Does anybody know what parameters are used in EVE asset builder? The output name (the normal image below) is *RGBA_ASTC_8x8_KHR.
Any relation between KHR and LDR / HDR of the linux encoder?

Thanks for any hint!

R



4
Discussion - EVE / BT815 flash storage.
« on: January 27, 2022, 02:30:58 AM »
Hello!
I have a problem which doesn't seem to be documented.
I am using bitmaps stored in flash in format ASTC8x8.
I have written a function EveDisplay::StoreToFlash(uint8 * data, uint32 flash_add, uint32 len).
As if worked when debugging step by step and didn't work when running free, I suspected
a speed problem. I verified the speed from the datasheet, and it's 33 ns period.
In my case, I'm running at 13.5 MHz (MCU frequency = 216 MHz divided by 16.
And on the scope, I measure a periode in the 17 ns, so this is just fine.
Now I'm wondering about the CMD_FLASHWRITE command.
I'm sending data by blocks of 4K. If I set a delay between each block, then it works,
but otherwise it doesn't, and the screen gets lost.
I thought about checking if the screen is busy, but that would break the whole
CMD_FLASHWRITE command.

Sorry for the length, here are my questions:
1. Is there a need for some delay within the CMD_FLASHWRITE command?
2. What does the BT815 do exactly> Does it simply pipe the bytes into the flash
directly? Or does it store the bytes into a buffer that has to be flushed?
3. Is there any limit of the data buffer length of CMD_FLASHWRITE when doing
it in a single DMA burst?

Thanks for any hint.

R

5
Discussion - EVE / Re: Using flash for bitmaps
« on: July 05, 2021, 12:47:05 PM »
Hello!

I have modified my code to take into account the new height. Basically it works, and nothing is written
outside of the picture frame anymore. However, there is a tiny flaw as shown in the attached picture.
There is one little square at each of the corners of the bitmap I would like to write.
Is this an artefact of the compression method? I'm using the highest ratio, and for example a JPEG
image with a high compression ratio is blocky. So is it the reason why I get one block at each of the
corners? On the other hand, everything else looks perfect, so  that can be something else.

Thanks for any hint.

6
Discussion - EVE / Re: Using flash for bitmaps
« on: June 30, 2021, 12:55:34 PM »
Hello!

Quote
Thanks for the details, but I was looking for the code used to display the image, could you provide this?
Sorry if I was ambiguous in the previous post!

The code didn't change. The image is stored at the first 4K block after the BLOB. I'm using the
parameters from the json file.

Code: [Select]
B0 25 78 // CMD register
00 FF FF FF // BEGIN
90 60 30 02 // Color
07 00 00 26 // Erase with all flags (7)
80 00 80 01 // Bitmap source. 01800080 specifies the flash (8) and the address
// 80 is 128. 128 x 32 = 4k, the place in flash where the data is written
74 E1 FB 07 // 07FBE174 in this order: layout(07), format = ext (31 shifted gives F8)
// 1F0 is 496 (linestride). shifted and combined with the F8 gives FBE
// and finally 0174 which is 372, the width of the pixmap
BD 93 00 2E // Format EX is 93BD (37821 as explained page 58 of the documentation,
// for encoding ASTC12x12)
74 E9 02 08 // Size (without filter and repeat)
01 00 00 1F // Begin bitmap
00 40 86 8C // 8C864000 Vertex, 100x100
00 00 00 00 // END
01 FF FF FF // Swap

Thanks,

7
Discussion - EVE / Re: Using flash for bitmaps
« on: June 25, 2021, 10:11:50 PM »
Hello!

Thanks for your reply.
The display I'm using is a 7 inch, 800 x 480, with capacitive touch.
The display's board has no reference I can see, but it's written BT815/816.

Thanks,

8
Discussion - EVE / Re: Using flash for bitmaps
« on: June 25, 2021, 07:16:03 AM »
Hello!

I got close to the result. I have compressed the image with Brigetek's tools
and got output data, with the proper parameters. The linestride for some reason
is 496 (the bitmap itself is 364 x 364). As for the width and height, it became
372 x 372, probably because 364 cannot be divided by 12. (ASTC12x12 here).

By the way: is this a problem, or is it better to make bitmaps with sizes multiples
of the compression scheme (i.e. 12 x 12 in the case of ASTC12x12)?

See attachments for the results I get. Any comment is welcome to solve the problem
at the bottom of the picture.

Thanks,

9
Discussion - EVE / Re: Using flash for bitmaps
« on: June 21, 2021, 01:09:04 PM »
Hello!

Yes, I'm still struggling in getting images from flash.
I'm trying to display a bitmap directly from the flash this time. As I read in the documentation,
there are 2 conditions:
1. The flash must be in fast mode (solved)
2. The bitmap must be in ASTC format (not sure of what I did).

As I'm not sure what to choose for the encoding, I first tried with the ASTC12x12,
encoding code = 0x93BD. The output of Bridgetek's converter tells me that the stride
is 496 (1E0), so I will use this value as a linestride. As the format cannot be set
directly, I will use the format_ex setting.

By the way I wrote the data to flash direcly using cmd_flashwrite (directly from a const uint8[]
made by BT's bitmap converter). Is there any difference with writing it first to GRAM and use a
command to move it to the flash?
I'm asking that because that's how I was adviced to write the BLOB to the flash, first write to
G_RAM, and then move G_RAM to flash). Is there any problem in writing it directly?

Beside this, the documentation says that the number of bytes has to be a multiple of
256 bytes. The length of my data is 15376 bytes. What should I do? Pad to the next 256
multiple? In this case, pad with what? FF? 00? Something else?
I have used that kind of flash many times, and I know that stopping in the middle of a buffer
will just stop there, so I don't think there is a need of padding, and all the bytes
will stay as they were befor writing. Any hint?

Here is what my program sends to the LCD, and the analyzis of the SPI frame. It doesn't
work, it just displays a uniform square. The image is pretty simple, it's a uniform
dark blue with circles, as the background of a polar curve drawing program. So supposing
the image is properly written in the flash at 4096, what can be wrong?
Code: [Select]
B0 25 78 // CMD register
00 FF FF FF // BEGIN
90 60 30 02 // Color
07 00 00 26 // Erase with all flags (7)
80 00 80 01 // Bitmap source. 01800080 specifies the flash (8) and the address
// 80 is 128. 128 x 32 = 4k, the place in flash where the data is written
74 E1 FB 07 // 07FBE174 in this order: layout(07), format = ext (31 shifted gives F8)
// 1F0 is 496 (linestride). shifted and combined with the F8 gives FBE
// and finally 0174 which is 372, the width of the pixmap
BD 93 00 2E // Format EX is 93BD (37821 as explained page 58 of the documentation,
// for encoding ASTC12x12)
74 E9 02 08 // Size (without filter and repeat)
01 00 00 1F // Begin bitmap
00 40 86 8C // 8C864000 Vertex, 100x100
00 00 00 00 // END
01 FF FF FF // Swap
Thanks for any hint.

10
Discussion - EVE / Re: Using flash for bitmaps
« on: June 19, 2021, 12:08:24 AM »
Hello!

Thanks for your reply.
In fact, I did it in the meantime like this:

1. od -tx1 unified.blob
Outputs the blob bytes (I'm working on Linux Ubuntu).

At that point, I noticed that the blob is mostly empty, merely 400++ bytes, so it's not worth
storing all the FFs. Fortunately all the FFs are grouped. Basically there is one group at the start
of the 4K block and one at the end. I stored the array without the FFs, defined HEAD_END and
a TAIL_START values.

2. Do the same command with a sed -e editing, in order to obtain a sequence of 0x values.

3. After erasing the memory, make a buffer to restore the blob as it should be (pad the empty
area with FFs), and write the 4K block (your points 2 to 6).

It works fine, and I will keep this RestoreBlob method in the library. I could verify that the
status indicates now fast mode (3).

Thanks,

11
Discussion - EVE / Re: Flash busy detection
« on: June 18, 2021, 03:25:13 AM »
Hello!

Thanks for your reply.
I noticed from the documentation that 2 conditions have to be met to read directly bitmaps from flash.
1. The bitmap has to be one of the ASTC modes
2. The flash has to be set to fast mode.

Beside this, fast mode would allow me to check if it's erased (if it's back to basic, then it's erased).
So I tried to set fast mode. But without success. Here is what happens:
- Read the flash status gives me 2
- Write the command CMD_FASTFLASH returns 0, therefore I suppose it's fine. No E1_** code
- Read the flash status returns 2 (BASIC), not 3 (FAST).

Here are the scope captures.
1. For read status (that's basically a rd32 function that works everywhere else)
Code: [Select]
MOSI MISO //
30 25 F0 00 00 4A 43 42 // Flash status register (3025F0)+ extra byte, reply from MISO
00 00 00 00 02 00 00 00 // Send dummy data, get status

2. As for CMD_FLASHFAST, the documentation is a bit ambiguous.
It says: command layout
Code: [Select]
CMD_FLASHFAST // Offset = 0
result // +4
But as far as I understand SPI, the result cannot be part of the command (MOSI), it can just come from the
MISO. So I think it should be (on MOSI)
Code: [Select]
MOSI MISO
CMD_FLASHFAST dummy // Offset = 0
dummy result // +4

Similarily, the C interface should not be void cmd_flashfast(uint32 result);
but rather void cmd_flashfast(uint32 &result); or uint32 cmd_flashfast(void);

However it doesn't work, so I may be wrong.
Here is my CMD_FLASHFAST scope recording:
Code: [Select]
MOSI MISO
B0 25 78 00 4A 43 // Command register
4A FF FF FF 42 00 00 00 // CMD_FLASHFAST
00 00 00 00 00 00 00 00 // Dummy bytes on MOSI, reply on MISO

Is there anything wrong in this sequence?

Thanks,

12
Discussion - EVE / Re: Using flash for bitmaps
« on: June 18, 2021, 12:51:56 AM »
Hello!

Thanks for your reply!
In the meantime, I have found the problem, so here is a short report of what was wrong.
1. I was using a raw bitmap, defined as a const uint8[], sequence of 256 values in uint16
format (ARGB1555). No asset builder.
2. Drawing directly from GRAM works fine, so I wanted to draw to Flash (raw) and then
move flash to GRAM before drawing.
3. As you can notice, there are a few pink points in the drawing that failed, and since it's
the same color as the original picture, it gave me a hint that the flash was not empty.
Only the flash spaces containing FFFF were replaced with the pink color.
As a result, I checked my flash erase function, and the mistake was there.

By the way, in my function to write to flash, I always set an offset of 4096 bytes in order
to skip the BLOB. Is this necessary? Is there a mechanism in the chip, that would protect
the BLOB? An in this case, how do I update the BLOB?

Thanks,

Hello,

Thank you for your question.

Could you provide details on the DrawBitmap() function and how you have converted the image asset in EVE Asset Builder (i.e. what format you have used)?
Several different approaches are required depending on how you have converted the image, you can find some useful examples within EVE Screen Editors examples folder.

Best Regards,
BRT Community

13
Discussion - EVE / Flash busy detection
« on: June 17, 2021, 06:10:24 AM »
Hello!

I'm trying to use the external flash, and I have one problem:
When erasing the flash, I know by experience that it can take time.
On a 256MB flash, it may take about one minute. The one I use right now is
a 4MB, so I have made a workaround by setting a delay long enough.

Is there a way to check the flash status to be sure that it's actually erased,
and that it doesn't depend on the size?

I checked the status, but there are only 4 of them, FLASH_STATUS_INIT or
DETACH or BASIC or FULL.

As soon as I send the command for erase, the status is FLASH_STATUS_BASIC,
and I suppose it doesn't even change.

Is there another register to check for the flash status?

Thanks,

14
Discussion - EVE / Using flash for bitmaps
« on: June 17, 2021, 05:54:05 AM »
Hello!

I would like to use the flash, but I got some problems.
I reported earlier that I'm able to use bitmap when directly written to G_RAM.
Now I would like to use the flash and store compressed image, but first I want
to test the simple write to and read from flash.

Method: I'm going to use a bitmap known to work. It's a 16 x 16 bitmap.
Here is my code.

It's the same for both experiments, the only changing part
is the USD_FLASH value. The second part (when no flash is used), works.
As for the first part, it should be the same if I write the data first to flash,
then move it to G_RAM.

The first experiment, without flash, gives this result

The second experiment, with flash, gives this result.

Note that it's not exactly random, there are some pink pixels, which makes
me think I'm close to the goal, but something is wrong or missing.

Just in case: here is how I store the data to flash: (oscilloscope capture)

Code: [Select]
B0 25 78 // REG_CMDBWRITE
45 FF FF FF // CMD_FLASHWrITE
00 10 00 00 // Destination (4096 = 0x1000, just after the blob)
00 02 00 00 // Length (0x200 = 512, which is 16 x 16 x 2bytes per color)
00 00 00 00 // Start of the bitmap, these pixels are transparent
[...]
00 00 00 00 // End of bitmap, 512 bytes sent, which is a multiple of 256 as required

Here is how I move data from flash to GRAM (oscilloscope capture)

Code: [Select]
B0 25 78 // REG_CMDBWRITE
46 FF FF FF // CMD_FLASHREAD
00 00 00 00 // Destination (position = 0 in G_RAM)
00 10 00 00 // Source (0x1000 = 4096, just after the blob)
00 02 00 00 // Length (0x200 = 512, which is 16 x 16 x 2bytes per color)

Is there anything wrong in this?
By the way: is there a way to put the images inline? I suppose the reader will know which
is which, but it would be more readable.

Thanks,

15
Discussion - EVE / Re: Filling a rectangle with tiles.
« on: June 08, 2021, 01:17:30 AM »
Hello!

Thanks for your reply. Ok, that explains it all. I should have thought about it or at least read the docs more accurately.

Thanks again!

Pages: [1] 2