In-Field Firmware upgrade with less deployment steps


I am working with the EMX to perform in-field firmware upgade I have followed the instructions in the API documentation and managed to successfuly perform firmware upgrades via obtaining a frimware file from a FTP server.

The question i have is in regards to production deployment, it would seem that to program a newly purchased (factory settings) device, the following steps are required to enable in field firmware upgrades.

  1. deploy an application that calls SystemUpdate.EnableBootloader(); which formats the flash spitting it into 2 sections i.e. boot section and application section, this app gets erased and the device reboots into the application section of flash.

  2. now that we are in the application section of flash I deploy another application which does nothing other than call SystemUpdate.AccessBootloader(); when the device reboots it now is accessing the boot section of the code.

  3. I now have to deploy a third application which is my boot application. This performs an application upgrade over an FTP server which writes the application image then reboots and runs the application image.

As you can see there are 3 image deployments + 1 in field deployment involved in getting my application running.

Is it possible to deploy only one image which already provides a formated flash memory structure and boot application code so that i can avoid steps 1 and 2?

Yes it is check Pyxis 2 code …

I think Dejan didn’t understand your question.

As of now, this is the only way. This is on our list to see how can this be improved in near future.

I think Im understand him :slight_smile:
Once he have App.HEX and bootloader.HEX he just deploy both with other files(firmware) to device. First time when he will turn on device it will itself do everthing if he will use in app.HEX in main() next code:

public static void Main()
            switch (SystemUpdate.GetMode())
                case SystemUpdate.SystemUpdateMode.NonFormatted:

                case SystemUpdate.SystemUpdateMode.Bootloader:
                    throw new Exception("Invalid Boot Mode!");
                case SystemUpdate.SystemUpdateMode.Application:
                    //DO WHAT YOU WANT

So when he will in code call:


device will reboot into bootloader.HEX application which will update device and after sucessfully or failed update it will call:


Device will reboot to normal app.HEX application…
So if he already have HEX files he upload them all in one deploy to device but app and bootloader must be writen right… If he would like get HEX files from device then he must put device to mode from which would like get HEX file(application or bootloader).
I think that this is what he search :slight_smile: but maybe I still don’t understand what he want :slight_smile:

Then maybe I didn’t understand the question :slight_smile: Thanks for helping.


I have attempted to follow the steps that you have suggested, here are the following problems that occur.

  1. when i try to deploy all the files at once i.e. .net 4.1 plus the mybootloader.hex and myapplication.hex i get an error from MFDeploy telling me that there is a problem with the .sig file (i did not create a .sig file for mybootloader.hex and myapplication.hex)

  2. my next attempt was to deploy frist the .net framwork firmware, once complete i try to deploy mybootloader.hex and myapplication.hex in one deployment, however after it deploys the frist file I then get an error which states that it cannot reconnect to the device.

  3. my next attempt is like the previous however i now decided to deploy mybootloader.hex and myapplication.hex seperatly. Each time i do this i still get the error saying it could not reconnect to the device however i just wait a few seconds then it reconnect and i can deploy the second file.

At this point i have deployed all the files i need however the image that runs is mybootloader.hex which is not as expected, as per your suggestion myapplication.hex should run so that it formats the flash then runs the bootloader.

Also i cant see how your suggestion would work anyway since calling EnableBootloader will is supposed to erase the applications that are loaded.

can you please clarify if this is what you meant and if you have tested it working?

also your comment [quote]but app and bootloader must be writen right… [/quote] does this mean that mybootloader.hex should be generated from the boot segment of flash and myapplication.hex generated from the application section because that is how i did it.