Method for solving problem of distortion of AD data acquired by MCU caused by rmsg communication under multi-core isomerism

By using soft interrupts to replace RPMSG communication in a multi -core heterogeneous system, the problem of MCU collection AD data distortion is solved, and faster and accurate data acquisitions are achieved, suitable for low -performance core multi -core heterogeneous systems.

CN119376978AActive Publication Date: 2025-01-28TRONLONG
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411469968.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-28
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

In multi-core heterogeneous systems, rpmsg communication causes distortion in MCU for AD data acquisition, which is mainly due to the long time spent on communication of low-performance cores, resulting in untimely data acquisition.

Method used

Use soft interruption instead of the RPMSG nuclear interruption function to achieve communication between cores. After the MCU module collects AD data, read the data from the shared memory through a soft interrupt notification Linux system.

Benefits of technology

A significant reduction of the time -consuming time to initiate nuclear communication in the low performance core of the multi -core heterogeneous system, enabling the MCU to collect the next AD data of the next sampling point in time, solve the problem of data distortion, and ensure the accuracy of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376978A_ABST
    Figure CN119376978A_ABST
Patent Text Reader

Abstract

The invention discloses a method for solving distortion of AD data acquired by an MCU (Microprogrammed Control Unit) caused by rmsg communication under multi-core isomerism, a Softirq soft interrupt is adopted to replace an rmsg inter-core interrupt function to realize inter-core communication, compared with an rmsg framework with complicated program hierarchy, the program hierarchy of the soft interrupt is simple, the inter-core interrupt can be realized, and the communication efficiency is greatly improved. Therefore, the soft interrupt is suitable for low-performance core operation, the time consumed for initiating inter-core communication by the low-performance core of the multi-core heterogeneous system can be greatly reduced by adopting the soft interrupt, and the MCU can timely collect AD data of a next sampling point, so that the problem of distortion of the AD data collected by the MCU is well solved; accuracy of the acquired AD data is guaranteed, and a reliable MCU AD data acquisition scheme under multi-core isomerism is provided for an industrial AD data acquisition application scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multi-core heterogeneous technology, and in particular to a method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneous conditions. Background Art

[0002] In recent years, with the development of embedded chip technology, more and more embedded processors use multi-core heterogeneous design. Multi-core heterogeneity means that there are multiple cores in a SOC (system on chip), and all cores are not of the same type (the architecture and instruction set are not the same), and the performance varies greatly: Take the Rockchip RK3562 chip as an example, its internal 4 Cortex-A53 cores are specially designed for high-performance computing, while the other Cortex-M0 core is designed for simple computing and low power consumption; such a design can better balance the overall performance and power consumption of the SOC.

[0003] Since the logic of AD data collection program is not complex and needs to occupy the CPU for a long time, low-performance and low-power cores are preferred for AD data collection on multi-core heterogeneous systems. The collected AD data often needs to be further processed, such as storage, display, calculation and analysis, so it needs to be operated based on the operating system. The core of the operation is generally the high-performance core inside the SOC. The high-performance core and low-performance core of the SOC core need to communicate to obtain the AD data collected by the MCU.

[0004] The existing multi-core heterogeneous AD acquisition system based on the Rockchip RK3562 platform has four Cortex-A53 cores running the Linux system, and its Cortex-M0 core running the bare-metal program for collecting AD data. The communication and interruption between the cores are implemented based on the rpmsg framework: the MCU collects AD data, caches it in the shared memory, and initiates the rpmsg notification after collecting all the specific sampling points. After receiving the rpmsg notification, the Linux system reads the AD data from the shared memory and processes it. However, due to the low performance of the MCU and the complex program level of the rpmsg framework, rpmsg is not suitable for low-performance cores, resulting in a long communication time when the MCU initiates the rpmsg notification, which will interrupt the MCU for too long to collect AD data, that is, the MCU cannot collect the AD data of the next sampling point in time, which easily leads to the problem of distortion of the AD data collected by the low-performance MCU. Summary of the invention

[0005] 1. Technical issues to be resolved

[0006] In view of the deficiencies in the prior art, the present invention provides a method for solving the problem of distortion of AD data collected by MCU caused by rpmsg communication in a multi-core heterogeneous system, which can solve the problem of distortion of AD data collected by MCU in a multi-core heterogeneous system.

[0007] (II) Technical solution

[0008] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for solving the problem that MCU collects AD data distortion caused by rpmsg communication under multi-core heterogeneity, comprising the following steps:

[0009] S1, MCU module collects AD data; wherein, the MCU module runs on the first core;

[0010] S2, MCU module caches AD data in shared memory;

[0011] S3, the MCU module initiates a soft interrupt notification to the Linux system. After the soft interrupt notification is initiated, the MCU module continues to collect new AD data; wherein, the Linux system runs on the second core;

[0012] S4, Linux system receives soft interrupt notification;

[0013] S5. The Linux system reads AD data from the shared memory.

[0014] Preferably, the MCU module includes an AD data acquisition unit; step S1 specifically comprises: the AD data acquisition unit acquires AD data from the AD sampling chip.

[0015] Preferably, the MCU module further includes a first shared memory management unit; step S2 specifically comprises: the AD data acquisition unit caches the AD data in the shared memory through the first shared memory management unit.

[0016] Preferably, the MCU module further includes a soft interrupt control unit; step S3 specifically includes: after the AD data acquisition unit acquires AD data of a full specific sampling point, the soft interrupt control unit initiates a soft interrupt notification to the Linux system through the interrupt controller.

[0017] Preferably, the Linux system includes a soft interrupt driving unit; step S4 specifically comprises: the soft interrupt driving unit receives a soft interrupt notification through an interrupt controller.

[0018] Preferably, the Linux system further includes a Linux application unit and a second shared memory management unit; step S5 specifically comprises: after the soft interrupt driving unit receives the soft interrupt notification, the Linux application unit drives the second shared memory management unit to read the AD data from the shared memory.

[0019] Preferably, after step S5, the method further includes step S6: the Linux system processes the AD data.

[0020] Preferably, step S6 specifically includes: the Linux system stores, displays or calculates and analyzes the AD data.

[0021] (III) Beneficial effects

[0022] Compared with the prior art, the present invention provides a method for solving the problem that rpmsg communication in a multi-core heterogeneous system causes distortion of AD data collected by an MCU, and has the following beneficial effects: compared with the prior art that uses an rpmsg framework to implement inter-core communication and inter-core interrupt, the present invention uses a soft interrupt to replace the rpmsg inter-core interrupt function to implement communication between cores. Compared with the rpmsg framework with a more complicated program hierarchy, the program hierarchy of the soft interrupt is simple enough to implement inter-core interrupt, so the soft interrupt is suitable for low-performance core operation. By adopting the soft interrupt, the present invention can greatly reduce the time consumption of the low-performance core of the multi-core heterogeneous system to initiate inter-core communication, so that the MCU can collect the AD data of the next sampling point in time, thereby better solving the problem of distortion of the AD data collected by the MCU, ensuring the accuracy of the collected AD data, and providing a reliable MCU AD data collection solution in a multi-core heterogeneous system for industrial AD data collection application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A flowchart of a method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity according to the present invention;

[0024] Figure 2 The present invention is a principle block diagram of a method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] The present invention provides a method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity, comprising the following steps:

[0027] S1, MCU module collects AD data.

[0028] The MCU (Microcontroller Unit) module runs on the first core.

[0029] Specifically, the MCU module includes an AD data acquisition unit; the step S1 specifically includes: the AD data acquisition unit acquires AD data from the AD sampling chip, wherein the AD data is digital signal data.

[0030] S2. The MCU module caches the AD data in the shared memory.

[0031] Preferably, the MCU module further includes a first shared memory management unit; step S2 specifically includes: the AD data acquisition unit caches the AD data in the shared memory through the first shared memory management unit. The shared memory specifically can use DDR (double data rate synchronous dynamic random access memory).

[0032] S3, the MCU module initiates a soft interrupt (Softirq) notification to the Linux system; after the soft interrupt notification is initiated, the MCU module continues to collect new AD data, that is, the MCU module continues to collect AD data of the next sampling point, and repeats the cycle.

[0033] The Linux system runs on the second core. Specifically, the first core is a low-performance power consumption core, and the second core is a high-performance core; the first core can be a Cortex-M0 core, and the second core can be a Cortex-A53 core. The first core and the second core can exist in a multi-core heterogeneous system of the Rockchip RK3562 chip; of course, the first core and the second core can also use cores of different types and different performances of other embedded processors in the prior art, and no excessive restrictions are made here.

[0034] The above-mentioned MCU module also includes a soft interrupt control unit; the step S3 specifically includes: after the AD data acquisition unit acquires AD data of a full specific sampling point, the soft interrupt control unit initiates a soft interrupt notification to the Linux system through the interrupt controller.

[0035] S4. The Linux system receives a soft interrupt notification.

[0036] Specifically, the Linux system includes a soft interrupt driving unit; step S4 specifically includes: the soft interrupt driving unit receives the soft interrupt notification through the interrupt controller, that is, the Linux system waits to receive the soft interrupt notification through the soft interrupt driving unit.

[0037] S5. The Linux system reads AD data from the shared memory.

[0038] Preferably, the Linux system further includes a Linux application unit and a second shared memory management unit; the step S5 specifically comprises: after the soft interrupt driving unit receives the soft interrupt notification, the Linux application unit drives the second shared memory management unit to read the AD data from the shared memory.

[0039] Among them, when the Linux system receives the soft interrupt notification initiated by the MCU module, the Linux system immediately terminates its running program and switches to processing the program event corresponding to the soft interrupt notification: that is, the Linux system reads the AD data from the shared memory.

[0040] It can be understood that the present invention realizes communication with the Linux system in the MCU module (i.e., the MCU bare metal program) by building a simple Softirq soft interrupt control code and combining shared memory to replace the rpmsg framework. In the Linux system, a Softirq soft interrupt driver and a shared memory management program are built based on the character device framework, and the Linux application is cooperated to realize communication with the MCU bare metal program. The above-mentioned MCU module and Linux system correspond to the software layer, while the first core, the second core, the shared memory, the interrupt controller, and the AD sampling chip correspond to the hardware layer.

[0041] It should be understood that (1) at one end of the Cortex-M0 core, i.e., the first core (running the MCU bare metal program): since only a register needs to be written to initiate a Softirq soft interrupt, the control process is simple; the present invention uses the Softirq soft interrupt method to replace the existing rpmsg for inter-core communication, which can avoid the problem of requiring memory application and code call chain length in the more complex rpmsg communication process; (2) at one end of the Cortex-A53 core, i.e., the second core (running the Linux system): the soft interrupt driver unit is composed of an interrupt response code + a notification application unit code after responding to the interrupt, thereby avoiding the more complex process of interrupt + queuing data processing used in the rpmsg communication process, and reducing the time consumption of inter-core communication. Combining the optimization of the above two points (1) and (2), it is found through actual measurement that the soft interrupt used in the present invention can reduce the time consumption of inter-core communication by about 100 μs compared with the prior art based on the rpmsg framework.

[0042] Preferably, after the Linux system successfully completes the reading of the AD data, the Linux system may send a response result of the soft interrupt notification to the MCU module.

[0043] In addition, after step S5, step S6 is also included: the Linux system processes the AD data; specifically, the Linux system performs processing operations such as storage, display or calculation and analysis on the AD data.

[0044] Preferably, the above-mentioned soft interrupt notification may include the specific cache address of the AD data in the shared memory, so that the Linux system can accurately read the AD data from the shared memory accordingly. In addition, in order to better solve the problem of AD data distortion, the AD data acquisition unit of the MCU module can also be connected to the resource management unit of the third core. When the MCU module initiates the above-mentioned soft interrupt notification, the resource management unit provides the AD data acquisition unit with the idle resources of the third core, so that the AD data acquisition unit can continue to normally collect AD data from the AD sampling chip during the initiation of the soft interrupt notification; and after the soft interrupt notification is initiated, the resource management unit stops providing the idle resources of the third core to the AD data acquisition unit.

[0045] Compared with the prior art, the present invention provides a method for solving the problem that rpmsg communication in a multi-core heterogeneous system causes distortion of AD data collected by an MCU, and has the following beneficial effects: compared with the prior art that uses an rpmsg framework to implement inter-core communication and inter-core interrupt, the present invention uses a soft interrupt to replace the rpmsg inter-core interrupt function to implement communication between cores. Compared with the rpmsg framework with a more complicated program hierarchy, the program hierarchy of the soft interrupt is simple enough to implement inter-core interrupt, so the soft interrupt is suitable for low-performance core operation. By adopting the soft interrupt, the present invention can greatly reduce the time consumption of the low-performance core of the multi-core heterogeneous system to initiate inter-core communication, so that the MCU can collect the AD data of the next sampling point in time, thereby better solving the problem of distortion of the AD data collected by the MCU, ensuring the accuracy of the collected AD data, and providing a reliable MCU AD data collection solution in a multi-core heterogeneous system for industrial AD data collection application scenarios.

[0046] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0047] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity, characterized in that: The following steps are involved: S1, MCU module collects AD data; wherein, the MCU module runs on the first core; S2, the MCU module caches the AD data in a shared memory; S3, the MCU module initiates a soft interrupt notification to the Linux system, and the MCU module continues to collect new AD data after the soft interrupt notification is initiated; wherein the Linux system runs on the second core; S4, the Linux system receives the soft interrupt notification; S5. The Linux system reads the AD data from the shared memory.

2. The method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity according to claim 1 is characterized in that: The MCU module includes an AD data acquisition unit; the step S1 specifically includes: the AD data acquisition unit acquires the AD data from an AD sampling chip.

3. The method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity according to claim 2 is characterized in that: The MCU module also includes a first shared memory management unit; the step S2 specifically includes: the AD data acquisition unit caches the AD data in the shared memory through the first shared memory management unit.

4. The method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity according to claim 3 is characterized in that: The MCU module also includes a soft interrupt control unit; the step S3 specifically includes: after the AD data acquisition unit acquires the AD data of a full specific sampling point, the soft interrupt control unit initiates the soft interrupt notification to the Linux system through an interrupt controller.

5. The method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity according to claim 4 is characterized in that: The Linux system includes a soft interrupt driving unit; the step S4 specifically includes: the soft interrupt driving unit receives the soft interrupt notification through the interrupt controller.

6. The method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity according to claim 5 is characterized in that: The Linux system also includes a Linux application unit and a second shared memory management unit; the step S5 is specifically: after the soft interrupt driving unit receives the soft interrupt notification, the Linux application unit drives the second shared memory management unit to read the AD data from the shared memory.

7. The method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity according to claim 1 is characterized in that: The method further includes step S6 after step S5: the Linux system processes the AD data.

8. The method for solving the problem of MCU collecting AD data distortion caused by rpmsg communication under multi-core heterogeneity according to claim 7 is characterized in that: The step S6 specifically includes: the Linux system stores, displays or calculates and analyzes the AD data.

Citation Information

Patent Citations

  • Chip and communication method of implementing communicating between multi-kernel in chip and communication method

    CN101000596A

  • Inter-core message communication method for multi-core multithread processor

    CN101266561A

  • Communication method between real-time operating system and non-real-time operating system on multi-core processor

    CN103942178A

  • PCI (Programmable Communication Interface) bus data synchronization method based on RTX (Real Time eXpert) real-time extending subsystem

    CN104239250A

  • Multi-core communication system of ultrasonic radar and using method

    CN113325398A