Have problems when using in-field upgrade

Hi Admin,

I follow the instruction of GHI Library Reference Manual to create a managed bootloader app and main app.

I have a upgrade server, the managed bootloader app downloads firmware from upgrade server and use SystemUpdate.CompleteUpdate to update new firmware and managed bootloader.

Here is what I did

  1. I run the main app in application mode, the use MFDeploy to dump a hex file named “CFV2.0.0.0.hex”.
  2. Run upgrade server and restart EMX device, after the main app restarts, it connects upgrade server and find a new version, then the device enters bootloader mode (SystemUpdate.AccessBootloader) and reboot.
  3. Stop upgrade server and deploy the managed bootloader app to EMX, the managed bootloader could not find upgrade server, it will sleep 30 minutes and wait to reboot the device. I use MFDeploy to dump managed bootloader hex file.
  4. a) After I restart upgrade server and reboot EMX device, the managed bootloader start to upgrade:

     SystemUpdate.CompleteUpdate.Start();
     while(true)
     {
         // download and write
         SystemUpdate.CompleteUpdate.Write(data);
     }

     SystemUpdate.CompleteUpdate.End();

But I always get an error from SystemUpdate.CompleteUpdate.Write. Here is the debug log from MFDeploy

Then I erase the device and use MFDeploy to deploy the managed bootloader app and main app to EMX, I always get a signature checking error. Sometimes it is BL1.0.0.0.hex(bootloader), sometimes is CFV2.0.0.0.hex(main app).

The size of BL1.0.0.0 is 116KB, and 1786KB for CFV2.0.0.0.hex.

Either the wrong files are being downloaded or something wrong/bug with the network file transferring.
Make sure the BL hex file is read when you are in Bootloader mode.
Make sure the app hex file is read when you are in application mode.
Try updating from an SD card first. This rules out the possible problem in the network code…

Yes, you are right. The problem is caused by network transferring. I’ve fixed that.

But I have a problem again.

For example, my EMX uses fixed/dynamic IP, after updating, the managed bootloader reboot the device. But when the main app run, I found the EMX device could not get IP from my router even I set network interface to DHCP enabled programmatically. I tried to use ExtendedWeakReference to save network interface information in managed bootloader, but seemed it was erased after updating. Do you have any idea to make it working?

Thanks.
Phoenix

Can you double check? I think EWR is not supposed to be erased.
Also, there is this:
http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/html/ccb0e435-a5e2-d315-9be4-b8de5a6fcc85.htm

Thanks. I found why it didn’t work.

Because I have used several WeakReference ID in my main app, so I use a high ID (1024) as network config ID. I guess the ID must be too high for micro .net. So I choose a small one and now it works.