BRT Community

Please login or register.

Login with username, password and session length
Advanced search  


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 ... 24
Discussion - EVE / Re: What is the purpose of CMD_REGREAD?
« on: September 25, 2023, 07:59:52 PM »
A bit off-topic but I mentioned it here before that the variable types are partly not correct.

And I just found another one: void cmd_rotate( int32_t a );
The range for "a" is 0 to 65535.
Yes, this needs to be 32 bit as everything in RAM_CMD needs to be 32 bit aligned.
But please change this in the programming guide to the unsigned value it actually is.

Same in cmd_rotatearound(x,y,a,s), "x" and "y" need to be signed, "a" does not and I am not actually sure about "s".

void cmd_fontcachequery( uint32_t total, int32_t used ); - what about "used"?
void cmd_fontcache( uint32_t font, int32_t ptr, uint32_t num ); - the "ptr" is for a RAM_G address

Test and Review Area / Re: EVE Asset Builder 2.9.0
« on: September 03, 2023, 09:41:45 AM »
I tried to use the PNG/JPEG Validator and found that the "VALIDATE" button is inactive unless I set the option "Generate Optimized File".
It still works when deselecting "Generate Optimized File".
But the "VALIDATE" button is inactive again when I remove the image and does not become active when adding an image.

Discussion - EVE / image decoding and OPT_RGB565
« on: September 03, 2023, 09:33:21 AM »
I received an image file to conduct a test with and this image file is a .png.
Long story short, the image gets decoded to ARGB4 and not RGB565.

There is OPT_RGB565 in chapter 5.9:
Decode the source image to RGB565 format - CMD_LOADIMAGE

And the first idea I had was to provide this option in order to make CMD_LOADIMAGE
decode the .png file to RGB565.
But then I saw that the value for the option is actually zero, so this "option" does not actually do anything,
this is just the default value, this is !OPT_MONO.
As I was already using CMD_LOADIMAGE with bit 1 of the options cleared, this "option" OPT_RGB565 has no effect on loading PNG images.

Please consider removing OPT_RGB565 from the table in chapter 5.9.

Discussion - EVE / Re: New Release of Windows to EVE Bitmap Viewer 1.4
« on: August 24, 2023, 10:14:58 PM »
This reminded me of your EVE-USB2SPI-KIT-B, are there plans to sell these thru DigiKey or Mouser and perhaps EVE4 series displays as well?
And I would like to buy an EVE4x-40G-IPS for my collection but shipping from Canada directly is a bit expensive while DigiKey and Mouser offer free shipping to EU and handling of the taxes beforehand.
Not asking for free shipping by Matrix Orbital, it's just so conveniant for me to order from Mouser or Digikey and I also can order a bag of other parts at the same time.
Most of my EVE2 and EVE3 series Matrix Orbital displays I ordered from Digikey or Mouser.

Test and Review Area / Re: EVE Asset Builder 2.9.0
« on: August 20, 2023, 10:26:28 AM »
And something else entirely, as I am tinkering with ASTC fonts I noticed that EAB still includes astcenc.exe 2.1 while the latest release is 4.5.0.
I replaced the EVE Asset Builder\tools\astcenc.exe with the apropriate version for my system from the 4.5.0 package and so far it seems to be working fine, I still have to see what happens when using the converted fonts though.

Test and Review Area / EVE Asset Builder 2.9.0
« on: August 17, 2023, 06:02:33 PM »
I downloaded and installed and I have an odd issue.

The button to open the explorer window to select the output folder is not working for me in "Asset Compressor" / "Compress".
When I use the button on the second tab "Validate" though it works, I can select the output folder, I have to confirm twice and
now the output folder is also changed on the "Compress" tab.

Discussion - EVE / Cake?
« on: August 15, 2023, 04:58:17 PM »
I just realized, it has been 10 years since the launch of the FT800.

Discussion - EVE / Re: Displaing an image from flash
« on: August 09, 2023, 04:41:51 PM »
I have a function that works fine for putting the attached flash in fast mode.
Check EVE_init_flash() from:
My EVE_cmd_flashfast() also is a bit different in that it does not only issue the command, it waits for completion, reads back
the return value from Eve and returns that value.

2. Does the flash need to be detached, attached back and then put into fast mode?

No, it does not, what I usually observe is that the status for the flash is "Basic" after initialization.

Can it not be put into fast mode straight after initialization (and eventually checked if is in basic mode)?

In my basic example I call my EVE_init(), set the backlight PWM, calibrate the touch.
Then I call EVE_init_flash() and if it returns E_OK, a .xfont file is read from the flash.
So yes, pretty much straight after initialization, at this point no images are loaded to RAM_G and only the initial empy display list is executed.

Please either try the last version I attached (and modify the pins if necessary), or attach a version with the modifications that you did, or well, preferably both. :-)

Ok, Arduino IDE 1.8.19 it is.
I swapped around the /AppData/Local/Arduino15 folders to make the 1.x one active.
Then I added to "Addtional Boards Manager URLs" and installed the ESP32 package v2.09,
started IDE 1.8.19, opened the projected that is attached above, selected "DOIT ESP32 DEVKIT V1" since that worked with the ESP32 WROOM-32 board when using PlatformIO.
I changed the pins again:
Code: [Select]
#if !defined(EVE_CS)
#define EVE_CS 13

#if !defined(EVE_PDN)
#define EVE_PDN 12

#if !defined(EVE_SCK)
#define EVE_SCK 18

#if !defined(EVE_MISO)
#define EVE_MISO 19

#if !defined(EVE_MOSI)
#define EVE_MOSI 23

And it compiles just fine.
I can not get it to upload to the board though, something about the serial connection or the drivers not working.
On the serial monitor I get this though when pushing the reset button:
ets Jun  8 2016 00:22:57

configsip: 0, SPIWP:0xe
mode:DIO, clock div:2
entry 0x400805e4

And still:
A serial exception error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13,
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.

I hate it when crap like this happens.

For the chance that a different board might behave differently I am trying to buy a new ESP32 board.
But all the ESP32-WROVER boards I can find are using a CH340 USB/Serial chip like the Wroom32 board I already have.

Hmm, I had more boards but I can't find these anymore, like a ESP32-CAM but this one did not have USB at all.

I got two new ESP32 boards and while one was advertised as "ESP32 WROVER Development Board" it turned out as WROOM32 board.
So I have two different new WROOM32 boards now.

My old WROOM32 board is still not working, same error, for whatever reason.
One of my new boards is using a CH340C, the other one is using a CP2102. I can upload to both of the new boards just fine.

And I learned something, never ever use "Sketch" / "Add File..." in Arduino IDE 1 in order to edit a file from a sub-folder that is otherwise not getting displayed.
I added EVE_target/EVE_target_Arduino_ESP32.h to change the pins.

And this opportunity to learn something did cost me a number of hours.
The seemingly exact same code worked fine when compiled with PlatformIO and resulted in a watchdog-reset when compiling it with Arduino IDE 1.8.19.
It hang in EVE_cpp_target.cpp / EVE_init_spi() when calling spi_bus_initialize().
And the problem in the end was that when adding the file the Arduino IDE actually copies it to the project folder.
I edited a copy of EVE_target_Arduino_ESP32.h that the code does not use while EVE_target/EVE_target_Arduino_ESP32.h remained untouched and therefore the I/O pins for the SPI were all wrong...ouch.

Now the code works from both the Arduino IDE 1.8.19 and PlatformIO with only a minute detail.
The code compiled with PlatformIO runs a little bit faster since I compile it with -O2 while the default is -Os.

And to my surprise, the Arduino version runs significantly faster now than the native version.
Using the same ESP-IDF based code.
It looks like the ESP-IDF SPI functions in arduino-esp32 are not the same, the pauses between single byte transfers when sending a couple of bytes are shorter.
The pauses are still ridiculously long for a controller running with 240MHz, I measure 9.9µs (PIO Arduino, -O2), 10.0µs (Arduino, -Os) and 13.2µs for (PIO ESP-IDF, -O2).
In contrast I measured 640ns with an ATSAMC21 running 48MHz and 280ns with an ATSAME51 running 120MHz but these are not burdened with a RTOS and my code writes directly to the SPI registers.

The screen update is done using DMA and while the transfer of the data takes the same 113.48µs, the times from CS down to start of the transfer and from end of the transfer to CS up are different.

CS down to start
Arduino: 20.3µs
ESP-IDF: 27.6µs
C21: 860ns

end of data to CS up
Arduino: 5µs
ESP-IDF: 8.4µs
C21: 780ns

I do wonder what is going on there with ESP32.

Another comparision, the 600MHz Teensy 4.1 has 225ns between two SPI.transfer() calls, so going thru the Arduino SPI class.


I know that platformio it's better than arduino, but i'm used to work with arduino IDE.

I get you, but it is not so much platformio against arduino but using platformio to do arduino programing. :-)
For me this is not exactly about platformio either, more using platformio with vscode as vscode is a much better editor.
Platformio does a few things better than the arduino ide, like supporting more boards out of the box and allowing to set build flags for example.

On the other side there are limits to what you can do with platformio, like there is no Baremetall support for the RP2040, "only" Arduino,
the ATSAM I am mostly using do not have CMSIS/Baremetall support either in the "Atmel SAM" framework, "only" Arduino und Zyphr RTOS.
Next I have two newer STM32 Nucleo boards that I can not use with platformio, yet.
Then there is RX660, S32K, RH850, PIC, probably countless other controllers with no suport or limited support.
Just saying, I believe the gras is greener over here but it is not all green either. :-)

Trying to compile on Arduino IDE the "hello world" example for an ESP32 i cannot compile, i get theese errors on EVE_cpp_target.cpp, lines 232, 233, and 238. Compiler doesn't know "SPI2_HOST", so i've changed to "VSPI_HOST", and them another compiler error, compiler doesn't know "SPI_DMA_CH_AUTO", after investigating this value can be true or false. Wether i put true or false arduino compiles successfully the example, but after uploading to my Riverdi RiTFT50 it doesn't do anything, black screen.

Can you Rudolph help me to make it work?

Thnak you for your work and help.

Which ESP32 package are you using exactly in what version and with what Arduino IDE?

I checked platform-espressif32 and arduino-esp32.
This sounds like a compatibility issue between one using ESP-IDF 5 and the other using ESP-IDF 4.
However, the latest version of arduino-esp32 is v2.0.9 and it is using ESP-IDF v4.4.4.
And platform-espressif32 added support for arduino-esp32 v2.0.9 with release 6.3.0.
So this really should be the same arduino core that both are using.

Ok, lets see what happens, I am using Arduino IDE 2.1.0 since this is the one I currently have in working condition.
I added to the boards manager and installed the esp32 package v2.0.9.

Ugh, ESP32 board overflow error. :-) First world problems, what board do I actually have? :-)

I selected "ESP32 Wrover Module" for a quick test and apart from a few warnings about missing initializers it compiles.
Fixed these.

I have a "BPI-Leaf-S3" that I only bought for the ESP-S3. And it actually is in the list of boards, nice.
With platformio I usually build for dfrobot_firebeetle2_esp32s3 which is close enough and also in the list.

Checking the pins, EVE_target_Arduino_ESP32.h has other pins configured as I have wired, so I just changed these.
EVE_target_Arduino_ESP32.h is not displayed by the Arduino IDE though since it is in a sub-folder, so you need to add it to the sketch.

Code: [Select]
#if !defined(EVE_CS)
#define EVE_CS 10

#if !defined(EVE_PDN)
#define EVE_PDN 14

#if !defined(EVE_SCK)
#define EVE_SCK 12

#if !defined(EVE_MISO)
#define EVE_MISO 13

#if !defined(EVE_MOSI)
#define EVE_MOSI 11

With platformio I can set these in the platformio.ini and therefore do not need to change that file.

Checking EVE_config.h, it's set to EVE_RVT50H which I also happen to have on my desk now.
The EVE_RiTFT50 is for RVT50xQBxxxxx which is using a BT815.
But I also happen to have one of these. :-)

Still compiles and now I uploaded it to the board - works. :-)

Discussion - EVE / Re: What is the purpose of CMD_REGREAD?
« on: May 30, 2023, 07:09:14 PM »

Thanks for your feedback, yes we are going through the Programmers Guide to review the data types and we will update them where applicable. As you said, some of the signed/unsigned types are not the optimal ones.

Thank you, I will gladly remove a couple of casts then. :-)

For the CMD_REGREAD, sorry meant to also mention CMD_MEMWRITE in that reply. You could use the CMD_REGREAD and CMD_MEMWRITE so that you can do reads and writes with low latency between them.

I implemented it, again as standalone command like I still have CMD_REGREAD.
And then I commented it out and tagged it as pointless.
I did not even get around implementing it with support for more than 4kiB of data.
Ok, I admit the low latency argument gives this command purpose, at least when using it with well below 4kiB of data.
But I still can not come up with any real use case, outside of perhaps testing the chip that is.
I like to make EVE cry, obviously. :-) But certainly not when doing an actual application.

Discussion - EVE / Re: What is the purpose of CMD_REGREAD?
« on: May 25, 2023, 08:19:13 PM »
As you said, in most application cases where the MCU wants to read or write, a standard SPI write would be most efficient.
There can be cases where it may be beneficial such as to reduce latency. e.g. if you want to do a read immediately after an operation which uses the co-processor, then waiting for the command to complete and then doing a SPI read would have more latency than adding a REGREAD command in your list of commands. For latency, one case may be reading the REG_CLOCK.

Ah, yes, thank you.
That is probably not something I will ever use but latency is a good argument.
Then I maybe should change how my function currently works as right now I have it implemented as stand-alone command.
And thinking about it, I would rather use CMD_MEMCPY to read some register as it can be anywhere in the list of commands.
CMD_REGREAD would be something for the end of the command-list since it writes to RAM_CMD and then you need to find out to where exactly.
As I am using REG_CMDB_WRITE (I dropped FT80x support), I am not keeping track of where in RAM_CMD EVE currently is,
so I could not even make my EVE_cmd_regread() function return the offset for reading out the value later.

You could also write many registers together even if not in adjacent registers (e.g. call CMD_PCLKFREQ and then write the display registers)

Yes - but what do you mean in context of CMD_REGREAD?

For RAM_JBOOT, this is not designed to be accessed from the host MCU directly and so should only be used with the recommended methods (such as the custom touch settings in the BT817 datasheet)

I am aware, but I still had to try out if using CMD_REGREAD is working differently in this region. :-)

Yes, we have implemented the commands in BRT_AN_025 directly and so they just add a dummy value which is replaced by the co-processor. We tend to use helper functions instead which then wrap those into more useful commands where you get the value back from the function (via return or pointer). We will look at adding some more of the EVE_LIB functions as helpers in the examples which we are producing for BRT_AN_025 to make these easier to use though, and so thanks for your feedback on this point.

I also find the documentation for these odd, or rather the given C function prototypes.

I implented
void EVE_cmd_fontcachequery(uint32_t *p_total, int32_t *p_used);
and not
void cmd_fontcachequery( uint32_t total, int32_t used );

My function does not write the values to RAM_CMD, it writes two 0UL and then reads from RAM_CMD and
writes back the retreived values if the pointers are not NULL.

Additionally, using "int32_t" for "used" does not seem to make any sense here.
Even your own example code agrees with me on this:

Code: [Select]
uint32_t total, used;
uint16_t ram_fifo_offset = rd16(REG_CMD_WRITE);
cmd_fontachequery(total, used);
total = rd32(RAM_CMD + (ram_fifo_offset + 4) % 4096);
used = rd32(RAM_CMD + (ram_fifo_offset + 8) % 4096);

It should not be possible for "used" to ever have a negative value.

Please review every single signed parameter and change it to unsigned when applicable. :-)
I wrote this at least once before in some other post here, a signed radius parameter for CMD_CLOCK makes no sense and there are likely more examples to be found.

Discussion - EVE / What is the purpose of CMD_REGREAD?
« on: May 21, 2023, 03:49:32 PM »
What is CMD_REGREAD supposed to be used for?
It does not seem to have any use when building a display-list and outside of display list handling it is more efficient to read from the address directly.

I am playing with EVE_cmd_regread() and EVE_memRead32() on a BT817 - the results are the same for the most part.

Code: [Select]
for(uint8_t index=0; index < 32; index++)
    test1[index] = EVE_cmd_regread(0x302000UL + (index*4));
    test2[index] = EVE_memRead32(0x302000UL + (index*4));

Some of the not documented registers seem to be pretty usefull, like 0x3021A8UL + 0x3021ACUL, I wonder why these are not documented.
Reading from the not documented REG_DATESTAMP returned a string: "2019-10-28_2.5.3"
Reading from for example 0x303000 returns 0xdeadbeef.
Reading from 0x309218 returns 3, whatever that means. :-)

Reading from RAM_JTBOOT (0x30b000) is returning inconsistent results between EVE_cmd_regread() and EVE_memRead32(), not like EVE_cmd_regread() is executed with higher privilege, more like what is returned for this memory region is not actually accessible for both functions.

The region from 0x309000 to 0x30914e has a few documented registers like REG_TRACKER and REG_FLASH_SIZE,
it is not mentioned in the memory map though, "Table 5-1 BT817/8 Memory Map".

I also had a look at the code for BRT_AN_025.
are not implemented to do anything usefull and all these write out the parameters to EVE that are return parameters.
There is EVE_LIB_GetProps() though.

EVE_CMD_PCLKFREQ() does write the parameter "factual" although this is a return parameter.
EVE_CMD_FLASHFAST() does write the parameter "result" although this is a return parameter.
EVE_CMD_MEMCRC() does write the parameter "result" although this is a return parameter.

Discussion - EVE / Re: CMD_PCLKFREQ requires the flash BLOB?
« on: May 18, 2023, 11:49:42 AM »
Hi Rudolph,
Thanks for your detailed information, we will review your feedback,
Yes, the main difference is that having the BLOB and Flash in full speed prevents the command from setting a value which exceeds the spec of the PLL frequency. Without these it may set a value which exceeds the allowable spec and so may affect reliable operation.

Best Regards, BRT Community

Thank you for the confirmation!
As I wrote, I never encountered the issue but at the very least my code is running more robust now after I changed it to not use CMD_PLKFREQ anymore.
Not that CMD_PLKFREQ is not working, but as I provide a library for anyone to use I can not rely on the content of an external flash that might not even be there.
I do not even have flash initialization in my init function so it can be done if required.

Pages: [1] 2 3 ... 24