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] 2 3 ... 30
1
I tried this with my library which does set 72MHz pixel clock for the RVT101 and also is setting REG_PCLK_2X.
And while I also saw this fail, the real killer seems to be CMD_GRADIENT in this case.

Without the CMD_GRADIENT line I can display all the buttons and even four more without an issue.
Ok, the display-list is filled by more than half then.

2
Discussion - EVE / Re: BT82x
« on: March 15, 2025, 01:39:52 PM »
Next part, registers.
I went thru the programming guide and put all registers in a spreadsheet to first get a kind of explicit memory map and to be able to sort the lines by register name for the export to a header file.

Just some bits of statistics.
There are fewer registers than I expected, a total of 155 are documented.
The documented memory regions have room for 1792 registers of 32 bits width.
There are at least three more undocumented memory regions that may have registers and have room for 320 more registers.

region/address/space for registers/registers used
EVE_REG_CORE_R1 0x7F006000 1024 114
EVE_REG_CORE_R2 0x7F004000 512 15

Odd, why not just use the region starting from 0x7F004000 for all registers and be done?

Some register groups are oddly spread over the memory like the REG_CMD registers:
REG_CMD_DL        0x7F006154
REG_CMD_READ    0x7F00614C
REG_CMD_WRITE   0x7F006150
REG_CMDB_SPACE 0x7F006594
REG_CMDB_WRITE 0x7F010000

Not that there is anything wrong with this, it just make me wonder why.

Some "holes" in the memory obviously have undocumented registers, like 0x7F006030 or 0x7F800308.
And then there are larger regions like 0xFf0061B8 to 0x7F006590.

Does this matter? No, of course not, it just leaves me curious.
And I wonder what is planned for alle the unused registers.


Then there a few odd things.

REG_TOUCH_SCREEN_XY and REG_CTOUCH_TOUCH0_XY use the same address
REG_TOUCH_RAW_XY  and REG_CTOUCH_TOUCHA_XY use the same address

This is not exactly new, I just wonder why this is still a thing and also why "Compatibility mode"
is the default setup in RED_CTOUCH_EXTEND when there is nothing to be compatible with and
the two supported resistive touch I2C controllers should be outliers and not the standard to be expected.
Well ok, single touch might not be the same as multi-touch and only using the first touch.

Then there is this:
REG_CTOUCH_TOUCH0_XY
REG_CTOUCH_TOUCHA_XY
REG_CTOUCH_TOUCHB_XY
REG_CTOUCH_TOUCHC_XY
REG_CTOUCH_TOUCH4_XY

And this:
REG_TOUCH_TAG
REG_TOUCH_TAG_XY
REG_TRACKER
REG_TOUCH_TAG1
REG_TOUCH_TAG1_XY
REG_TRACKER_1
REG_TOUCH_TAG2
REG_TOUCH_TAG2_XY
REG_TRACKER_2
REG_TOUCH_TAG3
REG_TOUCH_TAG3_XY
REG_TRACKER_3
REG_TOUCH_TAG4
REG_TOUCH_TAG4_XY
REG_TRACKER_4

Please consider renaming the first set in the programming guide to this:
REG_CTOUCH_TOUCH_XY
REG_CTOUCH_TOUCH1_XY
REG_CTOUCH_TOUCH2_XY
REG_CTOUCH_TOUCH3_XY
REG_CTOUCH_TOUCH4_XY

3
Discussion - EVE / Re: BT82x
« on: March 09, 2025, 07:56:17 PM »
With the release of the BT820 getting closer, I did a analyses of the BT820 commands in comparision with the BT81x commands.

Display-List commands:
Mostly compatibel from the command number to the bits, with a few exceptions.
TAG, CLEAR_TAG - use 24 bits now instead of 8
BITMAP_HANDLE - uses 5 bits now instead of 4
CALL, JUMP - new valid range is 0...4095
PALETTE_SOURCE - uses 24 bits now instead of 22

New commands:
0x31 BITMAP_SOURCE_H, 0x32 PALETTE_SOURCEH - for the high byte of the extended address
0x33 BITMAP_ZORDER - "Set the z-order address pattern for a bitmap" - whatever this is, found chapter 2.17, still not sure
0x34 REGION - this is for a rendering optimization in the display list, by default all the co-processor widgets are using this

"missing" is the display-list command that would use 0x30 as identifier.

What I am missing:
There is no new graphics primitive to be used with BEGIN.
There is no VERTEX3F or VERTEX2F2 command using code 0x60 that uses a pixel precision of 1 pixel and 12 bits for the encoding with a range of -2048 to 2047 while encoding y in bits 0...11 and x in bits 16 to 28 to address the bottleneck that VERTEX2F and VERTEX2II are imposing.


Co-Processor commands:
Unfortunately except for CMD_DLSTART, CMD_SWAP and CMD_INTERRUPT, the command numbers are completely incompatible.
I really would have apreciated it if the new commands would have used numbers 0xFFFFFF71 and up.

A large number of commands moved back to using int16_t and in32_t types in the BRT_AN_086_BT82X-Series-Programming-Guide
while actually requiring uint16_t and uint32_t types: TEXT, BUTTON, KEYS, PROGRESS, SLIDER, SCROLLBAR, TOGGLE, GAUGE, CLOCK, CALIBRATE, ROTATE, SETMATRIX, TRACK, DIAL, NUMBER and ROTATEAROUND

The description for CMD_GETMATRIX still does not help me to understand what this is supposed to do.
CMD_MEDIAFIFO notes in the example: "0x100000 is the top of RAM_G"

Commands with incompatible changes to the API:
CMD_SETFONT is actually CMD_SETFONT2
CMD_INFLATE is actually CMD_INFLATE2
CMD_VIDEOSTART added options

Odd:
CMD_SNAPSHOT is not using the old CMD_SNAPSHOT2
CMD_APPENDF, never noticed this, applies to BT81x as well, documented to use REG_CMD_WRITE in contrast to CMD_APPEND which uses REG_CMD_DL, can't be true.

Removed:
CMD_ANIMFRAMERAM - the new CMD_ANIMFRAME plays from RAM_G, the original played from flash
CMD_ANIMSTARTRAM - the new CMD_ANIMSTARTRAM plays from RAM_G, the original played from flash
CMD_CLEARCACHE - why?
CMD_VIDEOSTARTF - somehow CMD_VIDEOSTART plays video from flash though
CMD_APILEVEL, CMD_FONTCACHE, CMD_FONTCACHEQUERY, CMD_PCLKFREQ
CMD_HSF - why?

New:
CMD_DDRSHUTDOWN, CMD_DDRSTARTUP
CMD_WAITCHANGE, CMD_GRAPHICSFINISH, CMD_WAITCOND, CMD_SKIPCOND, CMD_REGWRITE - unlikely to be used in real display lists?
CMD_FENCE - not sure what this is actually good for, yet
CMD_I2SSTARTUP - sounds like CMD_I2SSHUTDOWN might be missing
CMD_FSOPTIONS, CMD_FSREAD, CMD_FSSOURCE, CMD_FSSIZE - looks like a way to write files to SD card is missing
CMD_FSDIR - looks like a CMD_CHGDIR is missing?
CMD_SDATTACH, CMD_SDBLOCKREAD - looks like CMD_SDDETACH might be missing
CMD_PLAYWAV - oddly does not allow to play from RAM_G, a loophole would be to configure the MEDIAFIFO, does only complete when the playback ends
CMD_LOADWAV - oddly loads the sound into memory, sets the loop flag but does not play the sound
CMD_SAVECONTEXT / CMD_RESTORECONTEXT - no idea why these are commands, sending display-list commands to the co-processor works fine and all other display list commands are not added as co-processor commands
CMD_ENABLEREGION - allows to disable the render optimization for widgets
CMD_LOADASSET - loads files in new .reloc format, likely a EAB generated file which has a header before ZLIB / ZOPFLI compressed data - ah, yes, found chapter 2.12
CMD_WATCHDOG - the watchdog description is missing vital information, what the default timeout is after activation during system reset, how to actually reset the counter and what happens when the time runs out
CMD_TEXTDIM - calculates length and height in pixel for UTF-8 encoded texts
CMD_ARC - still specifies "If the angles specify a complete circle, a disc is drawn."
CMD_COPYLIST - not sure what this is good for and why it would be used with CMD_CALLIST and not CMD_APPEND
CMD_RESULT - hmm
CMD_CGRADIENT
CMD_GLOW
CMD_RENDERTARGET - found chapter 2.11, still not sure what this is about

4
Please do not add more "return values" to any commands.
I would rather see all "return values" to be removed from commands.

Why?
Because these are a pain to implement on the host processor, you need to traverse back the RAM_CMD after executing the commands.
And even for the BT82x programming guide the given "C prototype" functions are still wrong, as it is difficult to describe what actually
needs to be done.

Commands for single execution like CMD_GETIMAGE are not an issue, still complicated to implement, but least not part of a display list.

Now commands for display list are a completely different story.
Single execution? Fine, works.
But a CMD_TEXT() that would allow to read back "return values" would be impossible to be used when transferring display lists by DMA.
Heck, it would even be impossible to use when using "burst-mode", aka you only send the address once followed by a whole bunch of commands.
There is no way to tell from where in the RAM_CMD to read when you transfer a buffer in order to not block the host controller from doing anything else
during SPI transfers.

And now we just got 16kiB of RAM_CMD and RAM_DL, actually using that with sending command by command is not really feasible.
At least not if the host controller is supposed to do anything else.

What then?
Registers!
Please provide a whole bunch of extra registers that the co-processor is writing to when executing commands.
The memory map of the BT820 reserves 6k or REG_CORE in two regions, this is room for over 1500 32 bit registers.

REG_LOADIMAGE_SOURCE
REG_LOADIMAGE_FORMAT
REG_TEXT_LINE_PIXEL
REG_TEXT_LINES
REG_BUTTON_LINE_PIXEL
REG_BUTTON_LINES

Hmm, ok, fine, with multiple commands one might need to execute the needed command outside of a real display list update, like this:

EVE_cmd_dlstart();
EVE_cmd_fillwidth(331);
EVE_cmd_text(50, 50, 31, EVE_OPT_FILL, "Please do some stuff here and there.\n\nAnd now do print something with a blank line above.");
EVE_execute_cmd();

lines = EVE_memRead16(REG_TEXT_LINES);

This would also provide the value before doing the actual display list.

Ok, sure, that defeats my argument for display lists as the return value could be ignored for buffered transfers and only used for separate commands.
But just reading a register still is more straighforward than for example what I had to implement for EVE_cmd_bitmap_transform():

spi_transmit_32(0UL);
EVE_cs_clear();
EVE_execute_cmd();
cmdoffset = EVE_memRead16(REG_CMD_WRITE);
cmdoffset -= 4U;
cmdoffset &= 0x0fffU;
ret_val = (uint16_t) EVE_memRead32(EVE_RAM_CMD + cmdoffset);

Yes, that spi_transmit_32(0UL); is part of this as you now have to transfer these "return values" in order to advance the FIFO pointer correctly.

With a modified CMD_BITMAP_TRANSFORM that makes the co-processor write to a register instead of RAM_CMD,
this would look like this:
EVE_cs_clear();
EVE_execute_cmd();
ret_val = EVE_memRead16(REG_BITMAP_TRANSFORM_RESULT);

And the co-processor likely would also need a few lines less when writing to a fixed memory location.

So, anyways, please, no more "return values".

5
I finally got around playing with the RVT70HSBNWCA0 as well.
And yes, the same thing is happening with it, CMD_FLASHERASE does not have any effect when the flash is state BASIC.
I even put in a 2s delay before issuing the command.

I am reading from flash with CMD_FLASHREAD and then from RAM_G.

The value returned is 0x02fbdf70 for example.
And as long as I do not put the flash into FULL state, the value does not change.
Reading also does work in both BASIC and FULL.

But when I put the flash in FULL state and then issue CMD_FLASHERASE, the returned value is 0xffffffff - as it should be.
It still only takes a fraction of a second.

And yes, this is with the original Flash chip on the board as provided by Riverdi, I do not have the proper equipment to remove and resolder BGA chips.
The size of the Micron flash chip is 512Mb.

Reading the chip ID using CMD_FLASHSPITX / CMD_FLASHSPIRX the result is:
0x20 Micron
0xba 3.3V
0x20 512Mb
0x10 16 more bytes in extended id
0x40 second generation, uniform sectors, HOLD pin

Next I tried to issue the bulk-erase command manually.
This needs a write enable command (0x06) first and then 0x7c or 0x60 for bulk erase.

This has no effect - well, it is not unlikely that I am doing it wrong.

Then I read found in an application note from infineon that some Micron devices need 0xc4 for die erase instead.
And this gives me a black screen.
After waiting several seconds, commenting out this code and restarting my programm, the flash is not cleared.

No idea what this is, but CMD_FLASHERASE does not work with the Riverdi BT817 displays in state BASIC for the flash.

6
Discussion - EVE / Re: FlashRead
« on: February 13, 2025, 04:48:08 PM »
Here is my code, I can confirm that the flash address is correct since whenever I render from flash this is the addressing that is used:
   testBMprop = getBMProperties(NST_BG_OS_BM_ID);
   Cmd_FlashRead(0,(testBMprop.flashDest*EVE_FLASH_BLOCK_SIZE/EVE_FLASH_POINTER_MULTIPLIER), testBMprop.dataLength);

No, you do not render from the same address in the flash as you read from the flash.
Displaying from flash uses: (0x800000 | (address/32)) as source address - with an address from the EAB generated .map file.
And if testBMprop.flashDest retuns the address from the .map file,
then you use it directly to read with CMD_FLASHREAD.

Try:
Cmd_FlashRead(0, testBMprop.flashDest, testBMprop.dataLength);

And if that also does not work, please provide the numbers.

As I wrot above:
"src must be 64-byte aligned, dest must be 4-byte aligned, num must be a multiple of 4"
"The src pointer is relative to the flash so the first address is 0x000000 not 0x800000."


Which library is this? Or in other words, is the implementation of the command even correct? There is no way to tell.

7
Discussion - EVE / Re: FlashRead
« on: February 12, 2025, 10:51:01 PM »
CMD_FLASHREAD has a couple of requirements, I put these in the docs of the function header in my library:

/**
 * @brief Copies "num" bytes from "src" in attached SPI flash storage to "dest" in RAM_G.
 * @note - src must be 64-byte aligned, dest must be 4-byte aligned, num must be a multiple of 4
 * @note - EVE will not do anything if the alignment requirements are not met
 * @note - The src pointer is relative to the flash so the first address is 0x000000 not 0x800000.
...
 */
void EVE_cmd_flashread(const uint32_t dest, const uint32_t src, const uint32_t num)

If you are using EAB, the files should be stored 64 byte aligned already.

8
Discussion - EVE / Re: BMP SCREEN 1280X800 BT817Q
« on: February 06, 2025, 05:11:06 PM »
That really is an odd way to implement this, but this is not why it is not working.
EVE_add_cmd(SET_BITMAP, 4u);
 EVE_add_cmd(0, 4u);
 EVE_add_cmd(COMPRESSED_RGBA_ASTC_8x8_KHR, 2u);
 EVE_add_cmd(40, 2u);
 EVE_add_cmd(40, 2u);

This does not work because it is adding up to 14 bytes, you need two more, the commands always need to be 4 byte aligned.
Add:
 EVE_add_cmd(0, 2u); // send dummy bytes to make the command 4 byte aligned


9
First of all, make use of all the RAM_G you have before even considering diplaying anything from flash.
You could use CMD_FONTCACHE for the largest font, but it is a little tricky to use and does not take it kindly if you try to display more characters than can fit in the cache.

Then there is REG_ADAPTIVE_FRAMERATE which is set to 1 by default.
With REG_AH_HCYCLE_MAX, which is set to 0 by default, you can enable adaptive HSYNC, it is to be set to a value
between REG_HCYCLE and 4095 - so 4095. :-)
This suspends PCLK if the next scanline is not ready yet, so this gives the graphics engine more time at the cost of reducing the framerate.

Another option would be to check if the display settings could be modified to lower the pixel clock and/or make the scanlines longer,
which again results in a lower framerate.

There also is REG_PCLK_2X which if set to 1 tells the graphics engine that it can send two pixels per clock to the output block.
I am not sure if it helps in this situation, but given the description it might, if the effect is that the graphics engine is spending less time pushing out pixels then it might free enough clock cycles for the external flash.

10
Discussion - EVE / Re: BMP SCREEN 1280X800 BT817Q
« on: January 28, 2025, 06:49:48 PM »
I attach an image where you can see that I cannot load the image.
At the bottom of the screen you can see that the image is in position 0 of the ram_g, width: 88, height: 72 and format: 38 which is equivalent to EVE_COMPRESSED_RGBA_ASTC_8x8_KHR

so the image loads fine in ramg and its values ​​are displayed.

can you help me please.

First of all, please be aware that images carry meta information, including your geo location

I always cut fotos to what I want to show and when I save I have all the checkboxes in IrfanView to keep the meta data ticked off.


Then I just loaded the image into EVE Screen Editor and it works fine, including alpha, so the image is good.

CMD_SETBITMAP(4500, COMPRESSED_RGBA_ASTC_8x8_KHR, 88,72)
BEGIN(BITMAPS)
VERTEX2F(20, 326)
END()

And the inspector shows this in the display-list:
Offset
(decimal)   Raw   Text
447   0x01001194   BITMAP_SOURCE(4500)
448   0x29000000   BITMAP_SIZE_H(0, 0)
449   0x0800b048   BITMAP_SIZE(NEAREST, BORDER, BORDER, 88, 72)
450   0x2e0093b7   BITMAP_EXT_FORMAT(COMPRESSED_RGBA_ASTC_8x8_KHR)
451   0x28000000   BITMAP_LAYOUT_H(0, 0)
452   0x07f96009           BITMAP_LAYOUT(GLFORMAT, 176, 9)
453   0x1f000001           BEGIN(BITMAPS)
454   0x400a0146   VERTEX2F(20, 326)
455   0x21000000   END()

And that should be it, you are not using BITMAP_EXT_FORMAT, only BITMAP_LAYOUT.
GLFORMAT should be 31.
And COMPRESSED_RGBA_ASTC_8x8_KHR should be 37815.

0x07f96009 - 0x07 / bit 19 to 23 = format -> 11111 = 31 / bits 9 to 18 = linestride -> 00 1011 0000 = 176 (88*2) / bits 0 to 8 = height -> 9 (72 / 8)
0x2e0093b7 - 0x2e ... reserved .. 16 bits format - yes, 0x93b7 = 37815


Oh yes, I almost overlooked this, the VERTEX2F coordinates are only so low because I am also using VERTEX_FORMAT(0) in this ESE test-project

11
I just checked and I am using the same parameters with my RVT70HSBNWC00-B.
But this looks like a different issue entirely: external flash bandwidth.

Please switch to ROM fonts and check what it looks like then.
The RVT50H might be just barely working as the time per display line is a couple of µs longer.

12
Discussion - EVE / Re: BMP SCREEN 1280X800 BT817Q
« on: January 27, 2025, 04:06:56 PM »
I tried, but there is just too much code and this is incomplete.

Please try something much simpler first, not reading from SD(?), writing to QSPI flash(?), reading from there and so on.

Quote
PS.- the images are ASTC_8x8 and it is a 88x72 image. I pass the .raw file that is generated from the several that it generates.

Using the .raw file is correct.
So the files should have 1584 bytes.

Just add the array to the .c file as a first step.

const uint8_t test_icon [1584] =
{
.....
};

Write it to RAM_G in console_tft_init():
EVE_mem_write(ramg_test_icon_address, test_icon, sizeof(test_icon));

Display it:
EVE_add_cmd(COLOR_RGB(255u, 255u, 255u), 4u);
EVE_add_cmd(BEGIN(EVE_BITMAPS), 4u);
EVE_add_cmd(CMD_SETBITMAP(ramg_test_icon_address, EVE_ASTC_8x8, 88u, 72u), 16u);
EVE_add_cmd(VERTEX2F((unsigned long)(100 * 16), (unsigned long)(100 * 16) ), 4u);
EVE_add_cmd(END(), 4u);

Yes, that "EVE_add_cmd(CMD_SETBITMAP(" is a wild guess, I am not familiar with the library you are using.
But it really should include a way to use CMD_SETBITMAP.
Which library is this? The "4u" at the end really looks inconveniant.

Side-Note, does your VERTEX2F really need uint32_t? The coordinates are 15 bit wide and signed.
My lib uses int16_t for VERTEX2F: void EVE_vertex2f(const int16_t xc0, const int16_t yc0);

In my library this would look like this:
EVE_color_rgb(WHITE);
EVE_begin(EVE_BITMAPS);
EVE_cmd_setbitmap(MEM_LOGO, EVE_ASTC_8X8, 88U, 72U);
EVE_vertex2f(100U*16U, 100U*16U);
EVE_end();

CMD_SETBITMAP sets bitmap source, size and layout_h and layout.
The only time you do not want to use it is when you need to not set BITMAP_SIZE filter/wrapx/wrapy to NEAREST/BORDER/BORDER.
But even then you can send a BITMAP_SIZE with the preferred values after CMD_BITMAP, at the cost of 4 bytes extra in the display-list.

At this point I am not sure anymore what "linestride" was, something, something, pixel. :-)
I have not been using BITMAP_LAYOUT for years now as FT81x / BT81x support CMD_SETBITMAP.

13
Discussion - EVE / Re: BMP SCREEN 1280X800 BT817Q
« on: January 21, 2025, 07:07:00 PM »
Ok, first my apology, I am sorry, I was too direct and there is a good chance that I just misunderstood what your application does,
after all you merely posted a fraction of your code and I presumed too much based on earlier experiences.

So, are you rendering the image data on the host system and sending these images to EVE to be displayed?
Probably not, which means I was wrong to assume this and you are using static images uploaded once and just put them in the desired positions.


Anyways, my point of using VERTEX_FORMAT(0) to set the range for VERTEX2F to -16384 to 16383 is still valid and had nothing to do with the second paragraph.


And to try on expanding on beeing actual helpfull, what threw me of is your handling of different image formats.
Not because it is wrong, but because of the use of all the different formats like L1, L2, L4, paletted 8.
The BT81x offer support for ASTC, which is far superior to the original image formats.
With ASTC 8x8 for example you get 24 bit colors plus alpha channel per pixel while you only need 2 bits of storage per pixel.
Yes, ASTC is a lossy compression format, but there are 14 variants to choose from with very high compression / visable artifacts to high compression / close to no artifacts.
And ASTC 8x8 is right in the middle with still excellent compression and few artifacts if any.
A 64 x 64 icon in ASTC 8x8 is only 1024 bytes in size.
So you could improve your UI with more images that are larger and have more colors, although RAM_G is the same 1MiB in BT81x as in FT81x.
And compared to L1 this would be twice the size, but with anti-aliasing possible.

14
See also here: https://github.com/RudolphRiedel/FT800-FT813/discussions/147

CMD_FLASHERASE does nothing on my RVT101H with a BT817 and some 512Mb Micron flash when the flash status is BASIC.
When I put the flash in FULL and then issue CMD_FLASHERASE, it does seem to do something, at least the flash can not be accessed anymore.
However, it takes very little time, this is not noticeable in the startup although Bulk Erase for the Micron devices I could find a datasheet for
is documented to take 153 to 460 seconds.

I did not notice this so far since I am not using CMD_FLASHERASE. Because of the time it takes and because I am using a fraction of the flash anyways.
I am using CMD_FLASHUPDATE, first writing the 4k for the .blob in BASIC and then switching to full for the complete image.

15
Discussion - EVE / Re: BMP SCREEN 1280X800 BT817Q
« on: January 16, 2025, 05:53:28 PM »
You could make things a bit simpler by setting the range for VERTEX2F to -16384 to 16383 by using VERTEX_FORMAT(0).
You already use PIXEL_PRECISION to multiply your coordinates, this could be set to 1 or removed entirely.

And speaking of efficiency, it looks like you are mis-using the BT817 as a framebuffer and even a bad one since you need to reduce the color depth.
While this works, this is really not what EVE was designed for.
Sure, you do you, but what is the reason behind this?

Pages: [1] 2 3 ... 30