A method and system for MCU pin configuration and ARXML generation based on the Excel platform

By using a VBA-Python architecture based on the Excel platform, the automatic import of MCU pin resources and the automatic generation of ARXML configuration files are realized, solving the problems of low efficiency and human error in MCU pin configuration, and enabling collaborative design and automated configuration between hardware and software engineers.

CN122311083APending Publication Date: 2026-06-30南京宁橡新能源汽车电子有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
南京宁橡新能源汽车电子有限公司
Filing Date
2026-05-12
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In existing technologies, the MCU pin configuration process is inefficient and error-prone, resulting in high communication costs between hardware and software engineers and a lack of automation and collaborative design methods.

Method used

A three-tier architecture based on the Excel platform is adopted. By combining VBA and Python, the automatic import, intelligent verification, and automatic generation of ARXML configuration files of MCU pin resources are realized. The functional modules include MCU selection and resource import, pin configuration and verification, and ARXML generation. The Excel-VBA-Python architecture realizes the co-design of hardware and software.

Benefits of technology

It improves the efficiency of MCU pin configuration, reduces human error, lowers communication costs between hardware and software engineers, and automates and automates pin configuration. The generated ARXML file can be directly used with EB and VectorDavinci tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122311083A_ABST
    Figure CN122311083A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for MCU pin configuration and ARXML generation based on the Excel platform. It automatically parses the MCU chip manual using Python and builds a pin resource library, enabling one-click import of pin data. Utilizing VBA, it achieves dynamic management and intelligent verification of configuration items, supporting error aggregation and location redirection. It also automatically maps configuration data to AUTOSAR standard ARXML files. This invention unifies hardware and software data sources, significantly reduces human error, and improves the efficiency of pin configuration and file generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and system for MCU pin configuration and ARXML generation based on the Excel platform. Background Technology

[0002] In modern cars, there are dozens or even hundreds of electronic control units (ECUs). Each MCU has a large number of physical pins (ports), and different functions (such as GPIO, ADC, SPIMISO, etc.) are achieved by configuring the pin attributes.

[0003] The current industry standard for MCU pin configuration development is as follows: Hardware engineers first manually collect the attribute information of all pins from the chip datasheet and create a hardware interface specification table in Excel or PDF format, detailing the function and initial state of each pin. Then, the table is handed over to the software engineer, who uses AUTOSAR tools such as EB and VectorDavinci to manually find the corresponding physical pins and configure their functional parameters one by one. After verification, the configuration code is generated.

[0004] Whether hardware engineers manually collect pin (port) attribute information from chip manuals to create hardware interface specification tables, or software engineers manually configure pins (ports) according to tables provided by hardware engineers, this process is inefficient, error-prone, time-consuming, and labor-intensive.

[0005] Therefore, there is an urgent need for a system and method that can automate MCU pin configuration and enable hardware and software co-design to solve the above-mentioned problems in the existing technology. Summary of the Invention

[0006] The main objective of this invention is to provide a method and system for MCU pin configuration and ARXML generation based on the Excel platform. This aims to achieve automatic import, intelligent verification, and automatic generation of ARXML configuration files for MCU pin resources, thereby improving development efficiency, reducing human error, and enabling collaborative design between hardware and software engineers.

[0007] To achieve the above objectives, this invention proposes a method for MCU pin configuration and ARXML generation based on the Excel platform, which includes: Step S1: Select the target MCU model in the Excel interactive interface. The VBA business logic control layer calls the Python core algorithm engine layer to parse the corresponding MCU chip manual to extract pin resource data. After data cleaning and structuring, an MCU resource database is generated. The original pin data is mapped to common hardware terms and imported into Excel to generate a visual pin configuration matrix. Step S2: Configure pin attribute parameters in the Excel pin configuration matrix. The VBA layer dynamically monitors the configuration data and enables or disables the corresponding configurable items according to the current configuration characteristics of the pin. At the same time, the VBA layer calls the Python layer to perform hierarchical verification of the configuration data based on the preset Port verification rule library. When the verification fails, multiple error messages of the same pin are aggregated and displayed, the error level is marked and a one-click jump function to the error location is provided. Step S3: After the configuration verification is passed, the ARXML generation command is triggered in the Excel interface. The VBA layer calls the Python layer to read the valid configuration data in the Excel, and the configuration data is mapped one by one to the ARXML nodes according to the preset AUTOSAR metamodel mapping rules to generate the ARXML configuration file.

[0008] In one embodiment, the step of parsing the corresponding MCU chip manual to extract pin resource data specifically includes: Based on the X / Y coordinates and spacing of the text, the blank gaps in the text lines are identified as potential column separators using the kernel density estimation method. Then, the rows are aggregated to extract pin resource data. After outlier handling of the extracted data, an MCU resource database in both Excel and JSON formats is generated. When a user requests to import MCU resources, the Python layer reads the database and processes the pin data in batches, caching the parsed data to avoid redundant calculations.

[0009] In one embodiment, the step of performing hierarchical verification of configuration data based on a preset Port verification rule base specifically includes: An internal index is created for the column to be validated, and a successive matching validation is performed, from simple to complex and from overall to individual configurations.

[0010] In one embodiment, errors of different levels in the verification results are marked with different colors, and the error information is linked to the corresponding original configuration cell in Excel via hyperlinks.

[0011] In one embodiment, the step of aggregating and displaying multiple error messages for the same pin when the verification fails, marking the error level, and providing a one-click jump function to the error location specifically includes: Based on the current direction attribute of the pin, automatically enable or disable the corresponding input and output configuration items, and gray out unsupported configuration items to avoid invalid configuration.

[0012] In one embodiment, the method further includes: When an illegal operation is performed or an exception occurs during the operation of the core algorithm, the Python layer catches the exception and passes the error information to the VBA layer. The Excel interface then displays the error message and guides the user to perform the correct operation.

[0013] In addition, the present invention also provides an MCU pin configuration and ARXML generation system based on the Excel platform, characterized in that it is implemented by the method described above, including a hardware engineer function module, a software engineer function module, and a system setting and maintenance module; The hardware engineer functional module includes an MCU selection and resource import unit and a pin configuration and verification unit. The software engineer functional module includes an ARXML configuration generation unit; The system setup and maintenance module includes an MCU model library management unit, a template management unit, and a verification rule configuration unit.

[0014] In the technical solution of this invention, a unified Excel configuration data source is used to realize the automatic transfer of hardware configuration to software configuration, which avoids the problem of inconsistent information and greatly reduces the communication cost between hardware and software engineers. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0016] Figure 1 This is a flowchart illustrating the MCU pin configuration and ARXML generation method based on the Excel platform according to an embodiment of the present invention. Figures 2-6 This is a schematic diagram of a specific embodiment of the present invention.

[0017] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0019] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0020] This invention provides a method for MCU pin configuration and ARXML generation based on the Excel platform.

[0021] like Figure 1 As shown, the MCU pin configuration and ARXML generation system based on the Excel platform described in this invention is mainly divided into three functional modules: a hardware engineer module, a software engineer module, and a system setup and maintenance module. The hardware engineer module includes an MCU selection and resource import unit and a pin configuration and verification unit; the software engineer module includes an ARXML configuration generation unit; and the system setup and maintenance module includes an MCU model library management unit, a template management unit, and a verification rule configuration unit.

[0022] In this application, the present invention adopts a three-tier architecture of Excel-VBA-Python: The Excel user interface layer provides a visual operation interface, including an MCU model selection drop-down list, a pin configuration matrix, function buttons (import data, reset, verify, generate ARXML, etc.), a verification result display area, and an ARXML generation result display area. The Excel interface is intuitive and easy to use, allowing hardware and software engineers to quickly get started without additional training.

[0023] The VBA business logic control layer acts as a bridge between the Excel interface and the Python engine, handling all user interaction events. When a user clicks a function button, VBA clears the old data cache, calls the corresponding Python script, and displays the results returned by Python on the Excel interface. VBA also implements dynamic interactive effects, such as enabling / disabling configuration items based on pin configuration status, color-coding error messages, and hyperlink navigation.

[0024] The Python core algorithm engine layer is responsible for executing all complex data processing and algorithmic logic, including MCU chip manual parsing, pin resource data structuring, configuration rule validation, and ARXML file generation. Python has powerful data analysis and file processing capabilities, enabling it to efficiently complete these tasks.

[0025] Furthermore, such as Figures 2-6 As shown in this application, the system administrator pre-adds the target MCU model (such as InfineonTC333_TQFP) through the MCU model library management unit and uploads the corresponding chip manual PDF file.

[0026] The Python engine uses the Camelot library's stream mode to parse the pinout in the chip datasheet. Specifically, Camelot uses kernel density estimation to identify blank spaces between text lines as potential column separators based on the X / Y coordinates and spacing of the text. It then aggregates adjacent lines to extract the complete pinout data.

[0027] Python cleans and structures the extracted raw data, including removing blank lines, correcting formatting errors, and handling abnormal data. The processed data is then saved as an MCU resource database in both Excel and JSON formats. The database contains information such as the pin number, name, default function, supported function modes, and electrical characteristics for each pin.

[0028] The hardware engineer opens Excel, selects "TC333_TQFP" from the MCU model selection drop-down list, and then clicks the "ImportMCUResource" button.

[0029] After receiving the user's instruction, VBA calls a Python script to read the MCU resource database corresponding to TC333_TQFP. Python maps the raw pin data in the database to terms commonly used by hardware engineers (e.g., mapping "Port0,Pin0" to "P00.0"), and performs batch processing on large amounts of data in blocks, while caching the parsed data to avoid redundant calculations.

[0030] Python returns the processed pin data to VBA, which then generates a visual pin configuration matrix in Excel. The configuration matrix includes columns for pin number, pin name, initialization mode, input pull-up / pull-down, output drive strength, network name, and peripheral function. Hardware engineers can select the attribute parameters for each pin using drop-down menus.

[0031] Furthermore, VBA monitors data changes in the configuration matrix in real time. When a hardware engineer modifies the direction attribute of a pin (e.g., changing it from input to output), VBA automatically enables output-related configuration items (such as output drive strength and output level) and disables input-related configuration items (such as input pull-up / pull-down), graying out unsupported configuration items to avoid invalid configurations.

[0032] After the hardware engineer completes the initial configuration, click the "Validation" button to trigger the validation function.

[0033] VBA calls a Python script to perform configuration verification. Python first reads a preset port verification rule library, which is formulated based on the inherent characteristics of the TC333_TQFP chip (such as certain pins can only be used as inputs, certain peripheral functions can only be assigned to specific pins, etc.) and specific restrictions of the hardware design.

[0034] Python builds an internal index for the columns to be verified and uses a successive matching verification method, from simple to complex and from overall to individual configurations, which greatly improves verification efficiency. For example, it first verifies whether the numbers of all pins are unique, then verifies whether the functional mode of each pin is within the range supported by the chip, and finally verifies whether there are any conflicts in the allocation of peripheral functions.

[0035] After validation is complete, Python returns the validation result to VBA. If errors are found, VBA will display error messages on the "ValidationResult" page of Excel, such as... Figure 5 As shown, multiple errors on the same pin are aggregated and displayed to avoid information overload; different levels of errors (such as critical errors and warnings) are marked with different colors; each error message contains a hyperlink, which, when clicked, can jump to the corresponding original configuration cell in Excel, making it convenient for hardware engineers to make quick modifications.

[0036] After modifying the configuration based on the error message, the hardware engineer clicks the "Validation" button again to verify the configuration until all configurations pass the verification.

[0037] Once the configuration verification is successful, the software engineer sets parameters such as the ARXML file generation path, MCAL package name, and component name in the Excel interface, and then clicks the "Generate" button to trigger the ARXML generation function.

[0038] VBA calls a Python script to read valid configuration data from an Excel file. Python maps the configuration data in Excel to ARXML nodes one-to-one according to a predefined AUTOSAR metamodel mapping rule. For example, it maps pin numbers to... <short-name>Nodes that map the initial pattern to<INITIAL_MODE> The node maps the input dropdown / dropdown to...<INPUT_PULL_CONFIGURATION> node, <parameter-values>Nodes, etc.

[0039] Python uses the xml.etree.ElementTree (ETree) library to create the root node and child nodes of ARXML, dynamically generating configuration files that conform to the AUTOSAR standard. The generation process supports adaptation to multiple versions of the AUTOSAR standard, and users can select different versions of AUTOSAR templates through the template management unit.

[0040] After the ARXML file is generated, Python returns the result to VBA. VBA then displays the generated file path and the number of pins for each PortContainer in an Excel interface. Figure 6 As shown.

[0041] The generated port_cfg.arxml file can be directly imported into EB projects or VectorDavinci tools. Software engineers can use this configuration file to generate MCU pin driver code without making any manual modifications.

[0042] In addition, in this application, the system administrator can add new MCU models, upload the corresponding chip manuals, and Python will automatically parse the chip manuals and update the MCU resource database; or delete MCU models that are no longer in use, or update the chip manual data of existing MCU models.

[0043] It also allows importing different versions of AUTOSAR templates, editing the metamodel mapping rules in the templates, or deleting outdated templates to meet the AUTOSAR version requirements of different projects.

[0044] Furthermore, system administrators can customize, add, modify, and delete Port verification rules according to the hardware design requirements of different projects, making the verification function more flexible and applicable.

[0045] Understandably, during system operation, if the user performs an illegal operation (such as clicking the generate button without importing MCU resources) or the Python core algorithm malfunctions (such as chip datasheet parsing failure or insufficient file write permissions), Python will catch the exception and pass detailed error information to the VBA layer. The VBA layer will then display the error message in the Excel interface and guide the user to perform the correct operation, preventing system crashes or data loss.

[0046] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made under the concept of the present invention using the contents of the present invention specification and drawings, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. An MCU pin configuration and ARXML generation method based on an Excel platform, characterized in that, The method is applied to an Excel-VBA-Python three-tier architecture, and the MCU pin configuration and ARXML generation method based on the Excel platform includes: Step S1: Select the target MCU model in the Excel interactive interface. The VBA business logic control layer calls the Python core algorithm engine layer to parse the corresponding MCU chip manual to extract pin resource data. After data cleaning and structuring, an MCU resource database is generated. The original pin data is mapped to common hardware terms and imported into Excel to generate a visual pin configuration matrix. Step S2: Configure pin attribute parameters in the Excel pin configuration matrix. The VBA layer dynamically monitors the configuration data and enables or disables the corresponding configurable items according to the current configuration characteristics of the pin. At the same time, the VBA layer calls the Python layer to perform hierarchical verification of the configuration data based on the preset Port verification rule library. When the verification fails, multiple error messages of the same pin are aggregated and displayed, the error level is marked and a one-click jump function to the error location is provided. Step S3: After the configuration verification is passed, the ARXML generation command is triggered in the Excel interface. The VBA layer calls the Python layer to read the valid configuration data in the Excel, and the configuration data is mapped one by one to the ARXML nodes according to the preset AUTOSAR metamodel mapping rules to generate the ARXML configuration file.

2. The Excel platform-based MCU pin configuration and ARXML generation method according to claim 1, characterized in that, The specific steps for extracting pin resource data from the corresponding MCU chip manual are as follows: Based on the X / Y coordinates and spacing of the text, the blank gaps in the text lines are identified as potential column separators using the kernel density estimation method. Then, the rows are aggregated to extract pin resource data. After outlier handling of the extracted data, an MCU resource database in both Excel and JSON formats is generated. When a user requests to import MCU resources, the Python layer reads the database and processes the pin data in batches, caching the parsed data to avoid redundant calculations.

3. The Excel platform-based MCU pin configuration and ARXML generation method according to claim 1, characterized in that, The specific steps for performing hierarchical verification of configuration data based on a preset Port verification rule base are as follows: An internal index is created for the column to be validated, and a successive matching validation is performed, from simple to complex and from overall to individual configurations.

4. The MCU pin configuration and ARXML generation method based on the Excel platform according to claim 3, characterized in that, In the verification results, errors of different levels are marked with different colors, and the error information is linked to the corresponding original configuration cell in Excel via hyperlinks.

5. The MCU pin configuration and ARXML generation method based on the Excel platform according to claim 1, characterized in that, The steps for aggregating and displaying multiple error messages for the same pin when the verification fails, marking the error level, and providing a one-click jump function to the error location are as follows: Based on the current direction attribute of the pin, automatically enable or disable the corresponding input and output configuration items, and gray out unsupported configuration items to avoid invalid configuration.

6. The MCU pin configuration and ARXML generation method based on the Excel platform according to claim 1, characterized in that, The method further includes: When an illegal operation is performed or an exception occurs during the operation of the core algorithm, the Python layer catches the exception and passes the error information to the VBA layer. The Excel interface then displays the error message and guides the user to perform the correct operation.

7. A system for MCU pin configuration and ARXML generation based on the Excel platform, characterized in that, The method described in any one of claims 1-6 is used, comprising a hardware engineer function module, a software engineer function module, and a system setup and maintenance module; The hardware engineer functional module includes an MCU selection and resource import unit and a pin configuration and verification unit. The software engineer functional module includes an ARXML configuration generation unit; The system setup and maintenance module includes an MCU model library management unit, a template management unit, and a verification rule configuration unit.