CN-122018888-A - Multi-MCU bottom layer driving code generation method, system and equipment
Abstract
The application provides a method, a system and equipment for generating a multi-MCU bottom layer driving code, wherein the method comprises the steps of establishing an MCU resource library, wherein the MCU resource library comprises a plurality of MCU data folders, each MCU data folder comprises at least one MCU engineering template, a technical document and a data warehouse, acquiring a target MCU engineering template and a data warehouse, automatically analyzing a markdown file in the target MCU data warehouse to generate an interactive bottom layer driving configuration interface of the target MCU, acquiring user input parameters on the interactive bottom layer driving configuration interface, and converting the target MCU engineering template based on the user input parameters to obtain the bottom layer driving code of the target MCU. The application can realize the rapid generation of the multi-MCU bottom layer driving codes, reduce the threshold of developers, save the development time and reduce the development cost.
Inventors
- LUO SHA
- Liu changye
- HE LEI
- LI ZIHAN
- Ma Jueli
Assignees
- 上汽通用五菱汽车股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251231
Claims (10)
- 1. The method for generating the multi-MCU bottom layer driving code is characterized by comprising the following steps of: Establishing an MCU resource library, wherein the MCU resource library comprises a plurality of MCU data folders, and each MCU data folder comprises at least one engineering template, a technical document and a data warehouse of an MCU; Acquiring an engineering template and a data warehouse of a target MCU; Automatically analyzing a markdown file in a data warehouse of the target MCU to generate an interactive bottom layer drive configuration interface of the target MCU; acquiring user input parameters on the interactive bottom layer drive configuration interface; And converting the engineering template of the target MCU based on the user input parameters to obtain a bottom driving code of the target MCU.
- 2. The method for generating multi-MCU bottom layer driving code according to claim 1, wherein each MCU data folder further comprises a corresponding MCU chip identifier; Before acquiring the engineering template and the data warehouse of the target MCU, the method further comprises: Creating a bottom layer driving interface and acquiring a bottom layer driving configuration address; Performing folder traversal on the MCU resource library under the bottom layer drive configuration address to obtain MCU chip identifiers of each MCU data folder; Creating a plurality of button assemblies with the MCU chip identifiers on the bottom driving interface based on the MCU chip identifiers, wherein one button assembly corresponds to one MCU data folder; And determining a target MCU data folder according to the selected button component with the MCU chip identifier.
- 3. The method for generating the multi-MCU bottom layer driving code according to claim 2, wherein the obtaining the engineering template and the data warehouse of the target MCU comprises: Entering an MCU version configuration interface; The method comprises the steps of obtaining version configuration information of an MCU from a target MCU data folder and adding the version configuration information to an MCU version configuration interface, wherein the MCU version configuration interface comprises at least one version configuration information; Determining a target MCU according to the selected version configuration information; and acquiring an engineering template and a data warehouse of the target MCU.
- 4. The method for generating multi-MCU bottom-layer driver code according to claim 1, wherein said automatically parsing a markdown file in a data warehouse of said target MCU to generate an interactive bottom-layer driver configuration interface of said target MCU comprises: traversing a markdown file in a data warehouse of the target MCU; and generating an interactive bottom layer drive configuration interface of the target MCU according to the file number and the file name key information of the markdown file.
- 5. The method of claim 1, wherein after obtaining the user input parameters on the interactive base driver configuration interface, the method further comprises: obtaining a technical document of the target MCU; Detecting user input parameters of the interactive configuration interface according to preset rules in the technical document of the target MCU; and carrying out alarm reminding on the user input parameters which do not accord with the preset rules.
- 6. The method for generating multi-MCU bottom-level driver code of claim 1, wherein said converting the engineering template of the target MCU based on the user input parameters comprises: copying the engineering template of the target MCU to a specified path to obtain a copied engineering template file; Analyzing code generation rules in a markdown file of the target MCU; Generating code blocks conforming to specifications based on the user input parameters and the code generation rules; Identifying a preset identifier in the copy engineering template file; And inserting the code blocks into preset positions in the replication engineering template file or replacing original code blocks in the replication engineering template file according to the preset identifiers.
- 7. The method for generating multi-MCU bottom-level driver code of claim 1, further comprising: acquiring user input parameters on the interactive bottom layer drive configuration interface, and storing the user input parameters as a parameter configuration file, wherein the parameter configuration file can be imported to the interactive bottom layer drive configuration interface when a subsequent MCU bottom layer drive code is generated; Connecting an AI interface; uploading the markdown file and the parameter configuration file in the data warehouse of the target MCU so as to optimize the parameter configuration file through AI.
- 8. The method for generating multi-MCU bottom-level driver code of claim 1, further comprising: Connecting an AI interface; uploading the bottom layer driving code of the target MCU to test and/or generate code annotation on the bottom layer driving code of the target MCU through AI.
- 9. A multi-MCU bottom-level driver code generation system comprising: The system comprises a building module, a control module and a control module, wherein the building module is used for building an MCU resource library, the MCU resource library comprises a plurality of MCU data folders, and each MCU data folder comprises at least one engineering template, a technical document and a data warehouse of an MCU; the first acquisition module is used for acquiring the engineering template and the data warehouse of the target MCU; The generating module is used for automatically analyzing the markdown file in the data warehouse of the target MCU and generating an interactive bottom layer drive configuration interface of the target MCU; The second acquisition module is used for acquiring user input parameters on the interactive bottom layer drive configuration interface; And the conversion module is used for converting the engineering template of the target MCU based on the user input parameters to obtain a bottom driving code of the target MCU.
- 10. An electronic device, comprising: A processor; a memory; a communication unit for establishing a communication channel; and a computer program, wherein the computer program is stored in the memory, the computer program comprising instructions that, when executed by the processor, cause the electronic device to perform the method of any one of claims 1 to 10.
Description
Multi-MCU bottom layer driving code generation method, system and equipment Technical Field The application relates to the technical field of embedded system development, in particular to a method, a system and equipment for generating a multi-MCU bottom layer driving code. Background The bottom layer driving development of the current embedded vehicle-mounted controller is mainly realized by the following two technical paths, namely firstly, register-level parameterization configuration is carried out based on a special configuration tool (such as STM32cube MX of STMicroelectronics, processor Expert of NXP and the like) provided by MCU manufacturers, and an initialization code frame is automatically generated, and secondly, a hardware abstraction layer is realized by directly writing register operation instructions through manual analysis of MCU technical manuals. However, the existing method has the obvious technical limitations that firstly, unified hardware driving development standards are not formed in the industry, tool chains of different manufacturers have differences in interface definition and code architecture layers, so that a driving module is difficult to realize cross-MCU platform multiplexing, compatibility is achieved, secondly, about 37% of automobile-level MCUs are not provided with visual configuration tools, developers are forced to adopt a time-consuming and error-prone manual coding mode, tool deletion is achieved, thirdly, the traditional mode requires the developers to deeply master the external register mapping rules such as a specific MCU kernel architecture, an interrupt mechanism, a timer/PWM and the like, the technical threshold is too high, and the development efficiency of the developers is low. These technical constraints directly lead to a 15% -22% extension of the development cycle of the automotive electronics system, and generate a large amount of redundant development workload in the multi-MCU heterogeneous hardware architecture adaptation scenario, severely restricting the rapid iterative evolution of the intelligent automotive electronics system. Disclosure of Invention Therefore, the application provides a method, a system and equipment for generating a multi-MCU bottom driving code. According to the application, the multiple MCUs are configured into the unified interface through the interactive bottom layer drive configuration interface, so that a developer does not need to know the bottom layer hardware difference of each chip in depth, and the quick generation of the bottom layer drive codes of the MCUs can be realized. In a first aspect, an embodiment of the present application provides a method for generating a multi-MCU bottom layer driving code, including: Establishing an MCU resource library, wherein the MCU resource library comprises a plurality of MCU data folders, and each MCU data folder comprises at least one engineering template, a technical document and a data warehouse of an MCU; Acquiring an engineering template and a data warehouse of a target MCU; Automatically analyzing a markdown file in a data warehouse of the target MCU to generate an interactive bottom layer drive configuration interface of the target MCU; acquiring user input parameters on the interactive bottom layer drive configuration interface; And converting the engineering template of the target MCU based on the user input parameters to obtain a bottom driving code of the target MCU. In one possible implementation manner, each MCU data folder further includes a corresponding MCU chip identifier; Before acquiring the engineering template and the data warehouse of the target MCU, the method further comprises: Creating a bottom layer driving interface and acquiring a bottom layer driving configuration address; Performing folder traversal on the MCU resource library under the bottom layer drive configuration address to obtain MCU chip identifiers of each MCU data folder; Creating a plurality of button assemblies with the MCU chip identifiers on the bottom driving interface based on the MCU chip identifiers, wherein one button assembly corresponds to one MCU data folder; And determining a target MCU data folder according to the selected button component with the MCU chip identifier. In one possible implementation manner, the obtaining the engineering template and the data warehouse of the target MCU includes: Entering an MCU version configuration interface; The method comprises the steps of obtaining version configuration information of an MCU from a target MCU data folder and adding the version configuration information to an MCU version configuration interface, wherein the MCU version configuration interface comprises at least one version configuration information; Determining a target MCU according to the selected version configuration information; and acquiring an engineering template and a data warehouse of the target MCU. In one possible implementation manner, the automatically parsin