Replies: 17 comments 11 replies
-
Yes, using individual wr8 commands to transfer bytes to RAM_G takes a long time as there is always 3 bytes address overhead. But to take that a step further, CMD_FLASHUPDATE has to take extra steps and your flash is empty anyways. Hmm, as RAM_CMD is only 4k in size I do wonder now what happens if EVE_cmd_flashwrite() is used with more than 4k. What is the point of this exercise though? |
Beta Was this translation helpful? Give feedback.
-
I tried to understand your EVE_execute_cmd() now. Look at Bridgetek example, they calls EVE_Cmd_waitFlush(s_pHalContext); after swap called (https://github.com/Bridgetek/EveApps/tree/master). However, Riverdi doesn't call after swap functions get called. But I do note that they call Gpu_Hal_WaitCmdfifo_empty(phost); in Gpu_CoCmd_FlashHelper_Write or other CoCmd functions. I guess this is same as waiting for Cmd FIFO to finished and empty. Also, I see you use EVE_Busy to check the Cmd FIFO. All three is use to make sure the Co-Op Processor Complete Execute cmd in cmd fifo without error. But all three done in difference way. Have you ever use the Bridgetek or Riverdi API and get any problem so you come up with your own EVE_Busy function? As I said I have a problem with Gpu_Hal_WaitCmdfifo_empty(phost); that stuck when writing data to EVE4 Flash. I'm looking for better way to handle this issue. |
Beta Was this translation helpful? Give feedback.
-
The original FTDI implementation was the reason why I started with my library back in end of 2015. The main difference between the implementations is that the Riverdi and the Bridgetek version still use the old FT80x API, they write directly to RAM_CMD, keep an internal variable to keep track of the offset and start commands by setting REG_CMD_WRITE. My EVE_execute_cmd() is only what is left of the original function, it does not need to start command execution anymore, only wait for completion. When building display lists I never wait for command execution in between, only when using commands like CMD_INFLATE that are not meant to be used in display lists. What I currently do not have is support for TIs TM4C controllers though. I just added targets for the two boards that are supported by PlatformIO to my Arduino example. And for non-Arduino use I should order an EK-TM4C1294XL. |
Beta Was this translation helpful? Give feedback.
-
I'm using TM4C1294 so it close to MSP432. They both Core Arm M4F. I'm working on Embedded System so coding style will be close to Arduino/MSP430. I guess I will start working on my own API using REG_CMDB_WRITE to optimize the data transfer. The product I'm working on is using latest display EVE4 so the API from Riverdi and Bridgetek may not optimize for the EVE4 anymore as you said. |
Beta Was this translation helpful? Give feedback.
-
As I wrote, Bridgeteks library can use REG_CMDB_WRITE now as well. And I don't know much about MSP430 / MSP432 either. |
Beta Was this translation helpful? Give feedback.
-
I'm working on using REG_CMDB_WRITE now. So far everything working fine. Just one question when using CMD_FLASHREAD. This command is for copy Bitmap/xFont to RAM_G. When using with REG_CMDB_WRITE, it won't trigger right away and time to copy from Flash to RAM_G is take time. How you deal with this? Do I need to set CS high right after CMD_FLASHREAD and wait for certain time to make sure everything is in RAM_G before I continues using REG_CMDB_WRITE? |
Beta Was this translation helpful? Give feedback.
-
Technically the FIFO can be filled with more commands while CMD_FLASHREAD is beeing worked on by the co-processor. |
Beta Was this translation helpful? Give feedback.
-
I have Display_Test() call in while loop every 1 second. Each time, it will display new image that copy from flash to RAM_G. How you handle this?
Doesn't work, some how it tried to draw 3 bits map at one. Space is always at 0 (space = Gpu_Hal_Rd16(phost, REG_CMDB_SPACE) & FIFO_SIZE_MASK;). Not sure why. I guess SetBitMap can't use with other cmd in one transmistion. I'm not sure how to handle this. Any suggestion? |
Beta Was this translation helpful? Give feedback.
-
I'm just testing display image only. But it doesn't works as the way I want. The old way seem more stable but I do like the speed of burst. Let me play around to see if there any way to fix this. |
Beta Was this translation helpful? Give feedback.
-
@RudolphRiedel This is my test run. have you tried to display bitmaps with burst before? I'm not sure why burst with bitmap doesn't works for me.
|
Beta Was this translation helpful? Give feedback.
-
I have not tried something like this in particular with CMD_FLASHREAD before building the display list. Now I kind of wonder though what this looks like. |
Beta Was this translation helpful? Give feedback.
-
I do have Logic Analyzer, the burst mode sending correct data. Even the CMD_FLASHREAD. Because in burst mode, I don't use CMD_FLASHREAD in burst mode so I this should work as it works in other mode. |
Beta Was this translation helpful? Give feedback.
-
I use CMD_FLASHREAD because the TM4C only have 1MB internal flash. Storing bitmaps, custom fonts. So CMD_FLASHREAD is what I frequently used when it need. What I'm doing now is just for testing Burst with Flash but it doesn't work out for me at the moment. I'm still working on this to see why. |
Beta Was this translation helpful? Give feedback.
-
I know why. After SWAP, we need to wait to make sure Cmdfifo empty. Gpu_Hal_WaitCmdfifo_empty(); or (REG_CMDB_SPACE == 4092). But if waiting for Cmdfifo be empty, then the Display time in both case with/without burst mode will be 13.49ms as I measured. So best fix will be before starting burst mode, make sure Cmdfifo is empty. What I need to test is determine how long does EVE4 take to make cmdfifo empty from full. |
Beta Was this translation helpful? Give feedback.
-
No, not really, given the premise of calling the function once per second the FIFO will always be empty, unless there was a co-processor error. I tried this now and even added a special version of EVE_cmd_flashread() that only works in my burst mode:
I took a bunch of icons in .png with alpha channel and 256x256 pixels and converted these: After writing the image to the external flash I added one pair of flash_read to my TFT_init():
And then I added displaying these images to my TFT_display() that is called every 25ms:
And the two icons got displayed. Now I added code to my TFT_display() to read new images from flash once per second like you did.
And like this with my normal EVE_cmd_flashread(), one call when the images are read from flash needs about 5.9ms. When I switch over to use EVE_cmd_flashread_test() the execution time drops to 18µs with DMA and 172µs without DMA. The bytes sent to the FIFO are 252 normally and 284 with the two EVE_cmd_flashread_test(). |
Beta Was this translation helpful? Give feedback.
-
@RudolphRiedel Thank for your information. I just find out that the my Logic Analyzer causing noise to the SPI signal that give my display running crazy. It doing better now. The problem I have is because the RAM_G only 1MB and the bitmap for each screen is big so I can't copy all the images to RAM_G at Init state. Also, xfont and font cache also take some space in RAM_G too so the worst case that I have to re arrange data in RAM_G for new screen. Also, my MCU doing application along with display. I have to make sure that display function must finished within 50ms (worst case 100ms) so the MCU still have time to do other tasks. |
Beta Was this translation helpful? Give feedback.
-
I will try with ASTC. I tried ASTC before and the image quality is not really good compare to RGB565. And I do see each version of EVE Asset Builder give me different results, including convert images, custom fonts. I find that EVE Asset Builder 2.6.1 is best stable for me. Same custom fonts/characters list, same setup, v2.6.1 and v2.10.2 give me different result. I may start testing display images directly on Flash using ASTC and see how long does it takes. |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I'm working on updating EVE4 display Flash from TM4C MCU using 16Mhz SPI. I'm currently using Riverdi EVE4 7" display that comes with 64MB of flash.
What my code is doing now is:
Check if Flash is empty or not. If it is not empty, erase it.
Install Blob to flash by:
=============================================
for (j = 0; j < 4096; j++){
Gpu_Hal_Wr8(phost, RAM_G_Address, Blobdata[j]);
RAM_G_Address++;
}
RAM_G_Address = 0;
// Copy from 4K data from RAM_G starting address 0 to Flash at address 0 with 4k bytes
Gpu_CoCmd_FlashUpdate(phost, Flash_Address, RAM_G_Address, 4096);
Gpu_Hal_WaitCmdfifo_empty(phost);
Switch the Flash to SQPI mode and then fill the rest with dummy data using Wr8 command for testing.
This method takes about 20 minutes to fill 64MB.
The EVE Asset Builder tool takes about 9 minutes to update the flash.
How do I improve the writing time? I'm thinking about using Wr32 command but not sure it will help.
Has anyone dealt with this problem before and how did they solve it?
Beta Was this translation helpful? Give feedback.
All reactions