A tool for replacing a code image in an embedded device including a control program for issuing device commands in order to replace a code image within the embedded device. A monitoring program, operating asynchronously with respect to the control program, generates event indications in response to detecting a change in an attribute associated with the embedded device. The disclosed monitoring program issues device commands and receives event indications. Separate threads of control are used for monitoring and controlling the device being upgraded, and each step of the upgrade process is abstracted as a device independent command. The disclosed system further uses a state machine to keep track of where the device is in the upgrade process.
展开▼