The invention relates to the technical field of
single chip microcomputer, especially relates to a
single chip microcomputer online upgrading method and
system, wherein the method comprises the following steps: the
single chip microcomputer initializes the upgrading variable after receiving the upgrading start command, and replies the current running area to the upgrading
software of the upper computer, so that the upgrading
software of the upper computer decides to generate the upgrading Bin file to be transmitted according to the current running area; The single
chip microcomputer receives the upgraded Bin file and stores the upgraded Bin file in the unrunning area of the single
chip microcomputer. After receiving the
upgrade jump command, MCU shuts down the interrupt, copies the interrupt vector area of
upgrade program to the interrupt vector area of MCU, runs the new program after the soft restart, and completes the
upgrade. The invention divides the FLASH of the single
chip microcomputer into an interrupt vector area, an application program A area and an application program B area. The interrupt vector area occupies small bytes, and only the interrupt vector area needs to be copied when upgrading, thereby saving the FLASH space and the program moving time. At that same time, the upgrade Bin file can be converted into region, and the online upgrade can be realized without interrupting the service.