General Category > Discussion - EVE

Want to use ESD 4.14.0 with BT817Q and 512MB Flash (Riverdi 7" Display)

<< < (2/4) > >>

BRT Community:
Hello,

I believe you may have a slight misunderstanding of how the EVE series of ICs operate, in general you do not upload any code directly to the EVE IC.

The EVE series of ICs are memory mapped SPI slaves devices which are controller via a SPI master device, in your case the ESP32. The SPI master is responsible for issuing commands to the EVE IC which are then interoperated and used to drawn the screen. Any functionality such as screen updates are implemented within the MCU code, for example if you wish to change a screen displayed based on a button press then the MCU would be responsible for this action and subsequently write a new series of SPI commands to EVE to draw  the given screen.

Please see the following for some background on the EVE ICs functionality:
https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/BRT-AN-006-FT81x-Simple-PIC-Example.pdf
https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/BRT_AN_008_FT81x_Creating_a_Simple_Library_For_PIC_MCU.pdf

Again unfortunately the ESD software does not support the ESP32 MCU, and you would need to port any code generated to this MCU and then upload it via its applicable IDE.


--- Quote from: J369 on November 30, 2021, 06:19:08 PM ---My end goal:
As first step:
I am only trying to download a slider to my screen and see if it’s working. Directly from my PC to EVE (no controller in between as first step). Is this a correct path?


--- End quote ---

You can use your MPSSE SPI bridge to control the EVE display without the ESP32, however again this will not download any code to EVE and will create a MSVC project to issue SPI commands to EVE via USB.

Best Regards,
BRT Community

J369:
Hello,

Yes, I knew about it. I was expecting some way to port this code to my controller. But it is now more clear to me that I can't use ESD for now. I hope something can come up in near future for ESP32.

Now, with another approach I am trying to create my screen/image with Eve Screen Editor and saving it to flash. Which I am successfully able to do.
Then I am trying to load image back from flash to the screen using ESP32, which I am able to do as well.
however, when I load the image back from flash from EVE Screen Editor the image is loading as it should. And when I load the image using ESP32 the image is loading with exact same shape of my png but with black mask on it. so colors are not being loaded to the image.
Can you please identify what's the issue here?
Any steps to follow?

Regards.

BRT Community:
Hello,

If you refer to the porting guide you should be able to port this code to your ESP32 without too much effort.

Could you please clarify the following:


--- Quote from: J369 on December 02, 2021, 09:19:06 PM ---Then I am trying to load image back from flash to the screen using ESP32, which I am able to do as well.
however, when I load the image back from flash from EVE Screen Editor the image is loading as it should. And when I load the image using ESP32 the image is loading with exact same shape of my png but with black mask on it. so colors are not being loaded to the image.

--- End quote ---

The above would seem to indicate that the image has been successfully loaded from flash using code on your ESP32 on at least one occasion, is this correct?

In any case when an image loads as just a blank square on the screen this normally indicates and issue with streaming the image data into the co-processor. i.e. the commands to draw the image have executed correctly (drawing the black square) but the image data is missing or corrupt.

Could you please provide the code you are using to display the image?

Best Regards,
BRT Community

J369:
please verify the code below.
initStaticBackgroud() function is being called once at the beginning of set up.
And tft_display function is being called every 1 sec continuously. Image shape is being loaded with black solid color. If I try to load that image from flash using EVE Image Editor tool, then I am able to load with colors. so I confirmed that image stored in flash has correct details and not corrupted. it's just when I try to load using ESP32 with below code, is when I am getting issue. something I am not following correctly I think.


--- Code: ---void initStaticBackground(void)
{
EVE_cmd_dl(CMD_DLSTART); /* Start the display list */

EVE_cmd_dl(TAG(0)); /* do not use the following objects for touch-detection */

EVE_cmd_bgcolor(0x00ffffff ); /* light grey */

EVE_cmd_dl(VERTEX_FORMAT(0)); /* reduce precision for VERTEX2F to 1 pixel instead of 1/16 pixel default */

/* draw a rectangle on top */
EVE_cmd_dl(DL_BEGIN | EVE_RECTS);
EVE_cmd_dl(LINE_WIDTH(1*16)); /* size is in 1/16 pixel */

EVE_cmd_dl(DL_COLOR_RGB | RED);
EVE_cmd_dl(VERTEX2F(0,0));
EVE_cmd_dl(VERTEX2F(EVE_HSIZE,LAYOUT_Y1-2));
EVE_cmd_dl(DL_END);

/* draw a black line to separate things */
EVE_cmd_dl(DL_COLOR_RGB | BLACK);
EVE_cmd_dl(DL_BEGIN | EVE_LINES);
EVE_cmd_dl(VERTEX2F(0,LAYOUT_Y1-2));
EVE_cmd_dl(VERTEX2F(EVE_HSIZE,LAYOUT_Y1-2));
EVE_cmd_dl(DL_END);

/* Import an image from the Flash memory */
EVE_cmd_flashsource(4096);

uint8_t *data = (uint8_t *)malloc(10368 + 1);
EVE_cmd_loadimage(4096, EVE_OPT_FLASH, data, 10368);
free(data);
EVE_cmd_dl(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_dl(VERTEX2F(120, 135));
EVE_cmd_dl(DL_END);

EVE_cmd_text(EVE_HSIZE/2, 15, 29, EVE_OPT_CENTERX, "Hello World!");


/* add the static text to the list */
EVE_cmd_text(10, EVE_VSIZE - 65, 26, 0, "Bytes:");

EVE_cmd_text(10, EVE_VSIZE - 50, 26, 0, "DL-size:");
EVE_cmd_text(10, EVE_VSIZE - 35, 26, 0, "Time1:");
EVE_cmd_text(10, EVE_VSIZE - 20, 26, 0, "Time2:");

EVE_cmd_text(125, EVE_VSIZE - 35, 26, 0, "us");
EVE_cmd_text(125, EVE_VSIZE - 20, 26, 0, "us");


while (EVE_busy()) {};

num_dl_static = EVE_memRead16(REG_CMD_DL);

EVE_cmd_memcpy(MEM_DL_STATIC, EVE_RAM_DL, num_dl_static);
while (EVE_busy()) {};
}

void TFT_display(void)
{
static int32_t rotate = 0;

if(tft_active != 0)
{
#if defined (EVE_DMA)
uint16_t cmd_fifo_size;
cmd_fifo_size = EVE_dma_buffer_index*4; /* without DMA there is no way to tell how many bytes are written to the cmd-fifo */
#endif

EVE_start_cmd_burst(); /* start writing to the cmd-fifo as one stream of bytes, only sending the address once */

EVE_cmd_dl_burst(CMD_DLSTART); /* start the display list */
EVE_cmd_dl_burst(DL_CLEAR_RGB | WHITE); /* set the default clear color to white */
EVE_cmd_dl_burst(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG); /* clear the screen - this and the previous prevent artifacts between lists, Attributes are the color, stencil and tag buffers */
EVE_cmd_dl_burst(TAG(0));
EVE_cmd_append_burst(MEM_DL_STATIC, num_dl_static); /* insert static part of display-list from copy in gfx-mem */
EVE_cmd_dl_burst(DL_COLOR_RGB | WHITE);
EVE_cmd_setbitmap_burst(4096, EVE_COMPRESSED_RGBA_ASTC_8x8_KHR, 181, 185); /* display directly from FLASH */
EVE_cmd_dl_burst(VERTEX2F(200, 100));
EVE_cmd_dl_burst(DL_END);
EVE_cmd_dl_burst(DL_BEGIN | EVE_BITMAPS);

/* display a button */
EVE_cmd_fgcolor_burst(0x00ffffff); /* some grey */
EVE_cmd_dl_burst(TAG(10)); /* assign tag-value '10' to the button that follows */
EVE_cmd_button_burst(20,20,80,30, 28, toggle_state,"Hey!");
EVE_cmd_dl_burst(TAG(0)); /* no touch */

#if defined (EVE_DMA)
EVE_cmd_number_burst(120, EVE_VSIZE - 65, 26, EVE_OPT_RIGHTX, cmd_fifo_size); /* number of bytes written to the cmd-fifo */
#endif
EVE_cmd_number_burst(120, EVE_VSIZE - 50, 26, EVE_OPT_RIGHTX, display_list_size); /* number of bytes written to the display-list by the command co-pro */
EVE_cmd_number_burst(120, EVE_VSIZE - 35, 26, EVE_OPT_RIGHTX|5, num_profile_a); /* duration in �s of TFT_loop() for the touch-event part */
EVE_cmd_number_burst(120, EVE_VSIZE - 20, 26, EVE_OPT_RIGHTX|5, num_profile_b); /* duration in �s of TFT_loop() for the display-list part */

EVE_cmd_dl_burst(DL_DISPLAY); /* instruct the graphics processor to show the list */
EVE_cmd_dl_burst(CMD_SWAP); /* make this list active */

EVE_end_cmd_burst(); /* stop writing to the cmd-fifo, the cmd-FIFO will be executed automatically after this or when DMA is done */

}
}
--- End code ---

BRT Community:
Hello,

thank you for your code snippet.

Can you just confirm the format of the image you have stored in flash? Is this a EVE_COMPRESSED_RGBA_ASTC_8x8_KHR image or have you copied the native JPEG/PNG data into flash?

I ask this as the CMD_LOADIMAGE command is only applicable for PNG/JPEG data, and I believe this may be where the issue lies.  (just to note this approach is applicable, but you need to load the raw JPEG/PNG data into flash and not a conversion of the image data for this approach).

If you are using a EVE_COMPRESSED_RGBA_ASTC_8x8_KHR you would need to utilise the CMD_SETBITMAP command in a similar manner to the following:


--- Code: ---CMD_SETBITMAP(0x800000 | 128, COMPRESSED_RGBA_ASTC_8x8_KHR, 110, 85)
BEGIN(BITMAPS)
VERTEX2II(0, 60, 0, 0)

--- End code ---

Best Regards,
BRT Community

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version