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

Author Topic: Updating basic text on screen while Erasing Flash  (Read 14664 times)

b2mishra

  • Newbie
  • *
  • Posts: 8
    • View Profile
Updating basic text on screen while Erasing Flash
« on: June 03, 2020, 02:41:03 PM »

Display: Matrix Orbital EVE3

I am trying to update the Flash on the display from my MCU.
Erasing and Writing seem to work fine.

My problem is, it is a 16MB flash, and takes more than 1 minute to erase.
While erasing, I can not update anything on the screen to show that Erasing is in progress.
Is there a way to speed up this process, or do erases in smaller blocks instead of a full flash erase, so that I can update basic text on the display?

Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 743
    • View Profile
Re: Updating basic text on screen while Erasing Flash
« Reply #1 on: June 03, 2020, 04:49:10 PM »

Hello,

A 1 min erase time for a 16MB flash does seem rather long.

Which EVE library are you using? and can I see the code you are using to call the erase?


Best Regards,
BRT Community
Logged

b2mishra

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Updating basic text on screen while Erasing Flash
« Reply #2 on: June 03, 2020, 05:57:47 PM »

I timed it, and it is actually taking 102secs every time to erase.
I am calling the following function to erase the flash:

Code: [Select]
/* Erase entire flash */
void Gpu_CoCmd_FlashHelper_Erase(Gpu_Hal_Context_t *phost)
{
  Gpu_CoCmd_FlashErase(phost);
  App_Flush_Co_Buffer(phost);
  Gpu_Hal_WaitCmdfifo_empty(phost);
}
« Last Edit: June 03, 2020, 06:01:02 PM by b2mishra »
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: Updating basic text on screen while Erasing Flash
« Reply #3 on: June 03, 2020, 06:38:57 PM »

There are three options for the FLASH regarding an EVE3 from Matrix Orbital.
No chip populated, 32MBit or 128MBit.
Have you soldered a 16MBit chip to your EVE3? If so, which one?

CMD_FLASHERASE uses the chip-erase command of the FLASH, this takes a while and there is no feedback
during the time the chip is busy.

W25Q32JVSSIQ  32MBit 10s ... 50s
W25Q128JVSIQ 128MBit 40s ... 200s

You could use CMD_FLASHUPDATE instead and write a buffer filled with 0xff over and over again.
But this will take a lot longer than CMD_FLASHERASE since the data is read first by EVE.
Also erasing a sector will take 45ms ... 400ms and the W25Q32JV has 1024 sectors,
that is 46s ... 410s for the smaller chip and that does not take reading and writing the data into account.

Or if the idea is to allow a user to update the content of the FLASH from like a sd-card, use CMD_FLASHUPDATE with your new data directly.
And perhaps overwrite the remaining sectors to the end of the FLASH with 0xff in case the provided image file is shorter than the storage space of the chip.

However, it is not clear if CMD_FLASHUPDATE even works in BASIC mode as this command is missing from the table on page 17 of the programming manual.
It should work at least in FULL mode but clearing the first sector with CMD_FLASHUPDATE should only be possible in BASIC mode.
I asked that before but have no answer to this so far.


Looks like EVE may be missing a CMD_FLASHCLEAR command to erase a single sector of 4096 bytes.
Logged

b2mishra

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Updating basic text on screen while Erasing Flash
« Reply #4 on: June 04, 2020, 12:48:46 PM »

I am using the 128 MBit one (16MB).

The idea is to allow a user to update the content from a USB drive. I will give CMD_FLASHUPDATE a try.
But based the numbers you provided, it might take a lot longer to update if it actually has to erase the existing sector.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 743
    • View Profile
Re: Updating basic text on screen while Erasing Flash
« Reply #5 on: June 04, 2020, 04:12:07 PM »

Hi Guys,

I will try to clarify with the development team regarding which modes CMD_FLASHUPDATE works in:

However, it is not clear if CMD_FLASHUPDATE even works in BASIC mode as this command is missing from the table on page 17 of the programming manual.
It should work at least in FULL mode but clearing the first sector with CMD_FLASHUPDATE should only be possible in BASIC mode.
I asked that before but have no answer to this so far.

Best Regards,
BRT Community
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 743
    • View Profile
Re: Updating basic text on screen while Erasing Flash
« Reply #6 on: June 05, 2020, 05:21:35 PM »

Hi Guys,

I can confirm that cmd_flashupdate works in both basic and full modes, the programmers guide will be updated to reflect this.

For an empty flash chip, it is recommend to write the blob to the first block so that flash can enter into full/fast mode, which is much faster than basic mode.

For cmd_flasherase, the speed depends on the nature of flash chip, since only several bytes commands are sent to flash chip by Eve and wait for its reply.

Best Regards,
BRT Community
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: Updating basic text on screen while Erasing Flash
« Reply #7 on: June 05, 2020, 09:41:40 PM »

I can confirm that cmd_flashupdate works in both basic and full modes, the programmers guide will be updated to reflect this.

Thank you for clarifying this.
Logged

Matrix Orbital

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Matrix Orbital
Re: Updating basic text on screen while Erasing Flash
« Reply #8 on: June 05, 2020, 11:03:07 PM »

You might find this helpful, we have an example of CMD_FLASHUPDATE with 4k blocks that are automatically erased and written using GRAM as scratch space.

https://github.com/MatrixOrbital/EVE3-BT81x-Flash

Look for the function "FileTransfer2Flash" in process.c
Logged
Matrix Orbital
Display Solution Provider

Embedded HDMI TFT's, EVE2, EVE3 & EVE4 TFT's, Serial LCD's, USB, LCD's

www.matrixorbital.com
www.lcdforums.com/forums