摘要 |
PROBLEM TO BE SOLVED: To provide a controller which surely rewrites a program through communication. SOLUTION: Writing to an area 2 of flash memory is started (S112) when a control program arrives (S110 is Yes). Here, when service interruption occurs (S114 is Yes) before finishing writing (S118 is No), processing is shifted to a B part that performs initialization after service interruption. When the writing of the control program to the area 2 is appropriately finished (S118 is Yes), rewriting of the control program that is stored in the area 2 to an area 1 is started (S120). When the rewriting to the area 1 is finished (S124 is Yes), processing is started (S126) according to the rewritten control program in the area 1. Here, if there is service interruption in the middle of writing to the control program area 2, the control program held in the area 1 of the flash memory is read and the processing is performed according to the program. |