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 - Rudolph

Pages: 1 ... 24 25 [26] 27
376
Discussion - EVE / Re: Speeding up font conversion
« on: May 26, 2019, 11:52:00 AM »
I converted the notosans-regular-webfont.ttf I generated to sizes from 13 to 30 now.
I used the EVE Asset Builder 0.4.2 with its default settings and only changed the font-size from one conversion to the next.
ASTC block footprints: auto
Compression Speed: thorough
Addr of Font Data: FLASH 4096

I put all the .glyph and .xfont files in a flash image and placed an image at the end.
My programm first copies the .xfont files to G-RAM using cmd_flashread.
In the display-list my programm used cmd_setfont2 to assign bitmap handles to the custom fonts.
And finally my programm prints out the same text ten times with different fonts.
The first 9 lines are font-sizes 13 to 21, the last line is with internal font 28.
The image is displayed directly from FLASH.

I was prepared to add my files as attachments but I could not attach them all: Restrictions: 4 per post, maximum total size 192KB, maximum individual size 128KB

The high-res version of Font_Test_4.jpg is 1,09MB and the zipped Font-Test_4.bin is 219kB.

The notosans-regular-webfont.ttf is the version of the notosans-regular.ttf from Google that I stripped down to only 222 Glyphs.
This is purely attached for testing purposes and in no way meant as redistribution for anything else but testing.



377
Discussion - EVE / Re: Speeding up font conversion
« on: May 22, 2019, 06:56:06 PM »
One thing to mention is that the Asset Builder has a feature where it can re-calculate the addresses of the fonts in the bin file. When generating the flash in the 'Generate Flash' tab, if you have the .xfont file with the same name in the same folder as the glyph file, it will adjust the data address of the font accordingly. This means you don't need to re-convert the fonts a second time and will save a lot of time.

Now this is really interesting, thank you Graham!  :)

I tested it and it changes a 16 bit word at offset 0x20 of the .xfont file, both in the original file and
in the flash image.
This puzzled me at first, this is the start of graphics data.
But instead of the absolute address it is the number of a block the size of 32 bytes, just like what BITMAP_SOURCE
is used with to display a picture from FLASH.
So 0x0080011e at offset 0x20 means that is in FLASH at address 0x11e * 0x20 = 0x23c0.
And the following glyph adresses are all relative to this start address.

Nice, so most of what I tried to get a number of fonts into FLASH was pointless since the adress
we use the "Generate Font" tool pratically becomes meaningless when we use "Generate Flash".
I like that.

Unfortunately, with this working as intended, I have no idea left why my fonts are not working.

And since I also used the "User Guide" while playing with the EVE Asset Builder, I noticed that it does not
match version 0.4.2.
It appears to be written for 0.4.1. and there have been some changes to the Asset Builder that did not make
it into the "User Guide".

378
Discussion - EVE / Re: Speeding up font conversion
« on: May 20, 2019, 05:49:01 PM »
I almost forgot that I put this here, it has been a couple of weeks since I had time to try this.

I still would really like to know how it is possible to place more than one font into the external flash.

And I re-checked it again, there are no updates available, no newer datasheet, no newer user-guide, no newer asset-builder.
Can we please get some updates, please?

I saw there even is a beta-section for things to test out - only empty.

379
Discussion - EVE / EVE Image Converter and Alpha-Channel
« on: May 20, 2019, 05:43:11 PM »
I have a problem with the EVE Image Converter.
I needed an image for a project and in order to comply with corporate identity I asked a colleague
who does graphics design for a couple of departments, mostly to create apps.

He had a fitting image in his library and sent me a couple of .png files with a variety of resolutions derived from a vector drawing.

Now the problem is, the images he sent me are 32 bit .png, the 8-bit alpha-channel is used for anti-aliasing.
And he made a very convincing argument that this is quite normal in graphics design.

The problem I have is that img_cvt.exe completely ignores the 8-bit alpha channel.
Everything that is in the alpha-channel gets to be transparent and so any anti-aliasing is lost.
And the dither option makes it even worse, at least it can be disabled now.

381
Discussion - EVE / Speeding up font conversion
« on: April 22, 2019, 08:38:06 PM »
https://www.fontsquirrel.com/tools/webfont-generator
The resulting notosans-regular-webfont.ttf only has 222 glyphs.

Then I converted the font using the EVE Asset Builder.
ASTC block footprints: Auto
Compression Speed: thorough
Addr of Font Data: FLASH

I did this for font-sizes of 12, 14, 16, 18 and 20.

At first I converted all fonts to FLASH address 4096.
Then I put together a flash file, putting .glyph and .xfont files in pairs in it:

notosans-regular-webfont_12_4096.glyph               : 4096   : 119936
notosans-regular-webfont_12_4906.xfont               : 124032 : 5056
notosans-regular-webfont_14_129088.glyph             : 129088 : 120064
notosans-regular-webfont_14_129088.xfont             : 249152 : 5056
notosans-regular-webfont_16_254208.glyph             : 254208 : 269760
notosans-regular-webfont_16_254208.xfont             : 523968 : 5056
notosans-regular-webfont_18_529024.glyph             : 529024 : 270016
notosans-regular-webfont_18_529024.xfont             : 799040 : 5120
notosans-regular-webfont_20_4096.glyph               : 804160 : 180032
notosans-regular-webfont_20_804160.xfont             : 984192 : 5120
chipsie_40x56_40x56_COMPRESSED_RGBA_ASTC_8x8_KHR.raw : 989312 : 576

Then I redid the .xfont files by re-compressing the fonts in "veryfast" for the addresses.

I wrote a litte test code, put in the numbers and got five lines of cmd_text() output.
Ah yes, I copied all the .xfont data to graphics memory and I used bitmap-handles 10...14.

Now, the problem was, only the first and the last line were okay, the other three had broken chars.

So I re-compressed the 14/16/18 fonts again in "thorough" for these addresses and replaced all files.

Now the third and the fourth line still have broken chars. And in different places.

So I started to hack this into a spreadsheet.
All the addresses are 64 byte aligned.

Then I tried to read notosans-regular-webfont_16_254208.xfont with a hex-editor.
0x0100aaff - signature
0x00001395 - size of 5013, gen-flash rounds that up to 5056 which is a multiple of 64
0x000093b5 - format
0x0000024a - swizzle
0x00000030 - width
0x00000006 - height
0x00000018 - pixel width
0x0000001e - pixel height
0x00801f08 - start -> 0x1f08 = 254208
0x00010000 - num of glyphs -> 65536 - this is wrong and the one other font (184 glyphs) I checked also had this number
gptr/wptr/widh data - not sure how to really interpret these

Now, what else could I try to put a bunch of fonts into the FLASH?

And on a side-note, the amount of bitmap-handles really is a tad bit low, having annother 32 at least would be nice.


382
Discussion - EVE / Re: FT81x and 800x600 screen resolution
« on: April 19, 2019, 08:45:42 AM »
The datasheet for the panel usually gives a few clues.
I have to admit though that translating the datasheet values into EVE parameters is a bit tricky.

Page 18 of the datasheet for the G084SN05V9 has timings.

FT_DispWidth = 800;
FT_DispHeight = 600;
FT_DispHCycle =  1056;
FT_DispVCycle = 628;

VSYNC0 and HSYNC0 are Zero for almost all displays with the exception for a few that are cut down from biiger panels.
Like a 3.8" that has been cut down from a 4.3".

FT_DispHSync0 = 0;
FT_DispVSync0 = 0;

REG_HOFFSET and REG_VOFFSET hold the length of the non-visiable parts and must be smaller
than xSIZE-xCYCLE.

FT_DispHOffset = 245;
FT_DispVOffset = 20;

Now these are tricky.
For EVE this is the horizontal front porch plus hsync pulse with and vertical front porch plus vsync pulse width.
The timing diagramm for the G084SN05V9 shows the blanking periods Tvb and Thb in front of the signals.
So I am guessing something like this could be working:

FT_DispVSync1 = 15;
FT_DispHSync1 = 200;


If anyone has more insight on this, a lecture on how this works would be welcome. :-)

383
Discussion - EVE / Re: Double buffering JPEG stream
« on: April 12, 2019, 02:10:40 PM »
You could either scale down the .jpg in order to fit two into GRAM and scale them up to 800x480.
Or, with the BT815, it should be possible to use ASTC instead.

I have not tried if this works but chapter 6 in the programming guide states:
"With enough ASTC images in flash memory or RAM_G, it is
possible for user to construct an image-rich GUI application."

COMPRESSED_RGBA_ASTC_4x4_KHR has 8 bits per Pixel, the other formats use less bits per pixel.

At least with the EVE Asset Builder it takes quite some time to convert images to ASTC though.

384
Discussion - EVE / BT81x: OPT_FILL is not defined
« on: March 25, 2019, 03:18:34 PM »

385
Discussion - EVE / Re: ERROR: unsupported JPEG in cmd_loadimage()
« on: March 23, 2019, 07:45:02 PM »
At least https://29a.ch/photo-forensics/ shows a difference then between the original file and the one I saved with IrfanView.

Original structure:
    SOI
    APP0
    DQT
    SOF0 (Baseline DCT)
    DHT
    DRI
    SOS
    EOI

New structure:
    SOI
    APP0
    DQT
    DQT
    SOF0 (Baseline DCT)
    DHT
    DHT
    DHT
    DHT
    SOS
    EOI

So the new file does not only have two DQT entries but also four DHT entries.
Oh yes, and no DRI entry, whatever a "Define Restart Interval" is good for.

386
Discussion - EVE / Re: EVE Asset Builder
« on: March 18, 2019, 06:49:09 PM »
>To clarify, are the first 4k bytes identical in all three of (1) the flash image, (2) the firmware blob, and (3) the read out data?

I just compared the "unified.blob" with the generated flash image and these are 100% identical for the length of the "unified.blob".

387
Discussion - EVE / Re: ERROR: unsupported JPEG in cmd_loadimage()
« on: March 15, 2019, 11:47:31 AM »

388
Discussion - EVE / Re: EVE Asset Builder
« on: March 15, 2019, 10:53:11 AM »
>You can supply the newblob command alongside the update command

Yes, I know that, this was not my point.
My point was that progflash.exe does look for a file named "unified.blob" even if you do not tell it to.
This file is required by progflash.exe and gets burned to flash every single time althogh it already is included
in the flash-file.
Progflash.exe should not even look for "unified.blob" by default and really should not burn it by default.
If beeing asked to do that, sure, this option sounds usefull. But flashing "unified.blob" or the generated flash image file should be mutually exclusive since the blob already is part of that flash image anyways.

>Can you verify if the blob in your flash binary (first 4096 bytes) is identical to the stock blob that you're writing?

'The "notempty.bin" and "output.bin" are exactly the same for the length of "output.bin".'

Yes, of course, this does include the first 4k.

And to repeat, my problem is not that the EVE Asset Builder is not working or the progflash.exe is not working.
My problem is, that progflash.exe keeps telling me that it fails to write the data to the flash while it works just fine.
It should not be necessary to read back the data every time from the flash only to confirm that progflash.exe thru out a false error message again.


389
Discussion - EVE / EVE Asset Builder
« on: March 09, 2019, 11:34:02 AM »
I have a board that is populated with a BT816 and a Winbond 25Q128JVSI.
There also is a FT232H on the board I can connect to from the EVE Asset Builder as "MPSSE".

I generated an "output.bin" with only this "unified.blob" and a single small image in ASTC 8x8 format.
But I can not write it to the FLASH, not even after I resorted to use progflash.exe directly.

D:\FLASH>progflash
Welcome to BT81X Flash Programming Utility V0.0.5
Copyright(c) Bridgetek Pte Ltd All Rights Reserved

Usage: ProgFlash [command] [argument]

module       Select Program Module [ FT4222 (default) | MPSSE ]
erase        Erase all of flash
newblob      Install blob <file_name> in flash
write        Write <file_name> to flash (assumes flash is already erased)
update       Write <file_name> to flash, erasing if necessary
read         Read all of flash into <filename>

D:\FLASH>progflash module MPSSE erase
 Information on channel number 0:
 Flags=0x2
 Type=0x8
 ID=0x1b3d0200
 LocId=0x433
 SerialNumber=0k2LWMY6
 Description=USB 2 SPI
 ftHandle=0x0

handle=0x6d4330 status=0x0
VC1 register ID after wake up 7c

 reg_touch_rz =0x7fff
 reg_touch_rzthresh =0xffff
 reg_touch_tag_xy=0x80008000
 reg_touch_tag=0x0

Progress ERASE 1
Erasing Flash...
Progress ERASE 90
Progress ERASE 100
Erase Flash successfully

DONE!

I was about to additionally ask why erasing takes this long but then I just found that the datasheet for this chip
specifies 40...200 seconds for a chip erase.

Now when I try to write this is what happens:

D:\FLASH>progflash module MPSSE write output.bin
[exactly the same lines repeated as above]
Progress BLOB 1
Writing Blob file ".\unified.blob" to BT81X Flash Storage
Progress PROG 0
Write Blob file ".\unified.blob" to BT81X Flash Storage successfully
Progress WRITE 1
Writing Flash file "output.bin" to BT81X Flash Storage (assumes flash is already erased)
Progress PROG 0
Progress PROG 83
Verify Flash failed!
Write Flash file "output.bin" to BT81X Flash Storage unsuccessfully
Exsiting ...

The first thing that is strange is that progflash.exe insists of writing "unified.blob", it is even required to have a file of that name in the same directory as progflash.exe.
However, genflash.exe always adds this mysterious blob to the first 4096 bytes - and I see no way around this, neither from the Eve Asset builder or from using genflash.exe directly.
So it really looks like progflash.exe is shooting itself in the foot there.

Okay, annother erase then, followed by an update command:

D:\FLASH>progflash module MPSSE update output.bin
...
Progress BLOB 1
Writing Blob file ".\unified.blob" to BT81X Flash Storage
Progress PROG 0
Write Blob file ".\unified.blob" to BT81X Flash Storage successfully
Progress UPDATE 1
Writing Flash file "output.bin" to BT81X Flash Storage, erasing if necessary
Progress PROG 0
Verify Flash failed!
Write Flash file "output.bin" to BT81X Flash Storage unsuccessfully
Exsiting ...

Still does not look like it is working.

A "progflash module MPSSE read empty.bin" after an erase results in a 16MB sized file filled with 0xff.
That is fine, although it would be somewhat nicer if it would not save all the empty pages from the end of the data to the end of the flash and even would not save a file at all for an empty flash.
Why? Well, because that would allow copying the content of a flash from one board to annother even when the second board has a smaller flash than the first one, given of course that the first flash is not full but one would be able tell by the size of the file if it will fit or not.
Also writing only the necessary data should be faster.

Okay, "progflash module MPSSE write output.bin" again and it fails again, or at least it says so.
Followed by "progflash module MPSSE read notempty.bin".

Now I compared this "notempty.bin" to "unified.blod" and "output.bin" and it turned out that I wasted a couple of hours to look into a problem that is not even there.
The "notempty.bin" and "output.bin" are exactly the same for the length of "output.bin".

Please update the EVE Asset Builder, it is still on the first release and out for over six months now, thank you.
And please add a "verify" option to progflash.exe in case you do not already have.

390
Discussion - EVE / Re: ASTC viewer?
« on: February 18, 2019, 06:10:52 PM »
Well, yes, I know that I can not use the FLASH without the blob.
This is why I qouted CMD_FLASHFAST and came here to ask about it.  ;)

Pages: 1 ... 24 25 [26] 27