CN-121979814-A - Control system and method for maintaining IO state in ECU (electronic control Unit) refreshing process
Abstract
The invention discloses a control system and a control method for maintaining IO state in an ECU (electronic control Unit) refreshing process. The system comprises a main control chip MCU and at least one SPI control device, wherein the main control chip MCU and the at least one SPI control device are connected through an SPI bus. The SPI control device does not have a watchdog function and integrates a latch circuit. Before the MCU executes the operation mode of switching between the application program and the boot loader, a configuration instruction is sent to the SPI control device through the SPI bus to set the controlled IO pin of the SPI control device to be a preset level, the SPI control device keeps the IO state unchanged by means of internal latch during the period of SPI communication interruption caused by mode switching, and after communication is recovered, the MCU takes over control through the SPI instruction again. The invention utilizes the hardware latching characteristic of SPI control equipment, realizes seamless and uninterrupted maintenance of external key equipment control signals during the internal program jump and function interruption of the ECU, and solves the difficult problems of power failure or misoperation of the external equipment in the process of brushing.
Inventors
- CHEN ZEJIAN
- CHEN YONG
- CHENG JINGYE
- Xu Hubing
Assignees
- 芜湖埃泰克汽车电子股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251225
Claims (10)
- 1. A control system for maintaining IO state in the process of ECU (electronic control unit) refreshing is characterized by comprising a main control chip (MCU) and at least one SPI (serial peripheral interface) control device, wherein the main control chip (MCU) is provided with an SPI communication interface, the SPI control device is provided with the SPI communication interface and at least one controlled IO pin, and the SPI communication interface of the main control MCU is connected with the SPI communication interface of the SPI control device through an SPI bus.
- 2. The control system for maintaining an IO state during an ECU (electronic control unit) flashing process according to claim 1, wherein the master control chip (MCU) sends a configuration command to the SPI control device through an SPI command during the ECU flashing process, and the SPI control device sets the level state of at least one controlled IO pin according to the received configuration command.
- 3. A control system for maintaining an IO state during an ECU flush according to claim 2, wherein the SPI control device maintains the IO state set by the last SPI command executed during an SPI communication interruption.
- 4. A control system for maintaining IO status during an ECU refresh according to claim 3, wherein the SPI control device is not watchdog capable, and the IO status remains unchanged after the SPI communication is stopped.
- 5. A control system for maintaining an IO state during an ECU refresh according to claim 4 wherein said SPI control device comprises a latch circuit for latching the last set of valid configuration data written over the SPI bus.
- 6. The control system for maintaining an IO state during an ECU swipe of claim 1, wherein the SPI control device comprises at least one of a low side driver chip (LSD), a high side driver chip (HSD), and a half bridge driver chip.
- 7. A control method for maintaining an IO state system during an ECU refresh process based on any one of claims 1-6, said method comprising: S1, responding to a trigger signal entering an ECU program refreshing flow, and before executing operation mode switching operation, a main control chip MCU sends a first configuration instruction to at least one SPI control device through an SPI bus; s2, the SPI control device sets at least one controlled IO pin of the SPI control device to be in a preset level state according to the first configuration instruction so as to maintain power supply or enabling signals of external devices; S3, the MCU executes operation mode switching operation, SPI communication is interrupted during the operation, and the SPI control equipment keeps the level state of the controlled IO pin unchanged; And S4, after the operation mode switching is completed, the MCU reestablishes SPI communication and sends a second configuration instruction to the SPI control equipment so as to update or maintain the state of the controlled IO pin.
- 8. The method of claim 7, wherein the operation mode switching operation includes switching from the application mode to the Bootloader mode and switching from the Bootloader mode back to the application mode.
- 9. The method of claim 7, wherein the second configuration instruction is configured to set the controlled IO pin to a second level state that is the same as or different from the first level state.
- 10. A method according to any one of claims 7-9, wherein in step S3 the SPI control device maintains the IO state by means of its internal latch circuit without resetting or state jumping due to an interruption in SPI communication.
Description
Control system and method for maintaining IO state in ECU (electronic control Unit) refreshing process Technical Field The invention relates to the technical field of automobile electronic control, in particular to a control system and an implementation method for maintaining power supply or uninterrupted state of key external equipment such as a relay, an actuator, a sensor and the like in the process of program refreshing of an ECU (electronic control unit) of an automobile. Background With the continuous improvement of the electronization and the intelligent degree of the automobile, the number and the functions of the Electronic Control Units (ECU) are increasingly complex. The program of the ECU needs to be updated multiple times during the vehicle life cycle to repair vulnerabilities, optimize performance, or add functionality. This process is typically performed through a diagnostic interface such as OBD, known as ECU swiping. The core process of ECU refreshing is to make MCU jump from normal application program APP mode to special boot loader Bootloader mode, receive new program data and write into flash memory, and jump back to APP mode after completion. In the process, the MCU has a fundamental technical problem that the MCU is interrupted in function, at the moment when the APP and Bootloader modes jump mutually, the CPU core of the MCU is reset or context switched, so that the states of all general purpose input/output GPIO pins of the MCU can be temporarily brought into a reset state such as a pull-up state, a pull-down state or a high-resistance state, and then the reset state is reinitialized and configured by a newly operated program. During this time, external devices directly controlled by these GPIOs may be momentarily powered off, turned off, or malfunction due to loss of control signals. Such "momentary interruptions" are unacceptable for vehicle systems that require continuous operation. For example, if the KL15 relay is opened during the brushing, the instrument panel is blacked out, the communication network is disconnected, and even the vehicle can be misjudged to be flameout, so that the disorder of the electronic system in a larger range is caused. Conventional solutions are typically tolerant of such interruptions or require the vehicle to be in a special state prior to the swipe, greatly limiting the ease and application scenarios of the swipe. The patent number (CN 112965421B) discloses an engine ECU (electronic control unit) brush-writing control method and system, wherein the method comprises the steps of electrifying an ECU, judging whether the rotating speed and the vehicle speed are zero, judging whether the battery voltage is lower than a preset value and whether a hand brake is in a pulled-up state if the rotating speed is not zero, judging whether the oil injection quantity is zero and whether the hand brake is in the pulled-up state if the vehicle speed is not zero, and allowing brush-writing when the rotating speed is zero or the vehicle speed is not zero, wherein the oil injection quantity is zero and the hand brake is in the pulled-up state when the vehicle speed is zero, the rotating speed and the vehicle speed are not zero, the battery voltage is lower than the preset value and the hand brake is in the pulled-up state, or the rotating speed and the vehicle speed are not zero, the oil injection quantity is zero, the battery voltage is lower than the preset value and the hand brake is in the pulled-up state, and the engine is in the standing state by default, and the brush-writing is allowed. However, the above technology only ensures the safety of the vehicle state before the start of the refresh operation, but does not solve the problem of state interruption during the refresh operation, so there is a strong need in the industry for a simple, reliable and low-cost solution to achieve seamless, interruption-free control of the critical external devices during the whole process of the refresh operation of the ECU. Disclosure of Invention The invention aims to overcome the defects of the prior art, and provides a control system and a control method for maintaining an IO state in the process of ECU (electronic control Unit) flashing, which utilize SPI (serial peripheral interface) control equipment capable of freezing an output state when communication is interrupted as a state maintaining bridge between a GPIO input/output pin of a main control chip MCU and external equipment. In order to achieve the above purpose, the present invention adopts the following technical scheme: A control system for maintaining IO state in the process of ECU (electronic control Unit) refreshing comprises a main control chip MCU (micro control Unit) and at least one SPI (serial peripheral interface) control device, wherein the main control chip MCU is provided with an SPI communication interface, the SPI control device is provided with the SPI communication interface and at least one cont