How to reprogram an in-vehicle network system
By managing communication speed transitions during reprogramming, the system ensures seamless software updates for multiple microcontrollers in an in-vehicle network, addressing the issue of speed discrepancies that cause errors in existing methods.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- ASTEMO LTD
- Filing Date
- 2022-03-10
- Publication Date
- 2026-04-23
AI Technical Summary
In in-vehicle network systems with multiple microcontrollers connected via a CAN bus, reprogramming initial programs at different communication speeds can lead to communication failures and errors, particularly when transitioning from a faster initial speed to a slower update speed, disrupting the reprogramming process.
The system manages reprogramming by initially setting the communication speed for the first microcontroller to a faster rate, completing its program update, then updating the remaining microcontrollers at the same speed, and finally changing the communication speed for all to a slower rate after all updates are complete, ensuring consistent communication settings throughout the process.
This method allows smooth reprogramming of multiple microcontrollers without speed changes during the process, preventing communication failures and ensuring successful software updates in the in-vehicle network system.
Smart Images

Figure 0007850573000001 
Figure 0007850573000002 
Figure 0007850573000003
Abstract
Description
Technical Field
[0001] The present invention relates to an in-vehicle network system including a plurality of electronic control units connected by a CAN (Controller Area Network) bus, and more particularly to an in-vehicle network system including an electronic control unit in which a software program is updated (reprogrammed), and a reprogramming method therefor.
Background Art
[0002] As an in-vehicle network system for controlling a power train system or a body system in a recent automobile, a method of performing communication using a CAN bus is known. The in-vehicle network system using this CAN communication is configured such that necessary data can be mutually exchanged by connecting a plurality of electronic control units to the CAN bus.
[0003] Each electronic control unit in the in-vehicle network system using CAN communication is connected to the CAN bus as a control node. And each control node connected to the CAN bus needs to communicate at the same communication speed (same bit rate or same baud rate).
[0004] If the communication speeds of the control nodes are different from each other, a staff error or misrecognition of data occurs, and a phenomenon in which communication fails occurs. Therefore, control nodes connected to the same CAN bus need to communicate at the same communication speed.
[0005] The microcontroller mounted on the control node connected to the in-vehicle network is mainly composed of a microcomputer. And this microcomputer executes arithmetic processing and the like by a software program, and this software program is configured to be rewritten by a method called reprogramming. For this reason, the software program is stored in a rewritable non-volatile memory such as a flash ROM.
[0006] By the way, this reprogramming can occur in two ways: when the software program is first written in the factory during the manufacturing of the control node (electronic control unit) (hereinafter referred to as the initial program), or when the software program is written outside the factory for reasons such as version upgrades (hereinafter referred to as the update program).
[0007] Furthermore, when reprogramming the update program, it is configured to perform the reprogramming at a unified communication speed that matches each control node connected to the in-vehicle network system. For example, a communication speed of 500Kbps baud rate can be used.
[0008] On the other hand, when reprogramming an initial program, it is effective to perform the reprogramming at a faster communication speed than that used for reprogramming update programs, taking into account productivity and production costs. For example, reprogramming at a baud rate of 1 Mbps allows for faster writing speeds compared to 500 Kbps, thus improving productivity and production costs.
[0009] However, if the initial program's communication speed is set to the update program's communication speed (500Kbps), attempting to reprogram from the program rewriting device at a faster communication speed may result in a mix of communication speeds on the CAN bus, potentially causing the aforementioned staff error and preventing the reprogramming from being executed.
[0010] To prevent staff errors and other issues, a method is known in which the initial program is reprogrammed at 1 Mbps and the update program is reprogrammed at 500 Kbps. For example, the reprogramming method described in Japanese Patent Publication No. 2021-129154 (Patent Document 1) is known.
[0011] Patent Document 1 describes setting the communication speed of the first node to a communication speed faster than the normal communication speed, setting the transmission / reception mode of the first node to a receive-only mode, transmitting a communication start signal from the program writer to the first node and a dummy node, transmitting a response signal from the dummy node to the program writer indicating that the communication start signal has been received, changing the transmission / reception mode of the first node from a receive-only mode to a normal transmission / reception mode, transmitting program data to be updated from the program writer to the first node, and updating the program with the updated program data. [Prior art documents] [Patent Documents]
[0012] [Patent Document 1] Japanese Patent Publication No. 2021-129154 [Overview of the project] [Problems that the invention aims to solve]
[0013] Incidentally, in electronic control devices, which are control nodes that constitute an in-vehicle network system, it has been proposed to use multiple microcontrollers, for example, two microcontrollers, to perform a certain predetermined control function.
[0014] For example, control systems have been proposed that use a dual-CPU system where two microcontrollers exchange data with each other to calculate output information, or a redundant system where two microcontrollers with the same control function switch to the other if one malfunctions, thereby maintaining the control function. In this case, the two microcontrollers communicate with each other via a CAN bus.
[0015] When reprogramming the initial programs of multiple microcontrollers, if the communication speed of two microcontrollers is set to 1 Mbps and the reprogramming described in Patent Document 1 is performed, the communication speed of the microcontroller that is reprogrammed first will be reset to 500 Kbps.
[0016] Therefore, while the communication speed of the first microcontroller is reset to 500 Kbps, the remaining microcontrollers have a communication speed of 1 Mbps. Because these speeds are different, communication may fail, potentially preventing reprogramming from being performed.
[0017] The object of the present invention is to provide an in-vehicle network system and a reprogramming method that can smoothly reprogram the initial programs of multiple microcontrollers in a control node consisting of multiple microcontrollers connected to a CAN bus. [Means for solving the problem]
[0018] The present invention An in-vehicle network system comprising a control node consisting of multiple microcontrollers connected to a CAN bus, When a program rewriting device is connected to the CAN bus for rewriting the control node's software program, a designated microcontroller determines the current communication setting information, and if the communication setting information indicates the first time, it performs the rewriting of its own software program at a communication speed faster than the communication speed for subsequent times, Once the rewriting of the software program of a given microcontroller is complete, other microcontrollers then proceed to rewrite their own software programs at a similar communication speed. When the rewriting of the software program of another microcontroller is completed, a predetermined microcontroller and other microcontrollers update and set communication setting information to communication setting information representing a communication speed slower than the initial communication speed.
Advantages of the Invention
[0019] According to the present invention, in a control node composed of a plurality of microcontrollers connected to a CAN bus, since the communication setting information is updated after the reprogramming of the plurality of microcontrollers is completed, the plurality of microcontrollers can be smoothly reprogrammed without the communication speed being changed during the reprogramming process.
Brief Description of the Drawings
[0020] [Figure 1] As a configuration of a control device to which the present invention is applied, it is a configuration diagram showing an example of a steer-by-wire type steering control device. [Figure 2] It is a configuration diagram showing the configuration of an in-vehicle network system in which the steering control device shown in FIG. 1 is connected to a CAN bus. [Figure 3] It is a configuration diagram showing the configuration of a predetermined control node of an in-vehicle network system. [[ID=^22]] [Figure 4] It is a flowchart for explaining the reprogramming process of a control node in a state produced in a factory. [Figure 5] It is an explanatory diagram for explaining the state of a software program by reprogramming shown in FIG. 4. [Figure 6] It is a flowchart for explaining the reprogramming process of a control node in a state where an automobile is being operated. [Figure 7] It is a configuration diagram showing another example of a CAN bus and a microcontroller connected to a program rewriting device.
Embodiments for Carrying Out the Invention
[0021] Embodiments of the present invention will be described in detail with reference to the drawings, but the present invention is not limited to the following embodiments, and various modifications and applications are also included within the scope of the technical concept of the present invention.
[0022] Before describing specific embodiments, the configuration of a steer-by-wire steering control device to which the present invention is applied will be explained below. It should be noted that the present invention is not limited to the steering control device described below, but can be applied to various control devices.
[0023] First, we will describe a steer-by-wire steering control system that disconnects the steering shaft from the steering axis, detects the rotation angle and disturbance torque of the steering shaft using rotation angle sensors and current sensors, and controls the amount of movement of the steering actuator based on these detection signals to drive the steering axis. The configuration of the steering mechanism will be omitted.
[0024] In Figure 1, the steering wheel 10 is steered by a tie rod 11, which is connected to the steering shaft 17. The steering wheel 12 is connected to the steering shaft 13, and a steering angle sensor or the like can be installed on the steering shaft 13 as needed.
[0025] The steering shaft 13 is not connected to the steering axis (sometimes called the rack bar) 17 of the steering mechanism 16, and a reaction force electric motor 18 is provided at the end of the steering shaft 13. In other words, the steering shaft 13 is not mechanically connected to the steering mechanism 16, and as a result, the steering shaft 13 and the steering mechanism 16 are separated. The reaction force electric motor 18 is driven by the steering operation control device 19. Hereafter, the reaction force electric motor 18 will be referred to as the reaction force motor 18.
[0026] The reaction motor 18 is equipped with a reaction motor rotation angle sensor 14, which detects the rotation angle of the reaction motor 18. The steering operation amount sensor detects the rotation angle of the reaction motor 18, but it may also be a steering operation angle sensor that detects the steering operation angle of the steering shaft, and any other sensor capable of detecting the rotation of the steering shaft 13 falls under the category of steering operation amount sensor.
[0027] Furthermore, the reaction motor 18 is equipped with a current sensor 15, which detects the current flowing through the coil of the reaction motor 18. This current is used, for example, when estimating disturbance torque.
[0028] The steering mechanism 16, which includes the steering shaft 17, is equipped with a steering electric motor mechanism 21, which controls the steering motion of the steering shaft 17. While an electric motor is used as the steering actuator, it goes without saying that other types of electric actuators could also be used.
[0029] The rotation angle of the steering wheel 12 is detected by the reaction motor rotation angle sensor 14 of the reaction motor 18, and the current flowing through the coil is detected by the current sensor 15. These detection signals are input to the electronic control unit 19. In addition, the steering control unit 19 receives various detection signals from external sensors 20.
[0030] The steering control device 19 calculates the control amount for the steering electric motor mechanism 21 based on the input rotation angle signal and current signal, and further drives the steering electric motor mechanism 21. Note that parameters other than the rotation angle signal and current signal can also be used as the control amount for the steering electric motor mechanism 21.
[0031] The rotation of the steering electric motor mechanism 21 rotates the output pulley (not shown) of the steering mechanism 16 via a belt (not shown) from the input pulley (not shown), and further, the steering shaft 16 is axially stroked by a steering nut (not shown) to steer the steering wheel 10. These are not essential to the invention, so their explanation will be omitted.
[0032] Furthermore, the steering control device 19 calculates the control amount for the reaction motor 18 based on the input rotation angle signal and current signal, and then drives the reaction motor 18. Note that parameters other than the rotation angle signal and current signal can also be used for the control amount of the reaction motor 18.
[0033] The steering mechanism 16 is equipped with a rack position sensor 22, which detects the actual steering amount (steering angle) of the steering wheel 10 and outputs a steering amount signal. The rack position sensor 22 detects the axial movement of the steering shaft 17. The rack position sensor 22, which detects the stroke amount of the steering shaft 17, is shown as the steering amount sensor, but it could also be a rotation angle sensor provided on the steering electric motor that applies steering force to the steering shaft 17, and any other sensor capable of detecting the position (steering amount) of the steering shaft 17 falls under the category of steering amount sensors.
[0034] Next, Figure 2 shows a schematic configuration of the steering operation control device 19 that controls the reaction force motor 18 and the steering motor 28. Note that this steering operation control device 19 represents both the reaction force actuator controller unit and the steering actuator controller, and is considered a single control node 19.
[0035] Here, the steering control device 19 is connected to the CAN bus 29 and, via a CAN controller (not shown), is connected to other control nodes 19A...19N, such as an electronic control unit for controlling the internal combustion engine, an electronic control unit for controlling the transmission, an electronic control unit for controlling the brakes, etc., and they input and output control information to each other. A fault diagnosis tool is also connected to the CAN bus, and fault information data can be read. Furthermore, as described above, a program rewriting device is connected, and the software program of the control node can be reprogrammed.
[0036] The reaction motor 18, connected to the steering shaft 13, is equipped with a reaction motor rotation angle sensor 14 and a current sensor 15. The reaction motor 18 is mechanically connected to the steering wheel 12 via the steering shaft 13. The reaction motor rotation angle sensor 14 is a sensor that detects the rotation angle of the reaction motor 18, and the current sensor 15 is a sensor that detects the current flowing through the coil of the reaction motor 18.
[0037] The reaction force motor 18 is an electric motor that applies steering reaction force to the steering shaft 13 via a motor driver 23 controlled by the steering operation control device 19. It monitors the input of the reaction force motor rotation angle sensor 14 and applies a predetermined steering reaction force to the steering shaft 13.
[0038] Furthermore, the steering control device 19 provides a drive signal to the steering motor 28, which is mechanically connected to the steering shaft 17 via the motor driver 24, in accordance with detection signals from the reaction force motor rotation angle sensor 14, the current sensor 15, and other sensors.
[0039] The steering control device 19 receives a rotation angle signal from the reaction force motor rotation angle sensor 14, a current signal from the current sensor 15, and furthermore, vehicle driving state detection signals that affect steering from driving state sensors such as the vehicle speed sensor 25 and the yaw rate sensor 26. In addition, the steering control device 19 receives a detection signal of the movement position of the steering shaft 17 from the rack position sensor 22 (see Figure 1), which is attached to the middle part of the housing that covers the steering shaft 17.
[0040] Here, the rack position sensor 22 detects the position of the steering shaft 17, and since the steering shaft 17 is directly connected to the tie rod 11, the steering angle of the steering wheel 10 can be detected by the value detected by the rack position sensor 22. In this way, the rack position sensor 22 functions as a steering angle detector for the steering wheel 10.
[0041] Furthermore, the steering control device 19 receives external steering command values from the Advanced Driver-Assistance System (ADAS system) 27. These external steering command values are command values calculated by the ADAS system 27, and are used to steer the steering wheels 10 by the steering mechanism 16 when the vehicle deviates from the white lines on the road or when avoiding an obstacle due to lane keeping control.
[0042] The steering control device 19 acquires detection signals for rotation angle, current, rack position, and driving state, as well as external steering command values, from the reaction motor rotation angle sensor 14, current sensor 15, rack position sensor 22, driving state sensors 25 and 26, and the automatic steering system 27 at a predetermined sampling period. It then appropriately combines the acquired detection signals and external steering command values to determine the amount of steering to be applied to the steering shaft 17, calculates the coil current to be supplied to the steering motor 35 to obtain this amount of steering, and provides a control signal to the motor driver 24 according to this calculation result.
[0043] Similarly, the steering control device 19 appropriately combines the rotation angle, current, rack position, driving state detection signals, and external steering command values to determine the steering reaction force to be applied to the steering wheel 12, calculates the coil current to be supplied to the reaction force motor 18 in order to obtain this steering reaction force, and provides a control signal to the motor driver 23 according to this calculation result.
[0044] Next, we will explain the configuration of the in-vehicle network system and its reprogramming, but here we will focus on the reprogramming of the steering control device 19. In the following, we will treat the reaction force actuator controller and the steering actuator controller as multiple microcontrollers. Of course, other redundant control devices are also acceptable.
[0045] In Figure 3, the reaction force actuator controller, microcontroller A30a, comprises a microcomputer (MCU) 31a and a CAN transceiver 32a. The microcomputer 31a has a transmit port TX and a receive port RX, and is connected to the CAN transceiver 32a. The CAN transceiver 32a has the function of performing CAN communication by connecting the transmit port TX to the "High" side of the CAN bus 29 and the receive port RX to the "Low" side of the CAN bus 29.
[0046] The microcomputer 31a includes a central processing unit (CPU) 33a, non-volatile memory 34a, and a CAN controller 35a. The central processing unit 33a works in cooperation with the CAN controller 35a to control communication with the CAN bus 29. The CAN controller 35a has the function of switching the communication speed between 1 Mbps and 500 Kbps according to instructions from the microcomputer 31a.
[0047] Furthermore, the steering actuator controller, microcontroller B30b, includes a microcomputer (MCU) 31b and a CAN transceiver 32b. The microcomputer 31b has a transmit port TX and a receive port RX, and is connected to the CAN transceiver 32b. The CAN transceiver 32b has the function of performing CAN communication by connecting the transmit port TX to the "High" side of the CAN bus 29 and the receive port RX to the "Low" side of the CAN bus 29.
[0048] The microcomputer 31b includes a central processing unit (CPU) 33b, non-volatile memory 34b, and a CAN controller 35b. The central processing unit 33b works in cooperation with the CAN controller 35b to control communication with the CAN bus 29. The CAN controller 35b has the function of switching the communication speed between 1 Mbps and 500 Lbps according to instructions from the microcomputer 31b.
[0049] The communication configuration information, described later, is stored in the non-volatile memories 34a and 34b of the microcomputers 31a and 31b, which constitute the respective microcontrollers 30a and 30b.
[0050] Other control nodes 19A to 19N are connected to CAN bus 29. A detailed explanation of control nodes 19A to 19N is omitted. Furthermore, when reprogramming is performed, a program rewriting device 36 is connected to CAN bus 29.
[0051] The program rewriting device 36 may communicate with the control node 19 at a high communication speed (1 Mbps) or at a slower communication speed (500 Kbps). Communication at the high communication speed is used when reprogramming the initial program, and communication at the slow communication speed is used when reprogramming the update program.
[0052] In this manner, microcontroller A30a and microcontroller B30b are connected to the same CAN bus 29, and a program rewriting device 36 is connected to the CAN bus 29 to rewrite the software programs of microcontroller A30a and microcontroller B30b.
[0053] In this embodiment, the program rewriting device 36 can specify microcontroller A30a and microcontroller B30b using CAN ID or the like. This allows the initial programs of microcontroller A30a and the subsequent microcontroller B30b to be reprogrammed sequentially while maintaining a communication speed of 1 Mbps.
[0054] Furthermore, once both microcontroller A30a and microcontroller B30b have their initial programs reprogrammed, the communication speed for reprogramming updates will be reset to 500Kbps. The specific configuration of this embodiment is as follows.
[0055] When a program rewriting device is connected to the CAN bus 29 for rewriting the software program of a control node, a designated microcontroller A30a determines the current communication setting information. If the communication setting information indicates the first time, it rewrites its own software program at a communication speed faster than the communication speed for subsequent times. Once the rewriting of the software program of the designated microcontroller A30a is complete, another microcontroller B30b then rewrites its own software program at a similar communication speed. Once the rewriting of the software program of the other microcontroller B30b is complete, both the designated microcontroller A30a and the other microcontroller B30b update and set the communication setting information to represent a communication speed slower than the initial communication speed.
[0056] With this configuration, the communication settings information is updated / configured only after the reprogramming of the multiple microcontrollers 30a and 30b connected to the CAN bus 29 is complete. As a result, the communication speed is not changed during the reprogramming process of the two microcontrollers 30a and 30b, and the reprogramming of the microcontrollers 30a and 30b can be performed smoothly.
[0057] Next, we will explain the reprogramming process flow in the two microcontrollers, but before that, we will briefly explain the initial program writing state. Figure 4 shows the initial program reprogramming flow in microcontroller A30a and microcontroller B30b.
[0058] Figure 4(A) shows the initial program flow of microcontroller 30a, which is reprogrammed first, and Figure 4(B) shows the initial program flow of microcontroller 30b, which is reprogrammed next. At this time, the control node 19, CAN bus 29, etc. are powered on. Here, the initial program is the main program (control program), and the boot loader is stored in advance.
[0059] First, in (A)(1), the boot loader is pre-stored in the non-volatile memory 34a of the microcontroller A30a. The boot loader stores instruction information and setting information such as (1) setting the CAN TX RX terminals, (2) initializing the CAN module registers, (3) enabling CAN transmission and reception, (4) setting UCOP, (5) checking the connection (connection found), (6) transitioning to the communication program with the program rewriting device, and (7) communication setting information F1 (baud rate set to 1Mbps as it is the initial value). In this state, the main program (control program) has not yet been written, as shown by the dashed line.
[0060] In this bootloader, the new information used in this embodiment is (7) communication setting information F1 (set to a baud rate of 1 Mbps as it is the initial value). Communication setting information F1 indicates the number of reprogramming attempts, and communication setting information F1 represents the first attempt. The communication speed is set by this communication setting information F1. For example, the communication speed is set to 1 Mbps.
[0061] Next, once the reprogramming is performed and completed, the main program (control program) will be written, as shown in (A)(2). The main program will have newly stored command information and setting information such as (1) initial diagnosis of microcontroller registers, (2) start of CAN transmission and reception, and (3) start of operation of various control application programs.
[0062] At this time, the boot loader retains the communication setting information F1 (7). In Patent Document 1, in this state, the communication setting information F1 is updated / set to communication setting information F2 corresponding to 500Kbps, which differs from the communication speed set in the boot loader of the microcontroller B30b, and there is a risk of a staff error occurring. In this embodiment, since the communication setting information F1 is retained as is, it is the same as the communication speed (1Mbps) set in the boot loader of the microcontroller B30b, and the risk of a staff error occurring can be avoided.
[0063] Once the reprogramming of microcontroller A30a is complete, the reprogramming of microcontroller B30b is then performed. This is done by selecting microcontroller B30b based on the CAN ID from the program writer 36 and then performing the reprogramming.
[0064] First, in (B)(1), the boot loader is pre-stored in the non-volatile memory 34b of the microcontroller B30b. Similar to the microcontroller A30a, the boot loader stores instruction information and setting information such as (1) setting the CAN TX RX terminals, (2) initializing the CAN module registers, (3) enabling CAN transmission and reception, (4) setting reprogramming, (5) checking the connection (connection found), (6) transitioning to the communication program with the program rewriting device, and (7) communication setting information F1 (baud rate set to 1Mbps as it is the initial value). In this state, the main program has not yet been written, as shown by the dashed line.
[0065] In this bootloader as well, the new information used in this embodiment is (7) communication setting information (baud rate set to 1Mbps as it is the initial value). Communication setting information F1 indicates the number of reprogramming attempts, and communication setting information F1 represents the first time (first time). The communication speed is set by this communication setting information F1. For example, the communication speed is set to 1Mbps.
[0066] As mentioned above, the bootloader of microcontroller A30a retains the (7) communication configuration information F1 as is, so it has the same communication speed as the bootloader of microcontroller B30b. Therefore, the risk of staff errors can be avoided.
[0067] Next, once the reprogramming is completed, the main program will be written as shown in (B)(2). The main program will have newly stored command information and setting information such as (1) initial diagnosis of microcontroller registers, (2) start of CAN transmission and reception, and (3) start of operation of various control application programs.
[0068] Then, once the reprogramming of microcontrollers A30a and B30b is complete, the communication configuration information F1 of the boot loaders of microcontrollers A30a and B30b is updated / set to communication configuration information F2 (set to the changed baud rate of 500Kbps), as shown in (A)(3) and (B)(3). Therefore, in subsequent reprogramming updates, even if the communication speed is 500Kbps, the reprogramming of microcontrollers A30a and B30b can be performed without causing a staff error.
[0069] The specific processing flow for performing the reprogramming described above is explained below. Figure 5 shows the processing flow when performing reprogramming (writing the initial program and update program), and Figure 6 shows the processing flow when the vehicle is running and the control program is being executed.
[0070] Figure 5 shows the processing flow that is activated when the program rewriting device 36 is connected. When reprogramming the initial program, the program rewriting device 36 that rewrites at a high communication speed (1 Mbps) is used, and when reprogramming the update program, the program rewriting device 36 that rewrites at a low communication speed (500 Kbps) is used.
[0071] Note that the following reprogramming procedure targets a control node equipped with two microcontrollers and assumes that power is supplied from the power source. Power will be cut off after the reprogramming of both microcontrollers is complete.
[0072] ≪Step S10≫ In step S10, the communication configuration information (= rewrite count) set in the microcontroller's bootloader is read. Here, since the communication configuration information stored in the bootloaders of the two microcontrollers is considered to be the same value, the communication configuration information F1 (see Figure 4) of microcontroller A30a, which is to be reprogrammed first, is read. Of course, it is also possible to read the communication configuration information of both microcontrollers. Once the reading is complete, the process moves to step S11.
[0073] ≪Step S11≫ In step S11, the read communication configuration information F1 is used to determine if this is the first time the rewrite operation has been performed. If it is the first time, the initial program RAM is reprogrammed; if it is the second time or later, the update program is reprogrammed instead.
[0074] If the determination in this step is that it is the first time, the process proceeds to step S12; if it is the second time or later, the process proceeds to step S21.
[0075] ≪Step S12≫ Since it was determined in step S11 that this was the first time, in step S12 the communication speed between the program rewriting device 36 and the microcontroller A30a is set to high speed (1 Mbps). Once the communication speed is set, the process proceeds to step S13.
[0076] ≪Step S13≫ In step S13, communication is initiated between the microcontroller A30a and the program rewriting device 36. The communication speed at this time is high speed (1 Mbps). Once communication is initiated, the process proceeds to step S14.
[0077] ≪Step S14≫ In step S14, the microcontroller A30a receives a program rewrite trigger from the program rewrite device 36. Upon receiving rewrite information from the program rewrite device 36, the microcontroller A30a performs a rewrite of its own software program.
[0078] If this program rewrite trigger is not received, the system will wait, but after a predetermined time has elapsed, it will time out and execute a process that does not perform reprogramming. When a program rewrite trigger is received, the system will proceed to step S15.
[0079] ≪Step S15≫ In step S15, the initial program rewriting sequence is initiated. This rewriting sequence is for performing reprogramming, and once the rewriting sequence begins, the process proceeds to step S16.
[0080] ≪Step S16≫ In step S16, the initial program is transferred from the program rewriting device 36 to the microcontroller A30a and stored in the microcontroller A30a's non-volatile memory 34a. In this case, the initial program is stored sequentially starting from state (1) in (A) of Figure 4. The process continues to step S17 while the initial program transfer continues.
[0081] ≪Step S17≫ In step S17, when the microcontroller A30a receives information from the program rewriting device 36 indicating the completion of the initial program transfer, it terminates the rewriting of the initial program. In this case, the state becomes (2) in (A) of Figure 4, and the initial program is stored. Alternatively, the determination of the completion of the transfer may be made from the termination information stored in the last line of the initial program.
[0082] In Patent Document 1, the bootloader communication settings are updated / configured after the initial program rewriting is complete. However, in this embodiment, the bootloader communication settings are not updated / configured, and the process proceeds to step S18. Steps S18 and beyond involve reprogramming of the microcontroller B30b.
[0083] ≪Step S18≫ In step S18, the initial program is transferred from the program rewriting device 36 to the microcontroller B30b and stored in the microcontroller B30b's non-volatile memory 34b. In this case, the initial program is stored sequentially starting from state (1) in (B) of Figure 4. The process continues to step S19 while the initial program transfer continues.
[0084] ≪Step S19≫ In step S19, when information is received that the transfer of the initial program from the program rewriting device has finished, the microcontroller B30b terminates the rewriting of the initial program. In this case, the state becomes (2) in (B) of Figure 4, and the initial program is stored.
[0085] ≪Step S20≫ In step S20, since the reprogramming of microcontrollers A30a and B30b is complete, the communication setting information (= rewrite count) of the bootloaders of microcontrollers A30a and B30b is incremented. In this case, the communication setting information becomes F2, which represents the second rewrite. This completes the reprogramming of the initial programs of the two microcontrollers. In this case, the state is as shown in (A)(3) and (B)(3) in Figure 4.
[0086] In this way, with multiple microcontrollers connected to the CAN bus, the communication setting information is updated (updated from 1Mbps to 500Kbps) only after the reprogramming of all microcontrollers is complete. This ensures that the communication speed is not changed during the reprogramming process, allowing multiple microcontrollers to be reprogrammed smoothly. Furthermore, if these reprogramming processes are successful, the power supply will be shut off as needed.
[0087] The above describes the reprogramming of the initial program; next, we will explain how to reprogram the update program. Here, the update program is the main program (control program).
[0088] Step S10, Step S11 In steps S10 and S11, as described above, the communication configuration information (=number of rewrites) that was reset in step S20 is read. Here, the communication configuration information is the information for the second reprogramming and subsequent reprogrammings. Therefore, the determination in step S12 is that it is the second or subsequent reprogramming, and the update program is to be reprogrammed. If it is determined that it is the second or subsequent reprogramming, the process proceeds to step S21.
[0089] ≪Step S21≫ Since it was determined in step S11 that this was the second time, in step S21 the communication speed between the program rewriting device 36 and the microcontroller A30a is set to low speed (500Kbps). Once the communication speed is set, the process proceeds to step S22.
[0090] ≪Step S22≫ In step S22, communication is initiated between the microcontroller A30a and the program rewriting device 36. The communication speed at this time is low (500Kbps). Once communication is initiated, the process proceeds to step S23.
[0091] ≪Step S23≫ In step S23, a program rewrite trigger is received from the program rewrite device 36. If this program rewrite trigger is not received, the system waits, but after a predetermined time has elapsed, a timeout occurs and the system executes a process that does not perform reprogramming. When a program rewrite trigger is received, the system proceeds to step S24.
[0092] ≪Step S24≫ In step S24, the update program rewrite sequence is initiated. This rewrite sequence is for performing reprogramming, and once the rewrite sequence starts, the process proceeds to step S25.
[0093] ≪Step S25≫ In step S25, the update program is transferred from the program rewriting device 36 to the microcontroller A30a and stored in the microcontroller A30a's non-volatile memory 34a. In this case, the update program is sequentially overwritten and stored from the state shown in (A)(2) of Figure 4. The process proceeds to step S26 while continuing the transfer of the update program.
[0094] During the reprogramming of an update program, the initial program, which was reprogrammed the first time, is erased, and then the update program is written and reprogrammed. It is also possible to save the initial program to RAM and write it again if the reprogramming fails.
[0095] ≪Step S26≫ In step S26, when the microcontroller A30a receives information from the program rewriting device 36 indicating the completion of the update program transfer, it terminates the rewriting of the update program. In this case, the system returns to the state shown in (A)(2) of Figure 4 after the update, and the update program is stored. Alternatively, the determination of the completion of the transfer may be made based on the termination information stored in the last line of the update program.
[0096] In this embodiment, the communication settings information of the boot loader is not updated / configured, and the process proceeds to step S27. Steps S27 and beyond involve processing related to the reprogramming of the microcontroller B30b.
[0097] ≪Step S27≫ In step S27, the program update is transferred from the program rewriting device 36 to the microcontroller B30b and stored in the non-volatile memory 34b of the microcontroller BA30b. In this case, the update is sequentially overwritten and stored from the state shown in (2) of (B) in Figure 4. The process proceeds to step S28 while continuing the transfer of the update.
[0098] During the reprogramming of an update program, the initial program, which was reprogrammed the first time, is erased, and then the update program is written and reprogrammed. It is also possible to save the initial program to RAM and write it again if the reprogramming fails.
[0099] ≪Step S28≫ In step S28, when the microcontroller B30b receives information from the program rewriting device 36 indicating the completion of the update program transfer, it terminates the rewriting of the update program. In this case, the system returns to the state shown in (B)(2) of Figure 4 after the update, and the update program is stored. Alternatively, the determination of the completion of the transfer may be made based on the termination information stored in the last line of the update program.
[0100] ≪Step S29≫ In step S29, since the reprogramming of microcontrollers A30a and B30b is complete, the communication configuration information (= rewrite count) of the boot loaders of microcontrollers A30a and B30b is checked. This check confirms that the communication configuration information is F2. In step S29, the communication configuration information (= rewrite count) may be incremented to save the rewrite history. In this case, the communication configuration information will be F3, representing the 3rd rewrite. This completes the reprogramming of the update programs for the two microcontrollers.
[0101] The update reprogramming will be performed at 500Kbps, as before, thus avoiding the risk of staff errors.
[0102] Next, the processing flow while the vehicle is in operation will be explained based on Figure 6. Note that this state indicates that the program rewriting device 36 is not connected and reprogramming is not performed. ≪Step S30≫ In step S30, the communication configuration information (=number of rewrites) set in the microcontroller's boot loader is read.
[0103] ≪Step S31≫ In step S31, the read communication configuration information is used to determine if this is the first time the rewrite operation has been performed. If it is the first time, the initial program RAM is reprogrammed; if it is the second time or later, the update program is reprogrammed instead.
[0104] In this step, if it is determined to be the first time, the process proceeds to step S40; if it is the second time or later, it proceeds to step S32. Note that this processing flow assumes the vehicle is in operation, so the initial program has already been written, and the communication settings information is for the second time or later. Therefore, in reality, the processing from step S40 onwards is not executed.
[0105] ≪Step S32≫ Since it was determined in step S31 that this was the second or subsequent attempt, in step S32, the communication speed of microcontroller A30a and microcontroller B30b is set to low speed (500Kbps). Once the communication speed is set, the process proceeds to step S33.
[0106] ≪Step S33≫ In step S33, communication is initiated between microcontroller A30a and microcontroller B30b. However, at this time, the program rewriting device 36 is not connected, so there is no reprogramming information on the CAN bus. Once communication is initiated, the process proceeds to step S34.
[0107] ≪Step S34≫ In step S34, the system waits for a program rewrite trigger from the program rewrite device 36. However, since the program rewrite device 36 is not actually connected, no program rewrite trigger is received. After waiting for the program rewrite trigger, the system proceeds to step S35.
[0108] ≪Step S35≫ In step S35, since the program rewriting trigger from the program rewriting device 36 does not arrive within a predetermined time, the reprogramming execution process is terminated due to a timeout.
[0109] ≪Step S36≫ In step S36, since there is no rewriting by the program rewriting device 36, control is performed according to the normal control program. For example, steering control and reaction force control will be performed according to the main program (control program).
[0110] On the other hand, returning to step S31, if the number of rewrites based on the read communication configuration information is the first time, the process proceeds to step S40 to reprogram the initial program RAM. However, since this processing flow assumes the vehicle is in operation, as mentioned above, the communication configuration information will be the second time or later, so in reality, the processing from step S40 onwards is not executed.
[0111] ≪Step S40≫ Since it was determined in step S31 that this was the first time, in step S40 the communication speed of microcontroller A30a and microcontroller B30b is set to high speed (1 Mbps). Once the communication speed is set, the process proceeds to step S41.
[0112] ≪Step S41≫ In step S41, communication is initiated between microcontroller A30a and microcontroller B30b. However, the program rewriting device 36 is not connected at this time. Once communication is initiated, the process proceeds to step S42.
[0113] ≪Step S42≫ In step S42, the system waits for a program rewrite trigger from the program rewrite device 36. In reality, the program rewrite device 36 is not connected, so no program rewrite trigger is received. After waiting for the program rewrite trigger, the system proceeds to step S43.
[0114] ≪Step S43≫ In step S43, since the program rewriting trigger from the program rewriting device 36 does not arrive within a predetermined time, the reprogramming execution process is terminated due to a timeout.
[0115] ≪Step S44≫ In step S44, since the reprogramming process has been aborted due to a timeout, the communication speed, which was set to high speed in step 40, is reset to low speed (500Kbps). Once the communication speed is reset, the process proceeds to step S36. In step S36, as described above, there is no rewriting by the program rewriting device 36, so the normal control by the main program is performed.
[0116] In this state, when the vehicle is in operation, the program rewriting device 36 is not connected, so normal control can be performed.
[0117] Next, a modified example of the connection relationship between the microcontroller and the CAN bus will be described with reference to Figure 7. In the embodiment described above, microcontroller A30a and microcontroller B30b are connected to a common CAN bus, and the program rewriting device 36 is also connected to this CAN bus. In this modified example, each microcontroller is individually connected to two CAN buses, and the program rewriting device 36 is connected to one of the CAN buses.
[0118] In Figure 7, microcontroller A30a and microcontroller B30b are located at control node 19. CAN bus A40a is connected to microcontroller A30a, and CAN bus B40b is connected to microcontroller B30b. Furthermore, CAN bus 40a is connected to microcontroller 30a via CAN driver 41a, and similarly, CAN bus 40b is connected to microcontroller 30b via CAN driver 41b.
[0119] Furthermore, the "High" side of the CAN bus 40a between the CAN driver 41a and the microcontroller 30a is connected to microcontrollers A30a and B30b. Similarly, the "High" side of the CAN bus 40b between the CAN driver 41b and the microcontroller 30b is connected to microcontrollers B30b and A30a. As a result, the program rewriting device 36 is in a state where it can communicate with microcontrollers A30a and B30b.
[0120] When the program rewriting device 36 is connected to the CAN bus 40a and reprogramming is performed, first microcontroller A30a is selected by CAN ID and reprogrammed. Once this reprogramming is complete, microcontroller B30b is then selected and reprogrammed. The reprogramming method is as described above.
[0121] As shown in Figure 7, microcontroller A30a and microcontroller B30b are interconnected to separate CAN buses 40a and 40b, respectively. A program rewriting device 36 is connected to CAN bus 40a, allowing the software programs of microcontrollers A30a and B30b to be rewritten.
[0122] In this way, even if the microcontrollers are connected to different CAN buses, the program rewriting device 36 can perform reprogramming of microcontroller A30a and microcontroller B30b.
[0123] As described above, in the present invention, when a program rewriting device is connected to the CAN bus for rewriting the software program of a control node, a predetermined microcontroller determines the current communication setting information, and if the communication setting information indicates the first time, it performs the rewriting of its own software program at a communication speed faster than the communication speed for the second time onwards. Furthermore, once the rewriting of the predetermined microcontroller's software program is completed, other microcontrollers then perform the rewriting of their own software programs at a similar communication speed, and once the rewriting of the other microcontrollers' software programs is completed, the predetermined microcontroller and the other microcontrollers update and set the communication setting information to communication setting information that indicates a communication speed slower than the initial communication speed.
[0124] According to this, in a control node consisting of multiple microcontrollers connected to a CAN bus, the communication configuration information is updated only after the reprogramming of the multiple microcontrollers is complete. This ensures that the communication speed is not changed during the reprogramming process, allowing for smooth reprogramming of multiple microcontrollers.
[0125] Furthermore, the present invention is not limited to the embodiments described above, but includes various modifications. The embodiments described above are explained in detail to make the present invention easier to understand, and are not necessarily limited to those having all the configurations described. In addition, it is possible to replace parts of the configuration of one embodiment with the configuration of another embodiment, and it is also possible to add the configuration of another embodiment to the configuration of one embodiment. It is also possible to add, delete, or replace other configurations for the configuration of each embodiment. [Explanation of Symbols]
[0126] 29...CAN bus, 30a...Microcontroller A, 31a...MCU, 32a...CAN transceiver, 33a...Central processing unit, 34a...Non-volatile memory, 35a...CAN controller, 30b...Microcontroller, 31b...MCU, 32b...CAN transceiver, 33b...Central processing unit, 34b...Non-volatile memory, 35b...CAN controller.
Claims
1. A method for reprogramming an in-vehicle network system having a control node consisting of multiple microcontrollers connected to a CAN bus, When a program rewriting device is connected to the CAN bus for rewriting the initial program and update program of the control node, the program rewriting device uses the CANID to specify a predetermined microcontroller, the predetermined microcontroller determines the current communication setting information, and if the communication setting information indicates the first time, it executes the rewriting of the initial program transferred from the program rewriting device at a first communication speed faster than the second communication speed used for rewriting the update program. When the initial program rewriting of the predetermined microcontroller is completed, the program rewriting device specifies another microcontroller using the CANID, and the other microcontroller executes the rewriting of the initial program transferred from the program rewriting device at the first communication speed. Once the initial program rewriting of the other microcontroller is complete, the program rewriting device uses the CANID to specify the predetermined microcontroller and the other microcontroller, and the predetermined microcontroller and the other microcontroller update and set the communication setting information to the communication setting information representing a second communication speed that is slower than the first communication speed. A method for reprogramming an in-vehicle network system, characterized by the following features.
2. A method for reprogramming an in-vehicle network system according to claim 1, When the predetermined microcontroller receives rewriting information from the program rewriting device, it executes the rewriting of the initial program. A method for reprogramming an in-vehicle network system, characterized by the following features.
3. A method for reprogramming an in-vehicle network system according to claim 1, The predetermined microcontroller and the other microcontroller are connected to the same CAN bus, and the program rewriting device is connected to the CAN bus to rewrite the initial programs of the predetermined microcontroller and the other microcontroller. A method for reprogramming an in-vehicle network system, characterized by the following features.
4. A method for reprogramming an in-vehicle network system according to claim 1, The predetermined microcontroller and the other microcontroller are each interconnected to their respective CAN buses, and these CAN buses are interconnected. The program rewriting device is connected to one of the CAN buses, and the initial programs of the predetermined microcontroller and the other microcontroller are rewritten. A method for reprogramming an in-vehicle network system, characterized by the following features.
5. A method for reprogramming an in-vehicle network system according to claim 1, The aforementioned communication setting information is stored in the non-volatile memory of the microcomputer that constitutes each of the aforementioned microcontrollers. A method for reprogramming an in-vehicle network system, characterized by the following features.
6. A method for reprogramming an in-vehicle network system according to claim 5, The aforementioned communication configuration information is stored as bootloader configuration information stored in the non-volatile memory. A method for reprogramming an in-vehicle network system, characterized by the following features.
7. A method for reprogramming an in-vehicle network system according to claim 6, The aforementioned communication setting information is the number of rewrites, and the first communication speed or the second communication speed is set in accordance with the number of rewrites. A method for reprogramming an in-vehicle network system, characterized by the following features.
Citation Information
Patent Citations
Electronic control unit
JP2007092621A
Multi-CPU system
JP2009064317A
Electronic control unit node and method of rewriting storage information of electronic control unit node
JP2009166645A
Electronic control device
JP2016162325A
Method for manufacturing vehicle control device
JP2021129154A