An ECU includes a microcomputer that has an integrated flash memory. An
initial writing flag is set in the microcomputer before an initial
writing to the flash memory. The microcomputer enters into a writing mode
when the flag determines permission of data writing. When the
data-writing to the flash memory is completed, the flag is cleared.