We recently changed from flash based hive registry to RAM based hive registry. RegFlushKey doesn’t work in that case. We already found this issue and fixed it in 2.0b4 see roadmap:
If you don’t want to update to at least 2.0b4 you can use a workaround for now, you can use the UpdateTool to save the registry via UI or through command line parameters: update.exe /f
See: Update Tool | Toradex Developer Center