VEHICLE DEVICE FOR REPROGRAMMING A PROGRAM STORED IN NON-FLORANT MEMORY
Patent Information
- Application Number
- DE102019204996
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2018-04-10
- Filing Date
- 2019-04-08
- Publication Date
- 2024-10-17
- Estimated Expiration
- 2039-04-08
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
The invention relates to a vehicle device capable of reprogramming a program stored in a non-volatile memory. From the generic document DE 10 2011 088 320 A1, a vehicle update system for updating ROM data of a vehicle is known, in which, in particular, a telematics unit is configured to receive new ROM data transmitted from a telematics server. An electronic control unit (ECU) is configured to first perform a check to determine whether certain update conditions are met, and if they are met, to update the old ROM data with the new ROM data using at least one of a main battery and an auxiliary battery. In particular, the update conditions are that the state of charge and the voltage level for at least one of the main battery and the auxiliary battery is greater than a certain level, the vehicle is stopped or parked, and the Controller Area Network (CAN) communication state of the vehicle is normal. Furthermore, a method and a device for programming data into non-volatile memories are known from document DE 10 2020 045 581 A1. The device comprises a non-volatile memory and a control unit, wherein the control unit is configured to switch the programming of data of the non-volatile memory from a first programming mode to a second programming mode based on the occurrence of a control signal. Furthermore, a non-volatile semiconductor memory device disclosed in JP 2000-76878 A is generally known. A non-volatile semiconductor memory device includes a first mode of operation that performs programming (i.e., writing data) or erasing data of a memory cell at a first reprogramming time, and a second mode of operation that performs programming or erasing data of a memory cell at a second reprogramming time. Furthermore, the non-volatile semiconductor memory device includes a mode selection device for selecting either the first mode or the second mode. Although not related to a conventional technique, it is now considered that the in-vehicle device not only performs reprogramming of a program using a wired reprogramming device at a dealer or the like, but also performs reprogramming to the update program in response to receiving an update program distributed via wireless communication at any time. Furthermore, performing reprogramming to an update program distributed via wireless communication involves the in-vehicle device consuming the electric power of the battery installed in the vehicle. In cases where the program is reprogrammed in a state where the battery is not supplied with electrical energy (i.e., in a non-receiving state of electrical energy from the battery), the in-vehicle device tends to suffer from battery depletion when the vehicle is left behind after the battery consumes a considerable amount of electrical energy due to the reprogramming of the program. An object of the invention is to provide an in-vehicle device capable of suppressing the power consumption of a battery when reprogramming a program is performed while ensuring a storage period of a program. This object is achieved by an in-vehicle device having the features of patent claim 1. Advantageous further developments are the subject of the appended subclaims. More specifically, to achieve the above-mentioned object, according to one example of the invention, an in-vehicle device is provided as follows. The in-vehicle device is powered by electric power, includes a non-volatile memory that stores a program, and reprograms the program to an update program transmitted from an external device provided outside a vehicle. The in-vehicle device includes a first reprogramming section and a second reprogramming section.The first reprogramming section performs first reprogramming to a first update program under a battery power non-receiving state, which is a state in which the battery is not supplied with second electric power, in response to receiving a reprogramming request to the first update program from the external device. The first reprogramming section performs the first reprogramming by programming (i.e., writing) the first update program into the nonvolatile memory with a first programming voltage; the first programming voltage is lower than a programming voltage under a battery power receiving state, which is a state in which the battery is supplied with the second electric power.The second reprogramming section, in response to the first reprogramming section completing the first reprogramming of the first update program under the non-receiving state of electric power from the battery, performs a second reprogramming to the first update program after supplying the battery with the second electric power. The second reprogramming section performs the second reprogramming by programming (writing) the first update program, which is identical to the first update program in the first reprogramming section, into the non-volatile memory with a second programming voltage; the second programming voltage is higher than the first programming voltage at which the first reprogramming is performed by the first reprogramming section. As described above, according to the present invention, when a request is issued to perform reprogramming to an update program under the condition where the battery is not supplied with electric power, reprogramming to the update program is performed in the non-volatile memory by the first reprogramming section at a low voltage, thereby suppressing the battery power consumption due to reprogramming to the update program. Therefore, according to the present invention, even if the vehicle is left after reprogramming to the update program, it is possible to prevent the battery from becoming depleted. Furthermore, according to the invention, in cases where reprogramming to the update program was performed at a low voltage, in response to the subsequent supply of electric power to the battery, the same update program as that from the first reprogramming section is reprogrammed into the non-volatile memory at a high voltage. This can ensure the storage period of the update program. The above and other objects, features, and advantages of the invention will become more apparent from the following detailed description with reference to the accompanying drawings. In the drawings: Fig. 1 is a block diagram showing a schematic configuration of a vehicle having a control unit and a gateway according to a first embodiment; Fig. 2 is a block diagram showing a schematic configuration of a non-volatile memory according to the first embodiment; Fig. 3 is a flowchart showing a process of the gateway according to the first embodiment; Fig. 4 is a flowchart showing a reprogramming process of the control unit according to the first embodiment; Fig. 5 is a flowchart showing a reprogramming process at the time of powering down the control unit according to the first embodiment;6 is a flowchart showing a process of the control unit in a first programming mode according to the first embodiment; FIG. 7 is a flowchart showing a process of the control unit in a second programming mode according to the first embodiment; FIG. 8 is a flowchart showing a process of the control unit in a third programming mode according to the first embodiment; FIG. 9 is a view showing a V-th distribution of a memory cell after programming in the first programming mode according to the first embodiment; FIG. 10 is a view showing the V-th distribution of a memory cell after programming in the second programming mode according to the first embodiment; FIG. 11 is a flowchart showing a reprogramming process of a control unit according to a first modified example; and FIG.12 is a block diagram showing a schematic configuration of a vehicle including a control unit and a gateway according to a second modified example. Embodiments for carrying out the invention will be described below with reference to the drawings. In each embodiment, a component corresponding to a component described in a previous embodiment is denoted by the same reference numeral, so redundant explanation thereof can be omitted. In each embodiment, when only a part of the configuration is described, the other part of the configuration may be related to the previous embodiment. (First embodiment) An in-vehicle device according to a first embodiment will be described below with reference to FIGS. 1 to 10. For example, the present embodiment uses an in-vehicle device including a control unit 10 and a gateway 20. Furthermore, the present embodiment uses, as an example, an in-vehicle device capable of being mounted in a vehicle 100 having an engine 40. The following first describes an overall configuration of a vehicle 100 in which the in-vehicle device is mounted. As shown in Fig. 1, the vehicle 100 essentially includes a control unit 10 as an in-vehicle device and a gateway 20. Furthermore, the vehicle 100 includes a plurality of control units 10. The plurality of control units 10 mutually perform different controls. In the present embodiment, one control unit 10 is shown as a representative. The vehicle further includes a communication unit 30, a motor 40, an alternator 50, a battery 60, and an ignition switch 70. In Fig. 1, a dashed line between the components indicates a signal line, and a solid line between the components indicates an electrical power line. This point is the same in Fig. 12, which will be described later. The communication unit 30 communicates with a control center 200. The communication unit 30 is connected to the gateway 20 via a signal line. The control center 200 corresponds to an external instrument or device. The control center 200, which is provided outside the vehicle 100, includes a computer, a communication unit, and the like. The control center 200 distributes an update program for updating a program stored in the non-volatile memory 12 of the control unit 10 to the communication unit 30 via wireless communication. In addition, the control center 200 may have a function for generating an update program. The control center 200 may also be referred to as an institution that can distribute update programs, such as dealers. The update program is a program for updating the program stored in the non-volatile memory 12. The update program includes the latest program, the difference between the latest program and the program stored in the non-volatile memory 12, and the like. The communication unit 30 transmits the update program received from the control center 200 to the gateway 20. The program stored in the non-volatile memory 12 (as an update target to be updated) may include data such as fixed values and variable initial values. The engine 40 is a power source of the vehicle 100. When the engine 40 is running, the alternator 50 generates electrical energy, or electric power, by utilizing the power of the engine 40. The battery 60 receives (or is supplied with) the electrical energy (which may be referred to as second electrical energy) from the alternator 50, stores the received electrical energy, and supplies electrical energy (which may be referred to as first electrical energy) to each device such as the control unit 10, the gateway 20, and the communication unit 30. In the vehicle 100, the electrical energy generated by the alternator 50 can be stored in the battery 60. The vehicle 100 can thus charge the battery 60 with the power of the engine 40. Therefore, when the engine 40 is in a stopped state, power supply to the battery 60 is not performed in the vehicle 100.In other words, the state in which no electrical energy is supplied to the battery 60 indicates the stop or halt state of the motor 40. The ignition switch 70 is operated by the driver of the vehicle 100 from ON to OFF or from OFF to ON. The ignition switch 70 is connected to the control unit 10 via a signal line. Therefore, a signal indicating that the ignition switch 70 is turned on and a signal indicating that the ignition switch 70 is turned off are supplied to the control unit 10. That is, the control unit 10 can detect the switching from ON to OFF and the switching from OFF to ON in the ignition switch 70. The gateway 20 includes a storage unit 21, an operation processing unit, and the like. The gateway 20 is powered by electrical energy from the battery 60. Upon receiving an update program sent from the communication unit 30, the gateway 20 stores the update program in the storage unit 21. The gateway 20 is connected to the control unit 10 via a signal line. Specifically, the gateway 20 may be connected to at least one control unit 10 for communication therewith, and may be connected to a plurality of control units 10. Furthermore, the present embodiment uses the gateway 20 with the function of determining whether the electric power is supplied to the battery 60. Before transmitting a program reprogramming request to the control unit 10, the gateway 20 performs a battery electric power reception state determination to determine whether or not the electric power is supplied to the battery 60 (that is, whether the battery 60 is in an electric power reception state or an electric power non-reception state) based on the information obtained by communicating with each control unit 10.For example, the gateway 20 determines whether or not the battery is receiving electric power based on the information obtained by communicating with another control unit 10 mounted in the vehicle 100 and different from the control unit 10 shown in FIG. 1. The other control unit 10, which is different from the control unit 10 shown in FIG. 1, may be referred to as a control unit that is not a target of program reprogramming. Furthermore, for example, in the case where the vehicle 100 is a motor vehicle, the gateway 20 communicates with an engine control unit, which is one of the control units 10, and performs the determination of the battery electric power receiving state by receiving the state information about whether the engine is in an engine running state or an engine stop state from the engine control unit. In this case, when the gateway 20 receives the state information indicating the engine running state, it positively determines the battery electric power receiving state (i.e., determines that the battery 60 is being supplied with electric power), and when the gateway 20 receives the state information indicating the engine stop state, it negatively determines the battery electric power receiving state (i.e.,determines that the electrical energy is not supplied to the battery 60). Incidentally, a battery 60 being in the state of receiving electric power from the battery means that the battery 60 is in a battery charge state in which the battery 60 is being charged. On the other hand, a state of not receiving electric power from the battery 60 means that the battery 60 is in the battery non-charge state in which the battery 60 is not being charged. The gateway 20 communicates with the control unit 10 (as a reprogramming target) whose program is to be reprogrammed, for example, at a predetermined timing to reprogram the program in the control unit 10. Subsequently, the gateway 20 sends to the control unit 10 as a reprogrammed target information such as a program reprogramming request, an update program, the battery electric power reception state or the battery electric power non-reception state related to the power supply to the battery 60, and the like. The following description may simply refer to a program reprogramming start request as a reprogramming request. The control unit 10 is an electronic control unit (ECU). The control unit 10 includes at least one processing unit (CPU) and at least one memory device (MMR) as a storage medium for storing programs and data. The control unit 10 is provided by a microcomputer including a computer-readable storage medium. The storage medium non-temporarily stores a computer-readable program. That is, the storage medium corresponds to a non-volatile computer-readable storage medium. The storage medium may be provided by a semiconductor memory, a magnetic disk, or the like. Furthermore, the control unit 10 may include a storage medium that temporarily stores data and the like. The control unit 10 may be provided by a computer or a computing resource connected by a data communication device. The program is executed by the control unit 10 so that the control unit 10 operates as the device described in this specification; the program causes the control unit 10 to operate to perform the method described in this specification. The control unit 10 provides various elements or sections. At least some of these elements may be referred to as a means for performing a function; in another aspect, at least some of these elements may be referred to as a constituent block or module. Specifically, the control unit 10 includes a microcomputer 11 having a CPU, a non-volatile memory 12 and a volatile memory 13 included in the storage device, a communication circuit 14, and an electric power supply circuit 15. The control unit 10 can receive an update program distributed from the control center 200 via wireless communication and reprogram the program stored in the non-volatile memory 12 to the update program. The microcomputer 11 operates using the electrical power from the electrical power supply circuit 15, which will be described later. Furthermore, the microcomputer 11 reprograms (i.e., rewrites) the program stored in the nonvolatile memory 12 to the update program transmitted from the control center 200. Generally, when reprogramming previously stored data to other data in a nonvolatile memory typed by a flash memory, it is necessary to erase an area as a reprogramming target to be reprogrammed in advance. That is, the microcomputer 11 reprograms the program by erasing (or removing) the program stored in the nonvolatile memory 12 and then programming the update program transmitted from the control center 200 into the nonvolatile memory 12 to the update program.Note that, in the non-volatile memory, for example, a ferroelectric memory (FRAM, registered trademark) has also been proposed, which does not require pre-erasing an area as a reprogrammed target at the time of reprogramming. In the microcomputer 11 including such a non-volatile memory 12, the step of erasing the program stored in the non-volatile memory 12 can be omitted. The following example describes a configuration and operation of the microcomputer 11 equipped with a non-volatile memory that requires pre-erasing the area as a reprogrammed target at the time of reprogramming. However, the invention is not limited to this. In addition, the control unit 10 controls an in-vehicle device mounted in the vehicle 100 through the microcomputer 11 executing the program. The non-volatile memory 12 stores a program executed by the microcomputer 11. This program is, for example, a control program for the control unit 10 for controlling an in-vehicle device. However, the program of the invention is not limited to this. As shown in Fig. 2, the non-volatile memory 12 includes a controller 12a and a plurality of memory cell arrays 12b. Furthermore, each memory cell array 12b includes a plurality of memory cells 12c. That is, the non-volatile memory 12 stores a program in each memory cell 12c. The controller 12a reads the data stored in each memory cell 12c, erases the data stored in each memory cell 12c, and programs (i.e., writes) data to each memory cell 12c. When programming each memory cell array 12b, the controller 12a applies a program pulse to the memory cell array 12b (memory cell 12c) as a programmed target according to the input program data and the specified program voltage, and performs verification on the same memory cell array 12b. Verification is a process for confirming whether or not the threshold voltage Vth of the memory cell 12c as the programmed target to be programmed exceeds a desired voltage. In particular, the control device 12a of the invention can accept at least two values as programming voltages. That is, the control device 12a can use a first programming voltage and a second programming voltage higher than the first programming voltage as programming voltages. Furthermore, the second programming voltage is a voltage sufficient to adequately ensure the storage period of the program stored in the non-volatile memory 12. Furthermore, the present embodiment uses the control device 12a, which can use a third programming voltage as the programming voltage. The third programming voltage can be used as long as it can sufficiently secure the storage period of the program stored in the non-volatile memory 12, for example, a value equal to the second programming voltage or a value greater than the second programming voltage. Therefore, the first programming voltage is lower than the second programming voltage, but also lower than the third programming voltage. When programming into the nonvolatile memory 12, in order to ensure the retention period (reliability) of the programmed data, the programming voltage at the memory cell 12c is set to a voltage higher, with a safety margin, than the minimum threshold voltage Vth required for reading the programmed data. Therefore, it is preferable that each of the second programming voltage and the third programming voltage be higher, with a safety margin, than the minimum threshold voltage Vth. The data here is an update program or the like. Note that the controller 12a performs reading, erasing, and programming, for example, in response to an instruction from the CPU of the microcomputer 11. The volatile memory 13 temporarily stores the results calculated by the microcomputer 11 and the like. The communication circuit 14 is a circuit for communicating with the gateway 20. The power supply circuit 15 converts the electrical energy supplied by the battery 60 into a voltage usable by the microcomputer 11 and supplies the voltage to the microcomputer 11. It is noted that a device and / or a function provided by the control unit 10 may be provided with a computer together with a tangible memory storing software executed by the computer, or with software alone, or with hardware alone, or a combination of the above. For example, consider cases where the control unit 10 may be equipped with an electronic circuit serving as hardware; such an electronic circuit may be equipped with analog circuits and / or digital circuits including multiple logic circuits. Next, a processing operation by the in-vehicle device will be described with reference to FIGS. 3 to 10. First, the processing operation by the gateway 20 will be described with reference to FIG. 3. In response to receiving a reprogramming request from the center 200 via the communication unit 30, the gateway 20 begins a process shown in the flowchart of FIG. 3. In step S10, an update program is received from the central unit 200. The gateway 20 receives the update program transmitted from the central unit 200 via the communication unit 30. In step S11, the update program is stored in the storage unit 21. The gateway 20 stores the received update program in the storage unit 21. In step S12, it is determined whether the storage of the update program is complete. That is, the gateway 20 determines whether the storage of the received update program in the storage unit 21 is complete. If it is determined that the storage of the update program is complete, the process proceeds to step S13; if not, the process returns to step S10. In step S13, it is determined whether or not the battery 60 is being supplied with electric power (i.e., a determination of the battery electric power reception state is performed). That is, the gateway 20 makes a determination of the battery electric power reception state as to whether the battery 60 is being supplied with electric power (i.e., whether the battery 60 is in a battery electric power reception state or a battery electric power non-reception state). If it is determined that the battery 60 is being supplied with electric power, the process proceeds to step S14. If it is determined that the battery 60 is not being supplied with electric power, the process proceeds to step S15. At this time, the gateway 20 determines whether or not the battery 60 is being supplied with electric power based on the information from the control unit 10 mounted in the vehicle 100. Such a configuration allows the in-vehicle device (gateway 20) to perform the above determination of the battery's electric power reception state without the need for a circuit that determines whether the battery 60 is being supplied with electric power. While not necessarily limited to this, the invention may also employ the gateway 20 with a circuit that determines whether the battery 60 is being supplied with electric power. In step S14, a third reprogramming request is sent to the target control unit 10. That is, the gateway 20 sends a third reprogramming request as a start request to the target control unit 10. The third reprogramming request is a request indicating reprogramming of a program in the third programming mode. In the third programming mode, programming is performed on the programmed target memory cell array 12b with a programming voltage set to a third programming voltage. Note that the target control unit 10 is the control unit 10 with a program to be reprogrammed into an update program. In step S15, a first reprogramming request is sent to the target control unit 10. The gateway 20 sends the first reprogramming request as a start request to the target control unit 10. The first reprogramming request is a request indicating reprogramming of the program in the first programming mode. In the first programming mode, programming is performed on the memory cell array 12b with a programming voltage set to a first programming voltage. When the start request (the first reprogramming request or the third reprogramming request) is transmitted, the gateway 20 begins measuring an elapsed time since the transmission. For example, when the vehicle 100 is parked or the like, the gateway 20 sends a first reprogramming request. In step S16, it is determined whether a reprogramming permission response is issued. The gateway 20 determines whether a reprogramming permission response is issued from the control unit 10 to which the gateway 20 sent the start request. If it is determined that a reprogramming permission response is issued, the process proceeds to step S17. If it is determined that a reprogramming permission response is not issued, the process proceeds to step S18. The reprogramming permission response is a response indicating that reprogramming can be started. That is, if a reprogramming permission response is issued, the gateway 20 determines that the control unit 10 is in the state where the control unit 10 can start reprogramming a program and proceeds to step S17.If no reprogramming permission response is issued, the gateway 20 determines that the control unit 10 is not in the state in which the control unit 10 can start reprogramming a program, and proceeds to step S18. In step S17, an update program is transmitted to the target control unit 10. The gateway 20 transmits the update program stored in the memory 21 to the control unit 10. In step S18, it is determined whether the timeout period has elapsed or not. The gateway 20 determines whether the timeout period has elapsed since the start request was sent. If it is determined that the timeout period has not elapsed, the gateway 20 returns to step S16. That is, the gateway 20 continues to wait for a reprogramming permission response until the timeout period has elapsed since the start request was sent. In contrast, if it is determined that the timeout period has elapsed, the gateway 20 proceeds to step S19. That is, the gateway 20 determines that the control unit 10 is in the state where program reprogramming is impossible and proceeds to step S19. Note that the timeout period may be a predetermined value. The timeout period may be a predetermined period of time within which a reprogramming permission response can be received after a start request is sent in a normal case (i.e., in the state where no abnormality occurs), or a period of time longer than the predetermined period by a certain amount. In step S19, the update program is deleted from the storage unit 21. The gateway 20 removes (i.e., deletes) the update program in the storage unit 21 if it has transmitted the update program to the target control unit 10 or if the target control unit 10 is in a state where reprogramming of a program is not possible. Thus, if the timeout period has elapsed since the transmission of the start request, the in-vehicle device terminates without reprogramming or reprogramming the program. Furthermore, after the gateway 20 transmits the start request, the state of the electrical power supplied to the battery 60 in the vehicle 100 may be switched. Therefore, the gateway 20 may execute step S13 again before transmitting the update program in step S17. In this case, the gateway 20 changes the start request by determining whether the battery 60 is supplied with electrical power. In other words, if the gateway 20 sends the first reprogramming request in step S15 but determines in step S17 that the battery 60 is supplied with electrical power before the update program is transmitted, the gateway 20 sends the third reprogramming request as a start request. Conversely, if the gateway 20 sends the third reprogramming request in step S14 but determines in step S17 that the battery 60 is not supplied with electrical power before the update program is transmitted, the gateway 20 sends the first reprogramming request as a start request. This configuration allows the start request transmitted to the control unit 10 to precisely match the state of the electric power supplied to the battery 60. That is, when programming (i.e., writing) the update program with the programming voltage as the third programming voltage, the in-vehicle device can program the update program under the state where electric power is reliably supplied to the battery 60. However, the invention is not limited to this. With reference to Fig. 4, the following describes the processing operation by the control unit 10, that is, the processing operation of the control unit 10 as a reprogrammed target in which the reprogramming of a program is performed. Upon receiving the start request sent from the gateway 20, the control unit 10 begins the process shown in the flowchart of Fig. 4. In step S20, it is determined whether the program is in a reprogrammable state or not. For example, when the non-volatile memory 12 is used for processing as a reprogrammed target to be reprogrammed, the control unit 10 determines that the program is not in a reprogrammable state. On the other hand, for example, when the non-volatile memory 12 is not used as a reprogrammed target to be reprogrammed, the control unit 10 determines that the program is in a reprogrammable state. If the control unit 10 determines that the program is in a reprogrammable state, the process proceeds to step S21. If it is determined that the program cannot be reprogrammed, the process of Fig. 4 ends. In step S21, a reprogramming permission response is output and sent to the gateway 20. The control unit 10 sends a reprogramming permission response to the gateway 20, thereby requesting the transmission of the update program. In step S22, it is determined whether the reprogramming request is the first reprogramming request or not. The control unit 10 determines whether the reprogramming request is the first reprogramming request or not to determine whether the program is to be reprogrammed in the first programming mode or the program is to be reprogrammed in the third programming mode. If the control unit 10 determines that the reprogramming request is the first reprogramming request, the process proceeds to step S23. If it is not determined that the reprogramming request is the first reprogramming request, the process proceeds to step S24. In step S23, the program is reprogrammed or reprogrammed in the first programming mode (i.e., by a first reprogramming section). The control unit 10 reprograms the program stored in the non-volatile memory 12 by programming the update program or the like with the programming voltage as the first programming voltage. That is, when a request to reprogram the update program is received from the control center 200 and electric power is not supplied to the battery 60, the control unit 10 programs the update program with the programming voltage as the first programming voltage. In contrast, in step S24, the program is reprogrammed in the third programming mode (i.e., by a third reprogramming section). The control unit 10 reprograms the program stored in the non-volatile memory 12 by programming (i.e., writing) the update program or the like with the programming voltage as the third programming voltage. That is, when a request to reprogram the update program is received from the control center 200 and the electric power is supplied to the battery 60, the control unit 10 programs the update program with the programming voltage as the first programming voltage. As described above, the first programming voltage is lower than the third programming voltage. When the electric power is not supplied to the battery 60, the control unit 10 programs (ie, writes) the update program into the nonvolatile memory 12 with the programming voltage set to the low voltage, compared to the case where the electric power is supplied to the battery 60, thereby reprogramming the program to the update program. The processing in the first programming mode and the third programming mode will be described in detail later. In step S25, the programming mode is saved. The control unit 10 stores an executed programming mode in the non-volatile memory 12 to determine whether or not the program is to be reprogrammed in the second programming mode. Next, the reprogramming processing at the time of turning off the control unit 10 will be described with reference to Fig. 5. When the ignition switch 70 is turned from ON to OFF, the control unit 10 starts a process in Fig. 5. That is, Fig. 5 is a flowchart showing the reprogramming processing at the time of turning off the control unit 10. When the ignition switch 70 is turned on, the alternator 50 generates the electric power using the power of the engine 40, and the battery 60 receives the electric power from the alternator 50. Therefore, when the ignition switch 70 is turned from ON to OFF, the battery 60 can be regarded as being under a state after the electric power is supplied. In step S30, it is determined whether the previous programming mode was the first programming mode. The control unit 10 checks the non-volatile memory 12 and determines whether the previous programming mode was the first programming mode. If the control unit 10 determines that the previous programming mode is the first programming mode, the process proceeds to step S31. If the control unit 10 does not determine that the previous programming mode was the first programming mode, the process of Fig. 5 ends. In step S31, the program is reprogrammed in the second programming mode (second reprogramming section). The control unit 10 reprograms the program stored in the non-volatile memory 12 by programming the update program with the programming voltage as the second programming voltage. The second programming mode is a mode in which programming is performed on the memory cell array 12b as a programmed target to be programmed, with the programming voltage as the second programming voltage. In other words, the control unit 10 programs the update program during a period from the time the ignition switch 70 is turned off after the electric power is supplied to the battery 60 until the electric power supplied from the battery 60 to the in-vehicle device stops. This allows the in-vehicle device to reprogram the program when the control unit 10 is not executing the program in the non-volatile memory 12. This is preferable, for example, when the target control unit 10 controls the engine 40. Furthermore, as described above, the second programming voltage is higher than the first programming voltage. Therefore, in cases where the reprogramming to the update program is performed in the first programming mode after the electric power is supplied to the battery 60, the control unit 10 programs the same update program as in the first programming mode into the nonvolatile memory 12 with the second programming voltage, thus performing the reprogramming of the update program. In this way, the control unit 10 performs the reprogramming in the second programming mode only when the electric power is supplied to the battery 60 and the preceding program reprogramming is performed in the first programming mode. When programming the update program in the second programming mode, the control unit 10 preferably programs the update program into the same area in the non-volatile memory 12 as the area into which the update program is programmed in the first programming mode. This allows the control unit 10 to suppress an increase in the area into which the program is programmed in the non-volatile memory 12. However, the invention is not limited to this. In the second programming mode, the update program can be programmed into an area in the non-volatile memory 12 that is different from the area in which the update program is programmed in the first programming mode. This also makes it possible to achieve the purpose of suppressing battery power consumption while ensuring the program's storage life. As described above, in the second programming mode, the control unit 10 performs the program reprogramming with a trigger (trigger command) indicating that electric power is supplied to the battery 60 after the first programming mode is performed, instead of a trigger indicating that a request is issued from the gateway 20. As examples of this, the present embodiment uses a first exemplary case in which programming is performed in the second programming mode in response to the ignition switch 70 being turned from ON to OFF. However, the invention is not limited thereto. The present embodiment may employ a second exemplary case in which the control unit 10 programs an update program in the second programming mode during a period during which electric power is supplied to the battery after the first programming mode is performed (ie, by the second reprogramming section). The second example case, which performs programming under the condition where the electric power is continuously supplied to the battery 60 (i.e., supplied), enables the control unit 10 to prevent the battery 60 from running dry, compared with the case that performs programming under the condition where the electric power supplied to the battery 60 is stopped after the electric power is supplied to the battery 60. That is, the control unit 10 can suppress the battery 60 from running dry in the second example, compared with the case of programming the update program with a high voltage under the condition where the electric power is not supplied to the battery 60.The second exemplary case is suitable, for example, when the target control unit 10 is installed in an electric vehicle or when the motor 40 is capable of reprogramming the program during engine operation. Next, the processing operation of the control unit 10 in the first programming mode will be described with reference to FIG. 6. If YES is determined in step S22, the control unit 10 begins a process shown in the flowchart of FIG. 6. In other words, when the first reprogramming request sent from the gateway 20 is received, since it is determined that the electric power is not being supplied to the battery 60, the control unit 10 begins the process shown in the flowchart of FIG. 6. In step S40, the programming voltage is set to a first programming voltage. The controller 12a sets the programming voltage to the first programming voltage to program the update program in the first programming mode. In step S41, the program of the memory cell array 12b is erased as a programmed target. Since the non-volatile memory 12, such as a flash memory, can only program from 1 to 0, it is generally necessary to erase data that has been stored once before programming. Therefore, the controller 12a erases the program of the memory cell array 12b as a programmed target before programming the update program. In step S42, the update program is input to the controller 12a as program data. For example, the CPU of the microcomputer 11 inputs the update program received via the communication circuit 14 to the controller 12a. In step S43, a pulse corresponding to the program data is applied to the memory cell 12c. When programming into each memory cell array 12b, the controller 12a applies the specified programming voltage in accordance with the input program data and the specified programming voltage when programming the data into the memory cell array 12b (memory cell 12c) as a programmed destination. In step S44, it is determined whether the threshold voltage Vth of the memory cell 12c exceeds a target value (i.e., verification is performed). If it is not determined that the threshold voltage Vth of the memory cell 12c exceeds the target value, the controller 12a determines that the programming of the program data is not completed and returns to step S43. If it is determined that the threshold voltage Vth of the memory cell 12c exceeds the target value, the controller 12a considers that the programming of the program data is completed and ends the processing of Fig. 6. In this way, the controller 12a programs the program data into the memory cell array 12b by repeatedly applying the programming and verification pulse and gradually approximating it to the desired threshold voltage Vth. Therefore, the in-vehicle device of the invention can reprogram the program stored in the non-volatile memory 12 with an update program even when the vehicle 100 is parked. Next, the processing operation of the control unit 10 in the second programming mode will be described with reference to Fig. 7. If YES is determined in step S30, the control unit 10 begins the process shown in the flowchart of Fig. 7. In step S50, the programming voltage is set to a second programming voltage. The controller 12a sets the programming voltage to the second programming voltage to program the update program in the second programming mode. In step S51, the update program of the memory cell array 12b is stored as a programmed destination in the volatile memory 13. For example, the CPU of the microcomputer 11 programs an update program for the memory cell array 12b as a programmed destination to the volatile memory to reprogram the update program programmed in the first programming mode into the nonvolatile memory by setting the programming voltage to the higher voltage. When this update program is programmed into the nonvolatile memory 12 in steps S53 and S54, it is not necessary to store the update program in the volatile memory 13. Therefore, it can be said that the CPU of the microcomputer 11 temporarily stores the update program in the volatile memory 13. In step S52, the update program is input to the controller 12a as program data. For example, the CPU of the microcomputer 11 inputs the update data stored in the volatile memory 13 to the controller 12a as program data. Since steps S53 and S54 are identical to steps S43 and S44, reference can be made to steps S43 and S44. As described above, the second programming mode is started under the state where the update program has already been programmed into the non-volatile memory 12. Therefore, the controller 12a reprograms the same program data by changing the programming voltage. When programming is performed in the first programming mode, the distribution of the threshold voltage Vth of the memory cell 12c is as shown in Fig. 9. In contrast, when programming in the second programming mode, the distribution of the threshold voltage Vth of the memory cell 12c is as shown in Fig. 10. In Fig. 10, the distribution of the threshold voltage Vth in the first programming mode is shown by a broken line to compare the threshold voltage Vth in the first programming mode with the threshold voltage Vth in the second programming mode. Next, the processing operation of the control unit 10 in the third programming mode will be described with reference to FIG. 8. If NO is determined in step S22, the control unit 10 starts the processing shown in the flowchart of FIG. 8. That is, when the third reprogramming request sent from the gateway 20 is received, since it is determined that the electric power is being supplied to the battery 60, the control unit 10 starts the process shown in the flowchart of FIG. 8. In step S60, the programming voltage is set to a third programming voltage. The controller 12a sets the programming voltage to the third programming voltage to program the update program in the third programming mode. Since steps S61 to S64 are identical to steps S41 to S44, reference can be made to steps S41 to S44. As described above, in the in-vehicle device according to the invention, when the program is reprogrammed to the update program under the condition that the electric power is supplied to the battery 60, the third programming voltage is adopted as the programming voltage. That is, in the in-vehicle device according to the invention, in a situation where the possibility of battery discharge is low, the update program is programmed into the non-volatile memory 12 with the programming voltage as the third programming voltage. Thus, it is possible to sufficiently secure the storage period of the program in the non-volatile memory 12. The reprogramming of the program in the third programming mode can be referred to as reprogramming in a normal state. As described above, when there is a request to reprogram the update program and no power is supplied to the battery 60, the in-vehicle device sets the programming voltage to the first programming voltage (i.e., lower than the second programming voltage) and programs the update program into the non-volatile memory. Therefore, when no power is supplied to the battery 60, the in-vehicle device can suppress the power consumption of the battery 60 by reprograming the program. Therefore, even if the vehicle 100 is left after reprograming the program, the in-vehicle device can suppress the battery from draining. However, when the update program is programmed with the first programming voltage, the in-vehicle device has a shorter retention time of the programmed update program than when programmed with the second programming voltage or the third programming voltage. Therefore, according to the present invention, in cases where the program reprogramming is performed with the first programming voltage after supplying the electric power to the battery 60, the same update program as the update program programmed with the first programming voltage is programmed into the nonvolatile memory 12 with the second programming voltage. That is, after the battery 60 is charged, the in-vehicle device again programs the same update program to reach the threshold voltage Vth, which is typical after programming of 0 (zero). This makes it possible to ensure the retention period of the update program in the in-vehicle device. That is, the in-vehicle device can ensure the retention period of the program, which is the programmed update program, stored in the nonvolatile memory 12.In this way, the in-vehicle device can suppress battery consumption while ensuring the program's endurance. Furthermore, when programming the programming voltage as the second programming voltage, the in-vehicle device is in the state where the battery 60 is supplied with electric power. Therefore, even if the power of the battery 60 is consumed by programming, the probability of battery discharge can be reduced. The present embodiment uses an exemplary case in which, when there is a reprogramming request to an update program from the control center 200 under the condition in which electric power is not supplied to the battery 60, the update program is programmed into the non-volatile memory 12 with the programming voltage as the first programming voltage. However, the invention is not limited to this. In the in-vehicle device, another exemplary case may be used in which, when there is a reprogramming request from the control center 200 to the update program under the condition in which electric power is not supplied to the battery 60, and at the same time, the vehicle 100 is parked (ie,during a parked state), the update voltage is set to the first programming voltage and the update program is executed to be programmed into the non-volatile memory 12 (ie, by the first reprogramming section). Some vehicles 100 have a function of shutting down the engine while waiting for a traffic light signal to reduce fuel consumption and exhaust emissions. In this case, the vehicle 100 restarts the engine 40 from a signal-waiting state due to a traffic light signal change, and the driver thereby performs a starting operation. In this way, the vehicle 100 restarts the engine 40 in a relatively short time. As described above, when the engine 40 is stopped, the power supply to the battery 60 is interrupted. However, the engine 40 is restarted in a relatively short time. Therefore, the power supply to the battery 60 is restarted in a relatively short time. In the state where the electric power is simply not supplied to the battery 60, the update program is programmed with the first programming voltage even if the electric power supply to the battery 60 is resumed relatively soon after programming the update program with the first programming voltage. That is, the control unit 10 sets the programming voltage to the first programming voltage even if the possibility of battery discharge is small. In contrast, when the electric power is not supplied to the battery and the vehicle 100 is in a parked state, the control unit 10 sets the programming voltage to the first programming voltage, thus preventing the battery from becoming depleted under the battery-depletion condition. Note that the control unit 10 may determine whether the vehicle is in a parked state or not based on a signal from the ignition switch 70 or another control unit. For example, the control unit 10 determines that the vehicle 100 is in a parked state when the ignition switch 70 is turned off or the gear is engaged in a parking range, or the like. A preferred embodiment of the invention has been described above. However, the invention is not limited to the above-described embodiment, and various modifications are possible within the scope of the invention without departing from the spirit of the invention. A first modified example and a second modified example are described below as further embodiments of the invention. (First modified example) First, the in-vehicle device in a first modified example will be described with reference to Fig. 11. In this modified example, since there are several parts similar to those in the above embodiment, differences from the above embodiment will be mainly described. The in-vehicle device of the first modified example differs mainly in the processing operation of the control unit 10. In this modified example, the same reference numerals as in the above embodiment are used for the sake of clarity. Also, in Fig. 11, the same step symbols as in Fig. 4 are used regarding the same processing as in Fig. 4. As described above, after the gateway 20 sends the start request, the power supply state of the battery 60 in the vehicle 100 can be switched. Therefore, if the reprogramming request is not determined as the first reprogramming request in step S22, the control unit 10 proceeds to step S26. In step S26, similar to the determination made by the gateway 20 in step S13, it is determined whether the electric power is being supplied to the battery 60 (i.e., by a determination section). Similar to the gateway 20, the control unit 10 determines whether the electric power is being supplied to the battery 60. If it is determined that the electric power is being supplied to the battery 60, the process proceeds to step S24. If it is determined that the electric power is not being supplied to the battery 60, the process proceeds to step S25. That is, when programming the update program in step S24, the control unit 10 determines whether the electric power is being supplied to the battery 60 before programming the update program. If it is determined that the electric power is being supplied to the battery 60, the programming of the update program is permitted in step S24. In contrast, when executing the update program programming in step S24, if the control unit 10 determines that the electric power is not being supplied to the battery 60 before programming the update program, even if the third reprogramming request has been received, the process proceeds to step S23.That is, even if the third reprogramming request has been received, if the electric power is not supplied to the battery 60 at the time of programming the update program, the control unit 10 switches the programming mode from the third programming mode to the first programming mode, thereby performing the program reprogramming. Note that, here, the case where the update program is programmed in step S24 is a case where a determination of NO is made in step S22, that is, a case where the third reprogramming request is received. As a result, when programming the update program with the programming voltage as the third programming voltage, the in-vehicle device can program the update program in a state where electric power is reliably supplied to the battery 60. Of course, the in-vehicle device of the first modified example can achieve the same effect as the above-described embodiment. (Second modified example) First, an in-vehicle device according to a second modified example will be described with reference to FIG. 12. In this modified example, since there are several parts similar to those in the above embodiment, differences from the above embodiment will be mainly described. The in-vehicle device of the second modified example differs mainly in an assembly vehicle 100a. That is, the in-vehicle device of this modified example is mounted on a vehicle 100a that is an electric vehicle. In FIG. 12, constituent parts with the same reference numerals as in FIG. 1 are the same as those in FIG. 1. The vehicle 100a is configured to be electrically connected to an external battery charger 300 provided in a home, at a dealership, at a charging station, or the like. The vehicle 100a further includes an on-board battery charger 80 electrically connected to the external battery charger 300. The on-board battery charger 80 supplies electrical energy to the battery 60, thereby charging the battery 60. The in-vehicle device of this modified example includes a control unit 10 and a gateway 20a. The control unit 10 is the same as the one in the previous embodiment. However, unlike the gateway 20, the gateway 20a determines whether or not electric power is being supplied to the battery 60 based on a signal from the in-vehicle battery charger 80. The in-vehicle device of the second modified example configured as described above can achieve the same effect as that of the above-described embodiment. That is, even when the in-vehicle device is mounted in an electric vehicle, it is possible to achieve the same effect as the above-described embodiment.
Claims
An in-vehicle device operated by supplying first electric power from a battery (60), the in-vehicle device including a non-volatile memory (12) storing a program and performing reprogramming of the program to an update program transmitted from an external device (200) provided outside a vehicle, the in-vehicle device comprising: a first reprogramming section (10) for performing first reprogramming to a first update program under a state in which the battery (60) is not supplied with second electric power (S23) in response to receiving a request for reprogramming to the first update program from the external device (200),wherein the first reprogramming section (10) performs the first reprogramming by programming the first update program into the non-volatile memory (12) with a first programming voltage, and the first programming voltage is lower than a programming voltage under a state in which the battery (60) is supplied with the second electrical power; and a second reprogramming section (10) for performing a second reprogramming to the first update program after the battery (60) is supplied with the second electrical power (S31), in response to the first reprogramming section (10) completing the first reprogramming to the first update program under the state in which the battery (60) is not supplied with the second electrical power, wherein the second reprogramming section (10) performs the second reprogramming by programming the first update program,which is identical to the first update program in the first reprogramming section (10), into the non-volatile memory (12) with a second programming voltage, and the second programming voltage is higher than the first programming voltage with which the first reprogramming is carried out by the first reprogramming section (10). The in-vehicle device according to claim 1, wherein the first reprogramming section (10) performs the first reprogramming to the first update program in response to receiving the request for reprogramming to the first update program from the external device (200) under (i) the state in which the battery (60) is not supplied with second electric power and, at the same time, (ii) a vehicle parking state in which the vehicle is parked, by programming the first update program into the non-volatile memory (12) with the first programming voltage lower than the programming voltage under the state in which the battery (60) is supplied with second electric power. The in-vehicle device according to claim 1 or claim 2, wherein the second reprogramming section (10) performs the second reprogramming to the first update program by programming the first update program on a second area of the non-volatile memory (12), the second area being identical to a first area of the non-volatile memory (12), the first area on which the first update program is programmed in the first reprogramming performed by the first reprogramming section (10). The in-vehicle device according to any one of claims 1 to 3, wherein the second reprogramming section (10) performs the second reprogramming to the first update program within a period in which the battery (60) is supplied with the second electric power. The in-vehicle device according to any one of claims 1 to 3, wherein the second reprogramming section (10) performs the second reprogramming to the first update program within a period of time from a first time point when an ignition switch of the vehicle is turned off after the battery (60) is supplied with the second electric power to a second time point when the first electric power supplied to the in-vehicle device is stopped. An in-vehicle device according to any one of claims 1 to 5, wherein whether or not the battery (60) is supplied with the second electric power is determined based on information from a control unit mounted in the vehicle, the control unit being different from the in-vehicle device. The in-vehicle device according to any one of claims 1 to 6, further comprising: a third reprogramming section (10) for performing a third reprogramming to the first update program under the state in which the battery (60) is supplied with the second electric power (S24) in response to receiving a request for reprogramming to the first update program from the external device (200), wherein the third reprogramming section (10) performs the third reprogramming by programming the first update program into the non-volatile memory (12) with a third programming voltage, and the third programming voltage is higher than the first programming voltage with which the first reprogramming is performed by the first reprogramming section (10);anda determination section (10) for re-determining whether the battery (60) is supplied with the second electric power before the third reprogramming section (10) performs the third reprogramming to the first update program (S26), and allowing the third reprogramming section (10) to perform the third reprogramming to the first update program in response to determining that the battery (60) is supplied with the second electric power.;
Citation Information
Patent Citations
Vehicle update system and method thereof
DE102011088320A1
Non-volatile semiconductor storage device
JP2000076878A
Method and apparatus for programming data into non-volatile memory
DE102010045581A1
DE102020045581A1
