[quote]Do you mean load 10K, then 10K… until end of file that doesn’t work? [/quote]Yes, this is exactly what I mean. If I try this I get either the first or second case that I described depending on how I call InFieldUpdate.Initialize (with multiple types or only with InFieldUpdate.Types.TinyBooter).
Edit: Take this sample code, it is just your modified IFU tutorial.
public const int BLOCK_SIZE = 32768; // <- bock size smaller than the TinyBooter image!
public static void FlashFirmware()
// uncomment the next line to get an exception (my first described case)
InFieldUpdate.Initialize(InFieldUpdate.Types.TinyBooter | InFieldUpdate.Types.Firmware);
// uncomment the next line to get a non-functional device (second case)
// this function comes straight from your example
public static void LoadFile(string filename, InFieldUpdate.Types type)
using (var stream = new FileStream(filename, FileMode.Open))
var data = new byte[BLOCK_SIZE];
for (int i = 0; i < stream.Length / BLOCK_SIZE; i++)
stream.Read(data, 0, BLOCK_SIZE);
InFieldUpdate.Load(type, data, BLOCK_SIZE);
stream.Read(data, 0, (int)stream.Length % BLOCK_SIZE);
InFieldUpdate.Load(type, data, (int)stream.Length % BLOCK_SIZE);