microcomputer
The microcomputer addresses memory protection violations and fault propagation by using an arithmetic processing unit to manage data transfers between programs with different safety levels, ensuring safe data updates without disabling memory protection.
Patent Information
- Application Number
- JP2025081272
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2026-11-27
AI Technical Summary
Existing microcomputers face the risk of memory protection violations and fault propagation when data from a program with a low functional safety level is written to a program with a high functional safety level, necessitating costly fault injection testing and disabling the memory protection function.
A microcomputer design that includes an arithmetic processing unit to manage data transfers between programs with different safety levels, ensuring memory protection by writing data only when the controlled object is inactive and using safe values when the object is operational.
Prevents memory protection violations and fault propagation by enabling data transfers without disabling the memory protection function, ensuring safe data updates even during system operation.
Smart Images

Figure 2026184741000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a microcomputer that executes multiple programs with different functional safety levels. [Background Art]
[0002] Patent Document 1 discloses a microcomputer as follows. A plurality of programs QM, ASIL_A, and ASIL_C classified according to functional safety levels are stored with a protection function set to prohibit execution of the programs. The arithmetic processing unit checks the validity of the plurality of programs QM, ASIL_A, and ASIL_C in order starting from the program QM with the lowest functional safety level, and when confirming through the validity check that there is no problem with the program, releases the protection function for the program and executes the program. [Prior Art Documents] [Patent Documents]
[0003] [Patent Document 1] Japanese Unexamined Patent Application Publication No. 2016-134082 [Summary of the Invention] [Problem to be Solved by the Invention]
[0004] For example, in a certain system, when enabling a memory protection function that prohibits RAM writing from a program with a low functional safety level to a program with a high functional safety level, a memory protection violation may occur depending on the assigned functional safety level.
[0005] Figure 12 shows a program before the memory protection function is enabled, where module A writes to module B's RAM. The memory protection function is then enabled, assigning modules A and B to QM (Quality Management) and ASIL (Automotive Safety Integrity Level) B, respectively. Figure 13 shows a legend for the illustrated forms used in Figure 12 and the embodiments of this disclosure described later. This example demonstrates that a memory protection violation occurs because a program with a low functional safety level writes to the RAM of a program with a high functional safety level. Note that "writing to the program's RAM" is synonymous with writing data to the memory area used by the program.
[0006] Applying the technology disclosed in Patent Document 1 to the above case, the module B will be validated to confirm that there are no problems with the program before the memory protection function is released. Therefore, it is possible to safely rewrite RAM from a program with a low functional safety level to a program with a high functional safety level.
[0007] However, even if the program is validated as described above, there is a risk of fault propagation when data used by a program with a low functional safety level is written to an area used by a program with a high functional safety level.
[0008] for example, (1) Validation check of the program QM (2) Deactivation of the protection function (write protection) for the program QM (3) Validation of program ASIL_A (4) Remove the protection function (write protection) for program ASIL_A. Consider a sequence like this.
[0009] (1) The validity of program QM is checked, and then (2) writing is permitted. However, during or after the execution of program QM, there is a possibility that the data may be overwritten with an invalid value during the process of program QM transferring data to program ASIL_A, resulting in corrupted data. In (4), writing permission for program ASIL_A allows program QM to write the corrupted data to ASIL_A, so there is a possibility that the fault will propagate from program QM to ASIL_A. In addition, when disabling the memory protection function, it may be necessary to perform separate fault injection testing as a countermeasure against vulnerabilities. For this reason, from the perspective of development costs, it is desirable to avoid disabling the memory protection function as much as possible.
[0010] The present invention has been made in view of the above circumstances, and its purpose is to provide a microcomputer that can update data processed by a program with a high functional safety level in response to a write request from a program with a low functional safety level, without disabling the memory protection function. [Means for solving the problem]
[0011] The microcomputer described in claim 1 executes a low-priority program (module A) with a low functional safety level and a high-priority program (modules B, B1~B3) with a higher functional safety level than the low-priority program, in connection with the control of the controlled object (15, 36). The arithmetic processing unit (module C), provided that the controlled object is in a non-operating state, determines whether there is a write request to the memory area (RAMb, RAMb1~b3) processed by the high-priority program for the data written by the low-priority program, and if it determines that there is a write request, it writes the target data to the memory area.
[0012] With this configuration, when there is a request to transfer data written by a low-priority program to a memory area processed by a high-priority program, the arithmetic processing unit will perform the transfer, eliminating the need to disable the memory protection function. Furthermore, since the arithmetic processing unit performs the transfer to the memory area only when the controlled object is inactive, the occurrence of failures that may occur when the controlled object is operational is eliminated in advance. Therefore, the transfer to the memory area by the arithmetic processing unit itself can be performed under safe conditions.
[0013] According to the microcomputer described in claim 2, when the arithmetic processing unit determines that the controlled object is not in an inactive state, it updates the data written by the low-priority program with a value that is safer than the aforementioned data in the control of the controlled object. In other words, even when the controlled object is in an operational state and the situation cannot be said to be on the safe side, the data written by the low-priority program is updated with a value that is on the safe side, thus avoiding the occurrence of failures, etc.
[0014] According to the microcomputer described in claim 3, after writing data to the memory area, the arithmetic processing unit updates the data written by the low-priority program with a value that is safer than the aforementioned data in the control of the controlled object. In this case as well, similar to claim 2, it is possible to avoid the occurrence of failures, etc.
[0015] According to the microcomputer described in claim 4, the safe value is a data value indicating that there is no request to write to the memory area. This temporarily prevents low-priority programs from writing to the memory area of high-priority programs, thus avoiding the occurrence of failures and other problems. [Brief explanation of the drawing]
[0016] [Figure 1] This is a functional block diagram showing the configuration of an ECU that controls the EPS system, representing the first embodiment. [Figure 2]Diagram illustrating operations between modules A, B, and C executed by the microcontroller, in accordance with the legend shown in FIG. 13 [Figure 3] Flowchart illustrating processes of modules A and C [Figure 4] Diagram illustrating state transitions of the EPS system [Figure 5] Flowchart illustrating processes of modules A and C according to a second embodiment [Figure 6] Diagram illustrating operations between modules A, B, and C executed by the microcontroller, in accordance with the legend shown in FIG. 13, according to a third embodiment [Figure 7] Diagram illustrating operations between modules A and B executed by the microcontroller, in accordance with the legend shown in FIG. 13, according to a fourth embodiment [Figure 8] Diagram illustrating operations between modules A, B, and C executed by the microcontroller, in accordance with the legend shown in FIG. 13, according to a fifth embodiment [Figure 9] Flowchart illustrating processes of modules A and C [Figure 10] Flowchart illustrating processes of modules A and C according to a sixth embodiment [Figure 11] Functional block diagram illustrating a configuration of an ECU that controls an actuator, according to a seventh embodiment [Figure 12] Diagram illustrating operations between modules A and B executed by the microcontroller, in accordance with the legend shown in FIG. 13, according to a conventional technology [Figure 13] Diagram illustrating a legend for a graphical representation of processes between modules [Description of Embodiments]
[0017] (First Embodiment) As shown in Figure 1, the ECU (Electronic Control Unit) 1 of this embodiment is applied to, for example, an EPS (Electric Power Steering) system mounted in a vehicle, and includes a microcontroller 2, an input circuit 3, and an output circuit 4. The microcontroller 2 includes a CPU 5, a ROM 6, a RAM 7, and an I / O port 8. The CPU 5, ROM 6, and RAM 7 are connected via an address and data bus 9. The ROM 6 stores the control program executed by the CPU 5. The control program stored in ROM 6 has multiple programs divided into QM and ASIL_A~D. The CPU 5 executes each program of the control program and has a memory protection function that prohibits writing to RAM 7 that is higher than the functional safety level to which the program belongs. Therefore, the area of RAM 7 is divided into QM and ASIL_A~D.
[0018] Each program QM and ASIL_A to D has a functional safety level assigned to it. The functional safety levels are set so that the more important the program, the higher the level, as functionality and safety are required. In this embodiment, for example, the levels are set in accordance with the functional safety standard ISO 26262 for automobiles. The functional safety standard ISO 26262 classifies the potential risks of each function of a vehicle by ASIL (Automotive Safety Integrity Level), and assigns a wide range of classification levels from QM (Quality Management: not related to safety) to ASIL_D (highest related to safety). The functional safety levels for each program are as follows: QM <ASIL_A<ASIL_B<ASIL_C<ASIL_D
[0019] Each I / O terminal of the CPU 5 is connected to the I / O port 8 by individual wiring. Signals from the IG (ignition switch) 11, angle sensor 12, torque sensor 13, and vehicle speed sensor 14 are input to the microcontroller 2 via the input circuit 3. The drive signal for the motor 15 is output from the microcontroller 2 via the output circuit 4.
[0020] Angle sensor 12 and torque sensor 13 are located on a steering shaft (not shown) and detect the steering angle and steering torque of the steering shaft, respectively, when the vehicle driver steers the steering wheel (not shown). Motor 15 outputs torque to assist in steering the steering wheel. In other words, ECU 1 is an electronic control unit that controls the drive of motor 15. Vehicle speed sensor 14 is used to determine the state transition of the vehicle, as will be described later.
[0021] Next, the operation of this embodiment will be described. In the program stored in the RAM7 of the microcontroller 2, as shown in Figure 2, low-priority programs are designated as module A (QM), and high-priority programs as module B (ASIL-B). Module A corresponds to low-priority programs, and module B corresponds to high-priority programs. In this embodiment, module C (ASIL-B) is used as the arithmetic processing unit for fault propagation prevention. The processes shown in Figures 2 and 3 are executed with the memory protection function enabled. In this embodiment, "memory protection" means prohibiting low-priority programs from writing data to the memory area used by high-priority programs.
[0022] First, module A creates RAMa, which means allocating a memory area on RAM7 for module A to use as RAMa. Then, module A's function FUNC_A updates the write request value for area RAMa (Figure 2-P1, Figure 3-S1). Module C determines whether or not a hazard can occur in the EPS system (S2).
[0023] As shown in Figure 4, when the power is turned on and the microcontroller 2 starts up, the control state of the EPS system transitions from "initial check state" → "steering assist state" → "stop state" until the power to the microcontroller 2 is turned off. The "stop state" here is equivalent to the vehicle being stopped or parked. In these states, the "steering assist state," in which the system is operating, is a state in which a hazard can occur with the EPS system. On the other hand, the "initial check state" and the "stop state," in which the system is not operating, are states in which a hazard cannot occur.
[0024] Therefore, in step S2, module C refers to the input state of signals from IG11, angle sensor 12, torque sensor 13, and vehicle speed sensor 14 to determine whether the EPS system is in a "steering assist state". If it is not in a "steering assist state" (YES), module C's function FUNC_C refers to RAMa (P2). Then, it determines whether the data value stored in the referenced RAMa is a write request to module B's RAMb (S3).
[0025] Here, the processing of function FUNC_A before the memory protection function was enabled is ported to function FUNC_C. If it is a write request (YES in S3), function FUNC_C writes the target data value to RAMb created by module B (P3, S4). As a result, RAMb, the memory area used by module B, is updated in response to the write request from module A. The specific determination of whether or not there is a write request will be explained in the second embodiment. On the other hand, if it is not a write request (NO in S3), module C terminates processing.
[0026] Furthermore, if the execution cycle of module A is slower than that of module B, when module B references RAMa in the next task, the data value will become a random value. Therefore, FUNC_C_CLEAR of module C updates RAMa to a value that is safe for system control (P4, S5). Here, "safe value" means updating to a value that does not require a write request, including, for example, the initial value. Also, if it is determined in step S2 that a hazard may occur in the system (NO), the process proceeds to step S5.
[0027] As described above, according to this embodiment, the microcontroller 2 constituting the ECU1 executes module A, which has a lower functional safety level, and module B, which has a higher functional safety level than module A, in relation to the control of the EPS system that is the target of control. Module C, provided that the system is in a non-operating state, determines whether there is a write request to RAMb, which is processed by module B, regarding the contents of the data written to RAMa by module A, and if it determines that there is a write request, it writes the target data to RAMb.
[0028] With this configuration, module C writes the target data to RAMb in response to requests from module A, eliminating the need to disable the memory protection function. Furthermore, module C performs the transfer to RAMb only when the system is idle, thus eliminating the possibility of failures occurring when the system is operational. Consequently, the transfer to RAMb by module C can also be performed under safe conditions.
[0029] Furthermore, when module C determines that the system is operational, it updates the data written by module A with a value that is safer than the aforementioned data in terms of system control. More specifically, it updates it with a data value indicating that there is no write request to RAMb. In other words, even when the system is operational and not in a safe state, module C updates the data written by module A with a safer value, thus avoiding situations that could lead to failures.
[0030] (Second Embodiment) In the following description, parts identical to those in the first embodiment are denoted by the same reference numerals and their descriptions are omitted, while parts that differ are described. The second embodiment shows a specific example of determining whether or not a write request is made in step S3 of the first embodiment. When module A requests module B to write data to RAMb, one bit in the data is used as a flag, with the flag ON indicating a write request and the flag OFF indicating no write request. Then, as shown in Figure 5, in step S10, it is determined whether or not the above flag is ON.
[0031] (Third embodiment) As shown in Figure 6, the third embodiment of the microcontroller 2A differs from the first embodiment in that the functional safety level of module C is set to ASIL-D, which is higher than that of module B.
[0032] (Fourth Embodiment) As shown in Figure 7, the microcontroller 21 of the fourth embodiment differs from the first embodiment in that the functions FUNC_C and FUNC_C_CLEAR of module C are incorporated into module B.
[0033] (Fifth embodiment) As shown in Figure 8, in the microcontroller 22 of the fifth embodiment, module B is replaced by modules B1 to B3. The functional safety levels of modules B1, B2, and B3 are set to ASIL-B, ASIL-C, and ASIL-D, respectively. Accordingly, the functional safety level of module C is set to ASIL-D. Module C transfers data to modules B1 to B3 in response to write requests stored in RAMa.
[0034] For example, by managing the write request value stored in RAMa using bits, and specifying the write destination and whether or not a write request exists, it is possible to rewrite the RAM processed by a specific module. For instance, a predetermined number of bits from the LSB (Least Significant Bit) of RAMa can be assigned as flags for write requests to multiple modules B.
[0035] Next, the operation of the fifth embodiment will be described. As shown in Figure 9, when module C executes step S2, it clears index i to zero (S11). Then, it determines whether the i-th bit from the LSB of the referenced RAMa data value is ON or OFF (S12). If the i-th bit is ON (YES), it updates RAMb(i+1) (S13) and increments index i (S14). On the other hand, if the i-th bit is OFF (NO), it proceeds to step S14.
[0036] When step S14 is executed, it is determined whether the value of index i is greater than or equal to the number of modules B minus "1" (S15). If it is determined to be "YES", the process proceeds to step S5. If it is determined to be "NO" in step S15, the process returns to step S12. In the fourth embodiment, the loop of steps S12 to S15 is repeated three times. For example, if the lower 3 bits of RAMa are "110", module C updates RAMb2 and RAMb3.
[0037] Generally, it is assumed that arbitration modules or the like are used to manage the requests of multiple modules that want to write data. In contrast, according to the fifth embodiment, the arrangement of modules and functions can be easily customized according to the application and technical requirements.
[0038] (Sixth Embodiment) As shown in Figure 10, in the sixth embodiment, module A counts up the data value that it writes to RAMa (S21). As a result, the data value written to RAMa changes gradually. In step S22, module C determines whether the referenced data value of RAMa has become equal to or greater than a predetermined threshold value. If it is equal to or greater than the threshold value (YES), it proceeds to step S4 to update RAMb.
[0039] (Seventh Embodiment) The ECU 31 of the seventh embodiment shown in Figure 11 does not control the EPS system as in the first embodiment, but rather assumes a general-purpose configuration and controls the actuator 36. The actuator 36 is an example of a load. The ECU 31 is equipped with a microcontroller 32 that replaces the microcontroller 2. The configuration of the microcontroller 32 is basically the same as that of the microcontroller 2, but the contents of the programs stored in the ROM 33 and RAM 34 are different.
[0040] The input circuit 3 receives a sensor signal from the sensor 35. The microcontroller 32 controls the actuator 36 via the output circuit 4. In this way, if the actuator 36 is the controlled object, the "state in which a hazard cannot occur" in step S2 corresponds to the stopped state of the actuator 36.
[0041] This disclosure includes, in addition to the claims, the following disclosures: [1] In relation to the control of the controlled objects (15, 36), the system executes a low-priority program (module A) with a low functional safety level and high-priority programs (modules B, B1-B3) with a higher functional safety level than the low-priority program. A microcomputer comprising an arithmetic processing unit (module C) which, on the condition that the controlled object is in a non-operational state, determines whether there is a write request to the memory area (RAMb, RAMb1~b3) processed by the high-priority program for the content of the data written by the low-priority program, and if it determines that there is a write request, writes the target data to the memory area. [2] The microcomputer described in [1], wherein the arithmetic processing unit determines that the controlled object is in operation, and updates the data written by the low-priority program with a value that is safer than the data in controlling the controlled object. [3] The microcomputer described in [1] or [2], wherein the arithmetic processing unit writes the data to the memory area and then updates the data written by the low-priority program with a value that is safer than the data in the control of the controlled object. [4] The safe value is a data value indicating that there is no write request to the memory area [2] or [3] the microcomputer as described above. [5] The microcomputer described in any one of [1] to [4], wherein the functional safety level of the arithmetic processing unit is set to be higher than or equal to the functional safety level of the high-priority program. [6] When executing multiple high-priority programs (modules B1 to B3), The arithmetic processing unit is capable of writing to memory areas (RAMb1 to RAMb3) that are processed by the plurality of high-priority programs, according to the content of the data written by the low-priority program. This is the microcomputer described in any one of [1] to [5]. [7] The microcomputer described in [6] indicates whether or not there is a request to write to the aforementioned plurality of memory areas by a flag set in each of the plurality of bits in the data. [8] The microcomputer according to any one of [1] to [7], wherein the controlled object is a load mounted on a vehicle, and the non-operating state is the parked state of the vehicle. [9] The microcomputer according to any one of [1] to [8], wherein the controlled object is a power assist system for the steering wheel of a vehicle, and the non-operating state is a non-steering state of the steering wheel.
[10] The microcomputer described in any one of [1] to [7], wherein the controlled object is a load mounted on an aircraft, and the non-operating state is the parked state of the aircraft.
[11] The microcomputer described in any one of [1] to
[10] , wherein the controlled object is an actuator (36), and the non-operating state is the stopped state of the actuator.
[12] The microcomputer according to any one of claims 1 to 3, wherein whether or not there is a request to write to the memory area is indicated by a flag set in a specific bit in the data.
[13] When the value of the data written by the aforementioned low-priority program changes gradually, A microcomputer according to any one of [1] to
[12] , wherein whether or not there is a request to write to the memory area is indicated by the value of the data reaching a predetermined value.
[0042] (Other embodiments) When the microcontroller 2 controls the motor 15 of the EPS system, the "state in which a hazard cannot occur" is any state other than the "steering assist state".
[0043] Even when the controlled object is another load or actuator mounted on the vehicle, the state of the vehicle being parked can be considered a "state in which hazard lights cannot be generated." The controlled objects are not limited to loads mounted on the vehicle. Other specific examples of Step S2's "Is it a state where a hazard cannot occur?" include, for example, if the controlled object is a load mounted on an aircraft, the parked state would correspond, while if it is in flight, a hazard is considered possible. The importance of a program is not limited to the functional safety level of an automobile; it can also be applied to functional safety levels and access levels used in other embedded devices.
[0044] This disclosure is described in accordance with the embodiments, but it is understood that this disclosure is not limited to such embodiments or structures. This disclosure also includes various modifications and variations within the equivalence. In addition, various combinations and forms, as well as other combinations and forms that include only one, more, or fewer of those elements, fall within the scope and concept of this disclosure.
[0045] The means and / or functions provided by each device may be provided by software recorded in a physical memory device and a computer that runs it, by software alone, or by a combination of software and hardware.
[0046] The control unit and its method described herein may be implemented by a dedicated computer provided by configuring a processor and memory programmed to perform one or more functions embodied by a computer program. Alternatively, the control unit and its method described herein may be implemented by a dedicated computer provided by configuring a processor by one or more dedicated hardware logic circuits. Alternatively, the control unit and its method described herein may be implemented by one or more dedicated computers configured by a combination of a processor and memory programmed to perform one or more functions and a processor configured by one or more hardware logic circuits. Furthermore, the computer program may be stored as instructions executed by the computer on a computer-readable non-transitional tangible recording medium. [Explanation of Symbols]
[0047] In the diagram, 1 represents the ECU, 2 the microcomputer, 3 the input circuit, 4 the output circuit, 5 the CPU, 6 the ROM, 7 the RAM, and 15 the motor.
Claims
1. In relation to the control of the controlled objects (15, 36), the system executes a low-priority program (module A) with a low functional safety level and high-priority programs (modules B, B1 to B3) with a higher functional safety level than the low-priority program. A microcomputer comprising an arithmetic processing unit (module C) which, on the condition that the controlled object is in a non-operational state, determines whether there is a write request to the memory area (RAMb, RAMb1 to b3) processed by the high-priority program for the content of the data written by the low-priority program, and if it determines that there is a write request, writes the target data to the memory area.
2. The microcomputer according to claim 1, wherein, when the arithmetic processing unit determines that the controlled object is in operation, it updates the data written by the low-priority program with a value that is safer than the data in controlling the controlled object.
3. The microcomputer according to claim 1, wherein the arithmetic processing unit writes the data to the memory area, and then updates the data written by the low-priority program with a value that is safer than the data in the control of the controlled object.
4. The microcomputer according to claim 2 or 3, wherein the safe value is a data value indicating that there is no request to write to the memory area.
5. The microcomputer according to claim 1, wherein the functional safety level of the arithmetic processing unit is set to be equal to or higher than the functional safety level of the high-priority program.
6. When executing multiple high-priority programs (modules B1 to B3), The microcomputer according to claim 1, wherein the arithmetic processing unit is capable of writing to memory areas (RAMb1 to RAMb3) that are processed by the plurality of high-priority programs, respectively, according to the content of the data written by the low-priority program.
7. The microcomputer according to claim 6, wherein whether or not there is a request to write to the plurality of memory areas is indicated by a flag set in each of the plurality of bits in the data.
8. The microcomputer according to claim 1, wherein when the controlled object is a load mounted on a vehicle, the non-operating state is the parked state of the vehicle.
9. The microcomputer according to claim 1, wherein the controlled object is a power assist system for the steering wheel of a vehicle, and the non-operating state is a non-steering state of the steering wheel.
10. The microcomputer according to claim 1, wherein the controlled object is a load mounted on an aircraft, and the non-operating state is the parked state of the aircraft.
11. The microcomputer according to claim 1, wherein when the controlled object is an actuator (36), the non-operating state is the stopped state of the actuator.
12. The microcomputer according to any one of claims 1 to 3, wherein whether or not there is a request to write to the memory area is indicated by a flag set in a specific bit in the data.
13. When the value of the data written by the aforementioned low-priority program changes gradually, The microcomputer according to any one of claims 1 to 3, wherein whether or not there is a request to write to the memory area is indicated by the value of the data reaching a predetermined value.
Citation Information
Patent Citations
microcomputer
JP2016134082A
