UpdateTool fails to update custom image

I’m having problems using the production programming template with a custom image.
When I use it with command updatetool.exe /u \SD Card\Backup\nk7.bin (using the standard nk7.bin image) everything works fine but when I try to flash my own custom image it says Update Failed:

Immagine 2022-07-21 095829

We have no problem flashing the same custom image using the ColibriLoader tool so we know for a fact that the image is ok.
My custom image is much bigger in size compared to the standard one, maybe that could be the cause of failure? (custom image size: 60,6 MB - standard image size: 34,2 MB)

I also tried using UpdateLib library (latest version 2.5) to update my custom WEC7 test image using the following code (taken from Toradex Demo files):

BOOL fSuccess = TRUE;
TCHAR *filename;
TCHAR *format;
filename = _T(“\SD CARD\Backup\test.bin”);
format = _T(“bin”);
// Prepare the update process
fSuccess &= VybUpd_SetConfigString(hUpdate, _T(“sections”), _T(“os”), StoreVolatile);
fSuccess &= VybUpd_SetConfigString(hUpdate, _T(“format”), format, StoreVolatile);
fSuccess &= VybUpd_SetConfigString(hUpdate, _T(“filename”), filename, StoreVolatile);
if (!fSuccess)
_tprintf(TEXT(“Error setting parameters.\r\n”));
goto exit;
// Do the actual update
fSuccess &= (0 != VybUpd_Restore(hUpdate));
if (fSuccess)
_tprintf(TEXT(“\r\nUpdate completed, reboot your module to start the new image.\r\n”));
_tprintf(TEXT(“Error updating the image, your module may not load the os correctly on next reboot.\r\n”));
return fSuccess;

it works fine until the VybUpd_Restore(hUpdate) function which always returns false and the os image gets corrupted.
Is there a way to know the reason for the failure of this function?

Hi @DeasLab ,

I think the issue is that you’re trying to write a too big Image and it conflicts with the start of the filesystem.
You can reduce the size allocated for the filesystem by increasing the “nonfssize” setting in the config block, see: