CN109062624B - Processing method for interrupt wakeup of automobile electronic control unit - Google Patents

Processing method for interrupt wakeup of automobile electronic control unit Download PDF

Info

Publication number
CN109062624B
CN109062624B CN201810959124.0A CN201810959124A CN109062624B CN 109062624 B CN109062624 B CN 109062624B CN 201810959124 A CN201810959124 A CN 201810959124A CN 109062624 B CN109062624 B CN 109062624B
Authority
CN
China
Prior art keywords
interrupt
address state
wake
register
source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810959124.0A
Other languages
Chinese (zh)
Other versions
CN109062624A (en
Inventor
王洋
裴中强
陈兴
荀海波
华峰
陈远华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Timi Automobile Technology Co ltd
Original Assignee
Shanghai Timi Automobile Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Timi Automobile Technology Co ltd filed Critical Shanghai Timi Automobile Technology Co ltd
Priority to CN201810959124.0A priority Critical patent/CN109062624B/en
Publication of CN109062624A publication Critical patent/CN109062624A/en
Application granted granted Critical
Publication of CN109062624B publication Critical patent/CN109062624B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention belongs to the technical field of operating systems, and discloses a processing method for interrupting and awakening an automobile electronic control unit, which comprises the following steps: step one, when a wake-up module of a microcontroller detects an effective wake-up source, starting a Polling program to inquire the address state of an interrupt register; step two, judging whether the address state of the interrupt register changes, if so, executing a corresponding application program, otherwise, inquiring the address state of a GPIO input register corresponding to each non-interrupt pin by using a Polling program; step three, judging whether the address state of the GPIO input register changes, if so, executing a corresponding application program, otherwise, resetting the address state of the interrupt register; and step four, inquiring whether the address state of the GPIO input register corresponding to each interrupt pin is changed, if so, executing the corresponding application program, otherwise, the microprocessor continues to sleep.

Description

Processing method for interrupt wakeup of automobile electronic control unit
Technical Field
The invention belongs to the technical field of operating systems, and particularly relates to a computer-readable storage medium, electronic equipment for interrupting and waking up an automotive electronic control unit and a processing method for interrupting and waking up the automotive electronic control unit.
Background
With the improvement of living standard of people, automobile consumption is more and more common, the requirement on automobile electronic application is higher and higher, and the MCU awakening mode of the existing automobile electronic control unit mostly adopts a mode of combining interrupt awakening and Polling. Due to the limitation of MCU resources, all wake-up sources cannot be woken up in an interrupted mode, therefore, a wake-up source needing quick response in the selected wake-up sources is woken up in an interrupted mode, other wake-up sources adopt a Polling mode to wake up the MCU, the Polling principle is to set a timer to periodically interrupt and wake up the MCU, then to inquire whether each Polling wake-up source is in an effective state, if so, to wake up the MCU, otherwise, the MCU continues to sleep to wait for the next interrupt and wake-up.
However, when two strategies coexist, the problem of missed detection of the wake-up source adopting the interrupt mode may exist, for example, when there is an interrupt, the MCU is woken up, the Polling read interrupt status register is started, it is determined whether the wake-up source of the interrupt mode is present, or the MCU is woken up by the timer to perform Polling operation, and then the MCU continues to sleep or wake up according to the actual situation. In addition to the predictable timer interrupt for Polling, other interrupts are random and there is no guarantee that the interrupt status register is read after the interrupt occurs, for example, the MCU is woken up by the timer interrupt, and a wake-up source in interrupt mode is generated after the interrupt status register is read, which results in missed detection of the wake-up source in interrupt mode. Although the Polling continuous query method can avoid the problem that the wake-up source adopting the interrupt method is lost, the Polling method can reduce the wake-up speed of the MCU, and the Polling method is not suitable for the wake-up sources that need to consider the response speed.
Disclosure of Invention
The invention provides a computer readable storage medium, electronic equipment for interrupting and waking up an automobile electronic control unit and a processing method for interrupting and waking up the automobile electronic control unit, which solve the problem that when an MCU (microprogrammed control Unit) is awakened by combining an interrupt mode and polling, an awakening source awakened by the interrupt mode is missed to be detected.
The invention can be realized by the following technical scheme:
a computer-readable storage medium for interrupt wakeup of an automotive electronic control unit, comprising a computer program for use in conjunction with a wakeup module internal to a microprocessor, the computer program executable by the processor to perform the steps of:
the wake-up module detects an effective wake-up source and starts a Polling program to inquire the address state of an interrupt register;
judging whether the address state of the interrupt register is changed, if so, executing a corresponding application program, otherwise, inquiring the address state of a GPIO input register corresponding to each non-interrupt pin by using a Polling program;
judging whether the address state of the GPIO input register changes, if so, executing a corresponding application program, otherwise, resetting the address state of the interrupt register;
and inquiring whether the address state of the GPIO input register corresponding to each interrupt pin is changed, if so, executing a corresponding application program, otherwise, continuing the dormancy of the microprocessor.
Furthermore, the microprocessor comprises a plurality of interrupt pins connected with the awakening module, each interrupt pin is connected with a corresponding awakening source, and the level state of the interrupt pin corresponds to the address state of the interrupt register.
Further, the active wake-up source includes a wake-up source that causes a level jump of a corresponding interrupt pin, and a timer arrival cycle time.
An electronic device for interrupt wakeup of an automotive electronic control unit, comprising a plurality of wakeup sources, a wakeup module, one or more processors, memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the program comprising instructions for performing the steps of:
the wake-up module detects an effective wake-up source and starts a Polling program to inquire the address state of an interrupt register;
judging whether the address state of the interrupt register is changed, if so, executing a corresponding application program, otherwise, inquiring the address state of a GPIO input register corresponding to each non-interrupt pin by using a Polling program;
judging whether the address state of the GPIO input register changes, if so, executing a corresponding application program, otherwise, resetting the address state of the interrupt register;
and inquiring whether the address state of the GPIO input register corresponding to each interrupt pin is changed, if so, executing a corresponding application program, otherwise, continuing the dormancy of the microprocessor.
Furthermore, the microprocessor comprises a plurality of interrupt pins connected with the awakening module, each interrupt pin is connected with a corresponding awakening source, and the level state of the interrupt pin corresponds to the address state of the interrupt register.
Further, the active wake-up source includes a wake-up source that causes a level jump of a corresponding interrupt pin, and a timer arrival cycle time.
A processing method for interrupt wakeup of an automobile electronic control unit is characterized by comprising the following steps:
step one, a wake-up module of a microcontroller detects an effective wake-up source, and starts a Polling program to inquire the address state of an interrupt register;
step two, judging whether the address state of the interrupt register changes, if so, executing a corresponding application program, otherwise, inquiring the address state of a GPIO input register corresponding to each non-interrupt pin by using a Polling program;
step three, judging whether the address state of the GPIO input register changes, if so, executing a corresponding application program, otherwise, resetting the address state of the interrupt register;
and step four, inquiring whether the address state of the GPIO input register corresponding to each interrupt pin is changed, if so, executing the corresponding application program, otherwise, the microprocessor continues to sleep.
Furthermore, the microprocessor comprises a plurality of interrupt pins connected with the awakening module, each interrupt pin is connected with a corresponding awakening source, and the level state of the interrupt pin corresponds to the address state of the interrupt register.
Further, the active wake-up source includes a wake-up source that causes a level jump of a corresponding interrupt pin, and a timer arrival cycle time.
The beneficial technical effects of the invention are as follows:
when an effective wake-up source is detected by a wake-up module of the microprocessor, a polling program is started to inquire the change of the address state of the interrupt register, if the change is detected, the microprocessor is woken up according to a normal interrupt mode, if the change is not detected, the timer is called to interrupt and wake up at the moment, the microprocessor is woken up according to the normal timer interrupt, the address state of the interrupt register is reset, then the state of a GPIO input register corresponding to an interrupt pin is inquired, and if the change is detected, a corresponding application program is directly executed.
Drawings
FIG. 1 is a flow chart of a software program of the present invention.
Detailed Description
The following detailed description of the preferred embodiments will be made with reference to the accompanying drawings.
Referring to the attached figure 1, the invention provides a processing method for interrupt wakeup of an automobile electronic control unit, which is characterized by comprising the following steps:
step one, when a wake-up module of a microcontroller detects an effective wake-up source, starting a Polling program to inquire the address state of an interrupt register;
the microprocessor includes a plurality of interrupt pins connected to the wake-up module, each interrupt pin is connected to a corresponding wake-up source, the wake-up source includes an ignition switch inserted into a key, a brake pedal, etc., and the level state of the interrupt pin corresponds to the address state of the interrupt register. In addition, due to the resource limitation of the MCU, besides the above types of wake-up sources, other types of wake-up sources need to wake up periodically by the timer of the MCU, and perform wake-up source inquiry to wake up the MCU, i.e. the timer reaches the cycle time, which also belongs to the above mentioned valid wake-up source.
And step two, judging whether the address state of the interrupt register is changed, if so, executing a corresponding application program, otherwise, indicating that the detected effective awakening source is timer interrupt awakening, and inquiring the address state of the GPIO input register corresponding to each non-interrupt pin by using a Polling program.
And step three, judging whether the address state of the GPIO input register is changed, if so, executing a corresponding application program, otherwise, resetting the address state of the interrupt register.
And step four, before the microprocessor sleeps, inquiring whether the address state of the GPIO input register corresponding to each interrupt pin is changed, if so, executing the corresponding application program, otherwise, continuing the sleep of the microprocessor.
The processing method described above is mainly executed by a computer program, which can be stored in a computer readable medium and executed by a processor to perform its corresponding functions.
The present invention also provides an electronic device for interrupt wakeup of an automotive electronic control unit, comprising a plurality of wakeup sources, a wakeup module, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs including instructions for performing the steps of the processing method described above.
The specific working process of the invention is as follows:
when the wake-up module of the microprocessor detects an effective wake-up source, such as an ignition switch is inserted into a key, a brake is stepped on, or a timer reaches a cycle time, etc., the microprocessor is woken up to start working, a polling program is started to inquire the change of the address state of an interrupt register, if the change is changed, the effective wake-up source is woken up in an interrupt mode, the effective wake-up source is processed in a normal interrupt mode, a corresponding application program is executed, if the change is not changed, the timer is interrupted and woken up, the polling program is used to inquire the change of the address state of a GPIO input register corresponding to each non-interrupt pin, if the change is changed, the corresponding application program is executed, if the change is not changed, the address state of the interrupt register is cleared, so that the state change of the corresponding interrupt pin is conveniently stored when the wake-up source, in order to avoid interruption wakeup loss when the polling program is used for inquiring the change of the address state of the interruption register, the state of the GPIO input register corresponding to the interruption pin needs to be directly inquired, if the change is caused, the corresponding application program is directly executed, otherwise, the microprocessor is in a dormant state, so that the wakeup source missing detection of the interruption mode can be avoided after the polling program inquires the address state of the interruption register, meanwhile, the microprocessor is awakened by adopting the interruption mode, the quick response speed of the microprocessor to the emergency condition is guaranteed, and the overall performance of the microprocessor is improved.
Although specific embodiments of the present invention have been described above, it will be appreciated by those skilled in the art that these are merely examples and that many variations or modifications may be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is therefore defined by the appended claims.

Claims (9)

1. A computer-readable storage medium for interrupt wakeup of an automotive electronic control unit, comprising a computer program for use in conjunction with a wakeup module internal to a microprocessor, the computer program executable by the processor to perform the steps of:
the wake-up module detects an effective wake-up source and starts a Polling program to inquire the address state of an interrupt register;
judging whether the address state of the interrupt register is changed, if so, executing a corresponding application program, otherwise, inquiring the address state of a GPIO input register corresponding to each non-interrupt pin by using a Polling program;
judging whether the address state of the GPIO input register changes, if so, executing a corresponding application program, otherwise, resetting the address state of the interrupt register;
and inquiring whether the address state of the GPIO input register corresponding to each interrupt pin is changed, if so, executing a corresponding application program, otherwise, continuing the dormancy of the microprocessor.
2. The computer-readable storage medium of claim 1, wherein: the microprocessor comprises a plurality of interrupt pins connected with the awakening module, each interrupt pin is connected with a corresponding awakening source, and the level state of the interrupt pin corresponds to the address state of the interrupt register.
3. The computer-readable storage medium of claim 2, wherein: the active wake-up source includes a wake-up source causing a level jump of a corresponding interrupt pin, and a timer arrival cycle time.
4. An electronic device for interrupt wakeup of an automotive electronic control unit, comprising a plurality of wakeup sources, a wakeup module, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the program comprising instructions for performing the steps of:
the wake-up module detects an effective wake-up source and starts a Polling program to inquire the address state of an interrupt register;
judging whether the address state of the interrupt register is changed, if so, executing a corresponding application program, otherwise, inquiring the address state of a GPIO input register corresponding to each non-interrupt pin by using a Polling program;
judging whether the address state of the GPIO input register changes, if so, executing a corresponding application program, otherwise, resetting the address state of the interrupt register;
and inquiring whether the address state of the GPIO input register corresponding to each interrupt pin is changed, if so, executing a corresponding application program, otherwise, continuing the dormancy of the microprocessor.
5. The electronic device for interrupting wake-up of an automotive electronic control unit according to claim 4, characterized in that: the microprocessor comprises a plurality of interrupt pins connected with the awakening module, each interrupt pin is connected with a corresponding awakening source, and the level state of the interrupt pin corresponds to the address state of the interrupt register.
6. The electronic device for interrupting wake-up of an automotive electronic control unit according to claim 5, characterized in that: the active wake-up source includes a wake-up source causing a level jump of a corresponding interrupt pin, and a timer arrival cycle time.
7. A processing method for interrupt wakeup of an automobile electronic control unit is characterized by comprising the following steps:
step one, when a wake-up module of a microcontroller detects an effective wake-up source, starting a Polling program to inquire the address state of an interrupt register;
step two, judging whether the address state of the interrupt register changes, if so, executing a corresponding application program, otherwise, inquiring the address state of a GPIO input register corresponding to each non-interrupt pin by using a Polling program;
step three, judging whether the address state of the GPIO input register changes, if so, executing a corresponding application program, otherwise, resetting the address state of the interrupt register;
and step four, inquiring whether the address state of the GPIO input register corresponding to each interrupt pin is changed, if so, executing the corresponding application program, otherwise, the microprocessor continues to sleep.
8. The processing method for interrupt wakeup of automobile electronic control unit according to claim 7, wherein: the microprocessor comprises a plurality of interrupt pins connected with the awakening module, each interrupt pin is connected with a corresponding awakening source, and the level state of the interrupt pin corresponds to the address state of the interrupt register.
9. The processing method for interrupt wakeup of automobile electronic control unit according to claim 8, wherein: the active wake-up source includes a wake-up source causing a level jump of a corresponding interrupt pin, and a timer arrival cycle time.
CN201810959124.0A 2018-08-22 2018-08-22 Processing method for interrupt wakeup of automobile electronic control unit Active CN109062624B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810959124.0A CN109062624B (en) 2018-08-22 2018-08-22 Processing method for interrupt wakeup of automobile electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810959124.0A CN109062624B (en) 2018-08-22 2018-08-22 Processing method for interrupt wakeup of automobile electronic control unit

Publications (2)

Publication Number Publication Date
CN109062624A CN109062624A (en) 2018-12-21
CN109062624B true CN109062624B (en) 2021-06-01

Family

ID=64686832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810959124.0A Active CN109062624B (en) 2018-08-22 2018-08-22 Processing method for interrupt wakeup of automobile electronic control unit

Country Status (1)

Country Link
CN (1) CN109062624B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362327B (en) * 2019-07-12 2023-05-16 北京经纬恒润科技股份有限公司 Application program updating method, device and system
CN111522757B (en) * 2020-04-23 2023-08-22 上海琪云工业科技有限公司 Interrupt reading and clearing control method based on I2C bus
CN112667302B (en) * 2021-03-16 2021-05-21 轸谷科技(南京)有限公司 Method for quickly responding to external equipment request of processor

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1147774C (en) * 1998-10-23 2004-04-28 宏基股份有限公司 Computer device and its change method from power economizing mode into operation mode
CN101127023B (en) * 2006-08-17 2010-05-26 四川维肯电子有限公司 Universal asynchronous serial extended chip of multi-bus interface
CN102833088B (en) * 2011-06-17 2018-03-23 中兴通讯股份有限公司 A kind of interruption processing method and device
CN103377081B (en) * 2012-04-27 2017-02-08 沈阳高精数控智能技术股份有限公司 Implementation method for interrupt mechanism between embedded numerical control system dual-core chip and peripheral
JP6034161B2 (en) * 2012-11-29 2016-11-30 シナプティクス・ジャパン合同会社 Semiconductor device and electronic equipment
CN105068962A (en) * 2015-07-23 2015-11-18 上海斐讯数据通信技术有限公司 I2C controller access method and I2C controller access system

Also Published As

Publication number Publication date
CN109062624A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
US10649935B2 (en) Deferred inter-processor interrupts
US6308279B1 (en) Method and apparatus for power mode transition in a multi-thread processor
CN109062624B (en) Processing method for interrupt wakeup of automobile electronic control unit
US7529956B2 (en) Granular reduction in power consumption
KR102048329B1 (en) Method and apparatus for running application program
AU2011336388B2 (en) Modular gating of microprocessor low-power mode
CN111225434B (en) Application response method, system, storage medium and communication module
CN105353864A (en) Static power consumption management method and system for electronic device
CN112530056A (en) Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium
TWI739345B (en) A system and a method for handling an interrupt
CN109918145B (en) Application cold start acceleration method and device and electronic equipment
WO2014142847A1 (en) Multi-core binary translation task processing
US20150074436A1 (en) In-Kernel CPU Clock Boosting on Input Event
CN109992314B (en) Data reporting method, device, terminal and storage medium
TWI716074B (en) Method and device for improving CPU performance and electronic equipment
CN112667302B (en) Method for quickly responding to external equipment request of processor
WO2017102038A1 (en) Method and arrangement for utilization of a processing arrangement
CN112462926B (en) Power management method and device in mobile terminal, electronic equipment and computer storage medium
CN118101377B (en) Communication method, system and computer program product of bus system
WO2018116450A1 (en) Wireless communication device and control program
CN115509340A (en) Low-power-consumption management method of operating system, operating system and terminal
CN116401067A (en) Thread-driven software timer running method, device, equipment and medium
CN117891329A (en) Wireless communication module, control method and device thereof, electronic equipment and medium
CN115494929A (en) State switching method, system, communication device and computer readable storage medium
JP2013161363A (en) Electronic control device and method for executing program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant