The present disclosure relates to a
semiconductor device, a method for controlling the
semiconductor device, and a control program. A
semiconductor device that can update initial setting values of an interface circuit after implementation of a
mask ROM, a control method of the
semiconductor device, and a control program are provided. The
semiconductor device includes an interface circuit, a
mask ROM that stores initial setting values and an initialization function, a CPU (
Central Processing Unit) that sets the initial setting values in the interface circuit by executing the initialization function during initialization, and a nonvolatile memory. The initialization function stored in the
mask ROM includes a patch function that updates the initial setting values set in the interface circuit during initialization using address information of a
storage area to be accessed, data-related information, and
processing-related information written in the nonvolatile memory.