Update.exe fails to reset saved registry

Hi,

I’ve encountered a problem with UpdateTool (T20 WEC7 image 2.4) failing to reset saved registry when flashing the whole flash content (eboot + NK + configblock + FlashDisk filesystem).

Routine:

  1. Started UpdateTool from command line to flash the whole flash content using a CFG file
  2. After rebooting made some manual changes to the registry and saved them to the flash
  3. Repeated the action 1)
  4. After rebooting found the changes in the registry intact (expected to be reset)

I tried with no success:

  1. Not flashing the FlashDisk filesystem
  2. Flashing a 64K NB0 file consisting of zeroes to REG partition

I’m attaching the CFG file and UpdateTool debug output.

ce7.cfg (2.2 KB)
DebugOutput.txt (5.2 KB)

The following lines seem concerning:

Skipped Write ConfigBlock (no change)

[NvRefTrack] Unhandled leak of object type 2

Storing Registry Succeeded

(“Storing Registry Succeeded” appears just before rebooting – it looks like the changes made by UpdateTool are overwritten by OS)

Colibri T20 512MB V1.2A
BSP 2.4 CE 7.0

Means that a new config block data is the same as existing one , so no flash write required.
If you wish to clear registry you can use the eBoot menu. Could you explain what id your goal? Update WINCE OS? Create a backup for production programming?

Means that a new config block data is the same as existing one

And that seemed strange to me, because on the previous flashing steps all partitions have been erased. So any config block data should be treated as new. But there is no problem with configblock, I just found that line concerning. The problem is with erasing saved registry.

My goal is to prepare SOM (which can be in factory state or with any previous WEC7 image written) for working in our devices. For that purpose I need to

  1. write custom OS image,
  2. write custom configblock,
  3. write flash disk content,
  4. erase saved registry if any.

I took the standard ce7.cfg from tegra_winceimage_2.4_20220107_bis.zip and made changes to write configblock and filesystem. Everything works fine except for erasing saved registry. Sometimes it is reset, sometimes it remains intact. It is definitely reset if I write an OS image that differs from currently existing. It tends to remain intacts if I rewrite the same OS image.

As far as I understand, regardless of the OS image being written, saved registry should be reset with that CFG file. Is that correct?

I found out the cause of my problem. It has nothing to do with UpdateTool. It was an incorrect way of rebooting after flashing.

My utility flashes the OS image and then rebooted the computer.
For flashing, it ran "update.exe /u ce7.cfg", and update.exe succeeded writing all the partitions and clearing the saved registry.
For rebooting it called ::SetSystemPowerState(NULL, POWER_STATE_RESET, 0). Apparently this operation internally performs saving RAM-based registry to the flash thus overriding the effect of clearing performed by update.exe.

As soon as I replaced SetSystemPowerState() with "update.exe /rc", the line “Storing Registry Succeeded” disappeared from logs, as did the problem.

Sorry for bothering you!