IFU issue using USB

Reading a TCA-File from USB-Stick (4GB, FAT32 ) throws error after calling updater.VerifyApplication().
The chunk size is set to 1024 Byte.

#### Exception System.ArgumentException - 0xfd000000 (3) ####
    #### Message: 
    #### GHIElectronics.TinyCLR.Update.InFieldUpdate::NativeAuthenticateApplication [IP: 0000] ####
    #### GHIElectronics.TinyCLR.Update.InFieldUpdate::VerifyApplication [IP: 0016] ####
    #### Basic_Test.Program::backgroundThreadHandler [IP: 001f] ####
Ausnahme ausgelöst: "System.ArgumentException" in GHIElectronics.TinyCLR.Update.dll
Ein Ausnahmefehler des Typs "System.ArgumentException" ist in GHIElectronics.TinyCLR.Update.dll aufgetreten.

The same TCA file is working with TinyCLR-Config.
The code i used is mainly from the documentation.

var filestreamApp = new FileStream(appfilename, FileMode.Open);
var idxApp = 0;
while (idxApp < filestreamApp.Length)
    var count = filestreamApp.Read(dataChunk, 0, dataChunk.Length);
    idxApp += updater.LoadApplicationChunk(dataChunk, 0, count);

Debug.WriteLine("Verifying application.... ");
Debug.WriteLine("Application version: " + updater.VerifyApplication()); 

I also tried it with other USB sticks → same problem.
Extend heap and extend deployment is enabled.
I also double-checked the application key. (copy from created file from TinyCLR-Config)

Any help would be great.

We don’t see anything wrong with your code, but it is small, not enough to know what exactly.

If you can reproduce with small example then send us that example, please.

and what firmware eversion by the way.

What is the version you typed in when creating the tca file?

I left the version as it was:

→ But I will try a different (higher?) version number

→ Version: 1.0 didn’t work either

Firmware Version is: v2.2.0.3000 (RC1)

Make sure it is in the same format, otherwise this exception is also thrown.
Ex: version works, but version 1.0, 1.0.0, does not work.

I also tried, no success

I tried the project you sent, not modified anything yet. Just deployed and it ran perfectly.

Verify exception happened on few cases

  • Key:
  • Data from to USB
  • Data write to buffer cache.

if your device support ext memory, try to use memory instead of external Flash as cached buffer

updater = new InFieldUpdate();  // use memory as cached buffer

To verify usb: Read and calculate CRC, compare to check. Or switch to SD for testing.

We tried on SC20260 Dev, enabled ext RAM and Flash, as you mentioned.

Enabled memory give you 32MB, max tca is ~6MB. Easily to debug where the wrong is.

I found the issue that was preventing a proper update via USB in my case.
Somtimes TinyCLR-Config (or Win10) creates the TCA-File with the timestamp 01.01.2017.


when this occurs → no IFU is possible and the exception is thrown.
This happens 8 out of 10 times with random noname USB sticks (4GB).
I couldn’t reproduce it with an Intenso (8GB).

Conclusion : The problem was on the PC side

1 Like

TinyCLR Config doesn’t do anything with timestamp but we will keep this issue in mind for other users in the future.