Memory Clean-up

We are updating all our equipment which were deployed in field to latest WinCE image and our newest software version. I would like to make sure I will erase all existing data on the flash before I do the update.

Is there any eboot command which does this?

Dear @toradex.questioner

Actually there is a command eraseflash in Eboot to delete the whole flash memory. However I don’t think this is required for a regular update process, especially as it takes more than 15 minutes to finish.

To clear the partition table of the file system, you can use the bootloader command clearfs. This re-initializes the file-system, similar to a quick-format.

All other partitions are typically overwritten in the update process anyway. The individual sections are shown in the developer page article Flash Layout i.MX6.
Please let me know if you need more information about this.

Regards, Andy

@andy.tx, the customer wants to erase all contents from his application, but keep Windows installed, in case he wants to update his application but keep Windows as it is. From what I understood, it’s something like restoring the system to what it was before installing his application.

Is there a command that does this (erase contents but keeps Windows intact)?

Hi @gustavo.tx

Simple case

What the customer wants to keep unmodified, is probably

  • Bootloader
  • WinCe Image
  • ConfigBlock
  • Registry

An Update of his application means probably updating

  • Files on the Flashdisk

If the separation is so clear, it is easy - clearfs in the bootloader (as described in my previous answer) reformats the Flashdisk, while keeping everything else intact. Reformatting the Flashdisk or deleting all files on the Flashdisk can also be done from within Windows.

Complex Case

There are situations where the separation is not so clear:

  1. If the customer uses .cab installers to add Windows features - such as the .NET framework - these system files are installed on the Flashdisk
  2. If the customer’s application uses the registry to store configuration parameters, the registry is used for both the system and the application.
  3. In rare cases, customers decide to store information in the ConfigBlock

In these cases, it requires a more intelligent update algorithm to delete the relevant parts.

Regards, Andy

In your answer, you say “Reformatting the Flashdisk or deleting all files on the Flashdisk can also be done from within Windows.”.
What Windows System calls can one use to re-format the \FlashDisk volume? Is this also possible using .NET Compact Framework? In a Command Prompt on Windows CE the format and fdisk commands are not found.

Dear @zorro
The functions to format drives are in the Storage Manager

I’m not aware whether these functions are available in the .NET framework. If not, you can P/Invoke the functions.

Regards, Andy