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
- I run the main app in application mode, the use MFDeploy to dump a hex file named “CFV2.0.0.0.hex”.
- 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.
- 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.
- 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.