摘要 |
<p>Disclosed is an in-application upgrade method for optical module firmware not breaking a service. A storage area for internal programs of an optical module is divided into two areas which are respectively used for storing an upgrade program and an application program, and is divided into a special area for backing up an interrupt vector table of a Boot program; an upper computer is in communication with the optical module; the interrupt vector table is switched; and the jump between the Boot program and the application program is achieved through a program pointer. The method specifically comprises the following steps: 1, extracting the contents of firmware; 2, entering a download mode and updating the firmware; 3, erasing original firmware; 4, writing new firmware; and 5, entering an application mode, the upper computer sending a command of exiting from the download mode after data and a code pass verification, exiting from the upgrade program and turning to execute a new application program, the optical module operating normally. The upper computer sends an instruction to control the switching between the application program and the upgrade program of the present invention without resetting an MCU, and therefore the operation interrupt of the optical module will not be generated.</p> |