The network host should use the following procedure in order to upload an application firmware file into the DS:
|•||First, it is necessary to verify if the NetLoader is already running. This is done by sending the Echo (X) command [application firmware/ NetLoader] and checking the m flag in the reply data (see how the NetLoader is started). If the NetLoader is not started yet then the following steps should be taken:|
|•||It is better to verify that the NetLoader is, indeed, running, by sending another Echo (X) command and checking the status of the m flag.|
|•||Once the NetLoader is started the network host should send Start Over (Q) command to reset the data upload process.|
|•||Then, the network host should issue as many Data Block (D) commands as necessary to upload the entire firmware file.|
|•||When the upload is completed the host should send the Verify and Start Firmware (E) command to start the newly loaded firmware. The host should wait about 2 seconds (to allow the firmware to start) before proceeding to the next step.|
|•||As the last step of the procedure it is better to issue the Echo (X) command again to verify that the new firmware is, indeed, running.|
The above procedure is, of course, simplified, as it does not take into account all kind of possible errors that can potentially arise practically on every step of the firmware upload. The "entity" performing the upgrade should carefully analyse the result of every step in the above procedure and correctly react to different error codes returned by the DS.
Also, the procedure above doesn't show the use of the Select In Broadcast Mode (W) command that provides a way to program the DS whose IP-address is unreachable (see broadcadt UDP programming for explanation). The NetLoader also support a similar command (see Select In Broadcast Mode (W) command ). Important point to realize is that since the NetLoader is a separate firmware component the Select In Broadcast Mode (W) command should be used twice:
* These commands should, of course, be sent as UDP broadcasts in this case.