Peripheral parameter configuration method, peripheral parameter configuration system and processing device

By directly converting the configuration information into binary data in the peripheral parameter configuration system and adding it to the binary file, the target device is configured at startup, which solves the tedious and time-consuming problem of the traditional configuration process and achieves fast and automatic peripheral configuration. Parameter configuration improves chip iteration and adjustment speed.

CN118567669APending Publication Date: 2024-08-30KTMICRO ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410812055.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The traditional peripheral parameter configuration process is cumbersome and error-prone, requiring developers with deep hardware knowledge to manually implement it, and updating configurations is time-consuming and inefficient, limiting rapid iteration and the speed at which non-developers can adjust chip configurations.

Method used

Provide a peripheral parameter configuration method and system that receives the peripheral configuration information of the target device through the host computer, generates binary data and directly adds it to the binary file. The target device reads the file for configuration when starting, avoiding the compilation process. Improve configuration speed and automation.

Benefits of technology

It reduces compilation time and manual configuration time, increases chip iteration speed and non-developers’ adjustment speed to hardware requirements, realizes automatic configuration of peripheral parameters, simplifies the configuration process, and improves production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567669A
    Figure CN118567669A
Patent Text Reader

Abstract

The embodiment of the invention provides a peripheral parameter configuration method, a peripheral parameter configuration system and a processing device.The peripheral parameter configuration system comprises an upper computer and a target device.The method comprises the steps that the upper computer receives peripheral configuration information of the target device; the upper computer generates binary data of the peripheral configuration information; the upper computer adds the binary data into a binary file used for being burnt into the target device; the target device reads a local binary file burnt locally; and the target device configures peripheral parameters of the target device according to the peripheral configuration information in the local binary file. According to the peripheral parameter configuration method, the peripheral parameter configuration system and the processing device provided by the embodiment of the invention, the compiling time in a peripheral configuration process can be shortened, and the version iteration speed of a chip and the speed of adjusting the configured peripheral parameters by non-developers according to hardware requirements can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of peripheral parameter control, and in particular to a peripheral parameter configuration method, a peripheral parameter configuration system and a processing device. Background Art

[0002] In the design and application of microcontroller units (MCU) and system-on-chips (SoC), an important configuration step is peripheral configuration, such as pin multiplexing (Pinmux) configuration, which reallocates the physical pins of the chip to different functions or peripherals. The traditional pin configuration process usually involves setting specific register values ​​in firmware or hardware initialization code. This process is not only cumbersome and error-prone, but also requires developers with deep hardware knowledge to implement it manually, and when new configuration requirements arise, the firmware needs to be recompiled and burned, making updating the configuration time-consuming and inefficient.

[0003] Currently, there are a variety of tools and methods used to simplify the Pinmux configuration process, but they usually involve generating source code or configuration scripts that need to be compiled before they can be applied to the target hardware. This limits the speed of rapid iteration and the speed at which non-developers can adjust chip configurations according to hardware requirements. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a peripheral parameter configuration method and a peripheral parameter configuration system, which can reduce the compilation time in the peripheral configuration process, improve the version iteration speed of the chip and the speed at which non-developers adjust the configured peripheral parameters according to hardware requirements.

[0005] In a first aspect, an embodiment of the present application provides a peripheral parameter configuration method, which is applied to a peripheral parameter configuration system, wherein the peripheral parameter configuration system includes: a host computer and a target device, and the method includes:

[0006] The host computer receives the peripheral configuration information of the target device;

[0007] The host computer generates binary data of the peripheral configuration information;

[0008] The host computer adds the binary data to a binary file for burning into the target device;

[0009] The target device reads a local binary file burned locally;

[0010] The target device configures peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

[0011] In the above implementation process, the host computer directly receives the peripheral configuration information of the target device, generates binary data of the peripheral configuration information according to the peripheral configuration information, and directly adds the binary data to the binary file used to be burned into the target device. The target device directly reads the local binary file burned locally and configures according to the local binary file. The target device can complete the configuration without compilation, which reduces the compilation time in the development process of the target device, improves the chip iteration speed and the speed at which non-developers adjust the target device according to hardware requirements.

[0012] Furthermore, the target device reads a local binary file burned locally, and configures peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including:

[0013] The target device runs an initialization function when starting up, uses the initialization function to read the local binary file burned locally, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

[0014] In the above implementation process, the target device runs the initialization function at startup, uses the initialization function to read the local binary file, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, thereby reducing compilation time and manual configuration time, and realizing automatic configuration of the peripheral parameters of the target device.

[0015] Further, the host computer adds the binary data to a binary file for burning into the target device, including:

[0016] The host computer adds the binary data as the hardware abstraction layer information of the target device to a binary file for burning into the target device.

[0017] During the above implementation process, the abstract layer information directly affects the peripheral parameters of the target device. The binary data is added as the hardware abstract layer information of the target device to the binary file used to be burned into the target device, so that the target device can directly read the local binary file burned locally, and directly configure the peripheral parameters based on the hardware abstract layer information of the binary data in the binary file, thereby reducing the compilation time.

[0018] Further, the binary file includes: a data structure of the hardware abstraction layer information;

[0019] The host computer adds the binary data as the hardware abstraction layer information of the target device to a binary file for burning into the target device, including:

[0020] The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data.

[0021] In the above implementation process, the data structure of the hardware abstraction layer information is directly defined in the binary file, and the data structure of the hardware abstraction layer information of the binary file is modified according to the binary data, thereby reducing the time for the target device to parse the peripheral configuration information and improving the degree of automation of the peripheral parameter configuration of the target device.

[0022] Furthermore, after the host computer receives the peripheral configuration information of the target device, it also includes:

[0023] The host computer generates a configuration data structure of the peripheral configuration information according to the peripheral configuration information, wherein the format of the configuration data structure is the same as the format of the data structure of the hardware abstraction layer information;

[0024] The host computer generates binary data of the peripheral configuration information, including:

[0025] The host computer generates binary data of the configuration data structure;

[0026] The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data, including:

[0027] The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data of the configuration data structure.

[0028] In the above implementation process, the host computer generates a configuration data structure corresponding to the peripheral configuration information. The format of the configuration data structure is the same as the format of the data structure of the abstract layer information. Based on this, the data structure of the hardware abstraction layer information of the binary file can be quickly modified based on the binary data of the configuration data structure, thereby improving the automation of the entire peripheral parameter configuration method.

[0029] Further, the peripheral configuration information includes: an initialization flag of at least one external device of the target apparatus and configuration information of the at least one external device, wherein the initialization flag is used to identify whether the peripheral parameters need to be initialized;

[0030] The target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including:

[0031] The target device determines whether it is necessary to initialize the peripheral parameters corresponding to the at least one external device according to the initialization flag of the at least one external device in the peripheral configuration information of the local binary file, and if so, configures the peripheral parameters corresponding to the at least one external device according to the configuration information of the at least one external device.

[0032] In the above implementation process, the peripheral configuration information includes: an initialization flag of at least one external device of the target device and configuration information of at least one external device. The initialization flag is used to identify whether the parameters of the peripheral device need to be initialized. The peripheral parameters are configured based on the initialization flag, and the target device can achieve precise peripheral parameter configuration.

[0033] Further, the binary file and the local binary file include: a first global variable, the first global variable including: a starting address position of a data structure of the hardware abstraction layer information and a memory size of the data structure of the hardware abstraction layer information;

[0034] The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data of the configuration data structure, including:

[0035] The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the starting address position of the data structure of the hardware abstraction layer information, the memory size of the data structure of the hardware abstraction layer information, and the binary data of the configuration data structure;

[0036] The target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including:

[0037] The target device reads the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information in the local binary file;

[0038] The target device obtains the data structure of the hardware abstraction layer information in the local binary file according to the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information;

[0039] The target device configures peripheral parameters of the target device according to the data structure of the hardware abstraction layer information.

[0040] In the above implementation process, the first global variable can be quickly located, and the first global variable of the binary file includes the starting address position of the data structure of the abstract layer information and the memory size of the data structure of the hardware abstract layer information. The host computer and the target device can quickly obtain the starting address position of the data structure of the abstract layer information and the memory size of the data structure of the hardware abstract layer information based on the binary file, and quickly locate the data structure of the abstract layer information based on the starting address position of the data structure of the abstract layer information and the memory size of the data structure of the hardware abstract layer information, thereby improving the peripheral parameter configuration speed.

[0041] Furthermore, before the target device reads the local binary file burned locally, it also includes:

[0042] The target device obtains the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information in the linker script to modify the second global variable stored in the target device;

[0043] The target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including:

[0044] The target device runs a first program, wherein the first program is used to read the starting address position of the data structure of the hardware abstraction layer information in the second global variable and the memory size of the data structure of the hardware abstraction layer information;

[0045] The data structure of the hardware abstraction layer information is read according to the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information.

[0046] Furthermore, the host computer receives peripheral configuration information, including:

[0047] The host computer generates a visualization module, and receives the peripheral configuration information input by the user according to the visualization module.

[0048] In the above implementation process, based on the visualization module, non-developers can quickly input peripheral configuration information and complete peripheral parameter configuration.

[0049] In a second aspect, an embodiment of the present application provides a peripheral parameter configuration method, which is applied to a host computer, and the method includes:

[0050] Receiving peripheral configuration information of a target device;

[0051] Generate binary data of the peripheral configuration information;

[0052] The binary data is added to a binary file for burning into the target device, so that the target device reads the local binary file burned locally, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

[0053] In a third aspect, an embodiment of the present application provides an external configuration method, which is applied to a target device, and the method includes:

[0054] Read the local binary file burned locally;

[0055] Configuring peripheral parameters of the target device according to the peripheral configuration information in the local binary file;

[0056] The binary file is obtained in the following manner: a host computer receives peripheral configuration information of the target device; generates binary data of the peripheral configuration information; and the host computer adds the binary data to a binary file for burning into the target device.

[0057] In a fourth aspect, an embodiment of the present application provides a peripheral parameter configuration system, the peripheral parameter configuration system comprising: a host computer and a target device;

[0058] The host computer is used to receive the peripheral configuration information of the target device;

[0059] The host computer is also used to generate binary data of the peripheral configuration information;

[0060] The host computer is also used to add the binary data to a binary file for burning into the target device;

[0061] The target device is used to read a local binary file burned locally;

[0062] The target device is also used to configure peripheral parameters of the target device according to the peripheral configuration information in the local binary file. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0064] Figure 1 A schematic diagram of a first flow chart of a method for configuring peripheral parameters provided in an embodiment of the present application;

[0065] Figure 2 A second flow chart of the peripheral parameter configuration method provided in an embodiment of the present application;

[0066] Figure 3 A third flow chart of the peripheral parameter configuration method provided in an embodiment of the present application;

[0067] Figure 4 A schematic diagram of the structure of a peripheral parameter configuration system provided in an embodiment of the present application;

[0068] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0070] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0071] Example 1

[0072] See also Figure 1 The embodiment of the present application provides a peripheral parameter configuration method, which is applied to a peripheral parameter configuration system. The peripheral parameter configuration system includes: a host computer and a target device. The method includes:

[0073] S11: The host computer receives the peripheral configuration information of the target device;

[0074] S12: The host computer generates binary data of peripheral configuration information;

[0075] S13: The host computer adds the binary data to the binary file for burning into the target device;

[0076] S14: The target device reads the local binary file burned locally;

[0077] S15: The target device configures peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

[0078] In some embodiments, the host computer refers to a computer that can directly issue control commands. The target device can be a slave computer, a programmable logic controller (PLC) microcontroller, a chip (such as a system-level chip), a microprocessor, etc. The command issued by the host computer is first given to the slave computer, and the slave computer then interprets the command into a corresponding timing signal to directly control the corresponding device. The peripheral configuration information can be the configuration information of the pin multiplexing, including but not limited to: the function configuration of the general-purpose input / output (GPIO) of the pin, the pull-up and pull-down options of the pin, the output drive capability of the pin, the signal inversion of the pin, the output mode of the pin, and the electrical characteristic parameters of the external device of the target device.

[0079] In S11, the peripheral configuration information can be input by the user. In S12, after obtaining the peripheral configuration information, the peripheral configuration information is serialized to obtain binary data. In S13 and S14, the binary file and the local binary file are files in bin format. When developers and non-developers develop functions for target devices such as chips, they need to use bin files to burn specific logical functions into the target device. In this application, by directly adding the peripheral configuration information to the bin file, the interface configuration process of the target device is simplified, the interface configuration speed of the target device is improved, and the automation of the interface configuration is improved.

[0080] It is understandable that after S13, the host computer can use the burning software and the burning tool to burn the binary file with the peripheral configuration information added to the target device to obtain a local binary file of the target device.

[0081] In some embodiments, the binary file and the native binary file have the same information.

[0082] In some embodiments, in S15, the target device modifies a register corresponding to the target device according to the peripheral configuration information.

[0083] In the above implementation process, the host computer directly receives the peripheral configuration information of the target device, generates binary data of the peripheral configuration information according to the peripheral configuration information, and directly adds the binary data to the binary file used to be burned into the target device. The target device directly reads the local binary file burned locally and configures according to the local binary file. The target device can complete the configuration without compilation, which reduces the compilation time in the development process of the target device, improves the chip iteration speed and the speed at which non-developers adjust the target device according to hardware requirements.

[0084] In some embodiments, the target device reads a local binary file burned locally, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including: the target device runs an initialization function at startup, uses the initialization function to read the local binary file burned locally, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

[0085] In some embodiments, the initialization function is pre-generated. It is understandable that the initialization function has the function of reading a local binary file burned locally and configuring the peripheral parameters of the target device according to the peripheral configuration information in the local binary file. The initialization function is pre-burned in the target device, and the initialization function will be executed each time the target device is started. Based on this, the rapid iteration of the target device can be achieved, and the function customization of the target device by non-developers can be improved.

[0086] Exemplarily, the user first generates a specific logical function of the target device through the host computer. At the same time, the realization of the specific logical function requires the cooperation of the interface of the target device. The host computer generates a corresponding binary file for the specific logical function, or adds the binary data corresponding to the logical function to the binary file, and adds the binary data of the corresponding peripheral configuration information to the binary file. The binary file is burned to the target device so that the target device can execute the corresponding logical function, and the target device forms a binary file locally. The target device is started, and the target device executes the initialization function, reads the binary file, and configures the peripheral parameters of the target device according to the peripheral configuration information in the binary file.

[0087] In the above implementation process, the target device runs the initialization function at startup, uses the initialization function to read the local binary file, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, thereby reducing compilation time and manual configuration time, and realizing automatic configuration of the peripheral parameters of the target device.

[0088] In some embodiments, the host computer adds the binary data to the binary file for burning into the target device, including: the host computer adds the binary data as hardware abstraction layer information of the target device to the binary file for burning into the target device.

[0089] The Hardware Abstraction Layer (Layer HAL) is used to abstract specific details of the hardware, thereby providing a unified interface to upper-layer applications. Adding binary data as the hardware abstraction layer information of the target device to the binary file used to burn into the target device refers to converting the peripheral configuration information format into the information format required by the hardware abstraction layer.

[0090] During the above implementation process, the abstract layer information directly affects the peripheral parameters of the target device. The binary data is added as the hardware abstract layer information of the target device to the binary file used to be burned into the target device, so that the target device can directly read the local binary file burned locally, and directly configure the peripheral parameters based on the hardware abstract layer information of the binary data in the binary file, thereby reducing the compilation time.

[0091] In some embodiments, the binary file includes: a data structure of hardware abstraction layer information; the host computer adds the binary data as the hardware abstraction layer information of the target device to the binary file for burning into the target device, including: the host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data.

[0092] In some embodiments, the data structure of the hardware abstraction layer information defines multiple variable parameters of the hardware abstraction layer, such as the numerical sizes of different registers of the chip, etc. The target device applies the data structure of the hardware abstraction layer information to the hardware abstraction layer, and configures (initializes) peripheral parameters by writing corresponding registers.

[0093] In the above implementation process, the data structure of the hardware abstraction layer information is directly defined in the binary file, and the data structure of the hardware abstraction layer information of the binary file is modified according to the binary data, thereby reducing the time for the target device to parse the peripheral configuration information and improving the degree of automation of the peripheral parameter configuration of the target device.

[0094] In some embodiments, after the host computer receives the peripheral configuration information of the target device, it also includes: the host computer generates a configuration data structure of the peripheral configuration information based on the peripheral configuration information, and the format of the configuration data structure is the same as the format of the data structure of the hardware abstraction layer information; the host computer generates binary data of the peripheral configuration information, including: the host computer generates binary data of the configuration data structure; the host computer modifies the data structure of the hardware abstraction layer information of the binary file based on the binary data, including: the host computer modifies the data structure of the hardware abstraction layer information of the binary file based on the binary data of the configuration data structure.

[0095] In some embodiments, the format of the configuration data structure and the format of the data structure of the component abstraction layer information are structures, and multiple variables are defined in the structures. The peripheral configuration information can be added to the binary file through built-in functions or simple loop functions.

[0096] In the above implementation process, the host computer generates a configuration data structure corresponding to the peripheral configuration information. The format of the configuration data structure is the same as the format of the data structure of the abstract layer information. Based on this, the data structure of the hardware abstraction layer information of the binary file can be quickly modified based on the binary data of the configuration data structure, thereby improving the automation of the entire peripheral parameter configuration method.

[0097] In some embodiments, the peripheral configuration information includes: an initialization flag of at least one external device of the target device and configuration information of at least one external device, the initialization flag is used to identify whether the peripheral parameters need to be initialized; the target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including: the target device determines whether it is necessary to initialize the peripheral parameters corresponding to at least one external device according to the initialization flag of at least one external device in the peripheral configuration information in the local binary file, and if so, configures the peripheral parameters corresponding to at least one external device according to the configuration information of at least one external device.

[0098] It can be understood that the target device runs an initialization function at startup, and the initialization function is used to determine whether it is necessary to initialize the peripheral parameters corresponding to at least one external device based on the initialization flag of at least one external device in the peripheral configuration information in the local binary file. If so, the peripheral parameters corresponding to at least one external device are configured according to the configuration information of at least one external device.

[0099] Exemplarily, the 64-bit flag field in the structure corresponding to the data structure of the abstract layer information is used to determine which peripherals need to be initialized, and configuration operations are performed on the peripherals that need to be initialized according to each flag bit corresponding to the peripheral.

[0100] In the above implementation process, the peripheral configuration information includes: an initialization flag of at least one external device of the target device and configuration information of at least one external device. The initialization flag is used to identify whether the parameters of the peripheral device need to be initialized. The peripheral parameters are configured based on the initialization flag, and the target device can achieve precise peripheral parameter configuration.

[0101] In some embodiments, the binary file and the local binary file include: a first global variable, the first global variable includes: a starting address position of a data structure of hardware abstraction layer information and a memory size of the data structure of hardware abstraction layer information; the host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data of the configuration data structure, including: the host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information and the binary data of the configuration data structure;

[0102] Exemplarily, the host computer searches for a specific identifier (such as "SECT") in the header of the bin file to be burned, and finds the address of the kcf_info structure according to the identifier. The kcf_info structure is the first global variable. The kcf_info structure includes two first global variables, namely hal_config_addr and hal_config_size, wherein hal_config_add is the starting address position of the data structure of the hardware abstraction layer information in the memory, and hal_config_size is the memory size of the data structure of the hardware abstraction layer information.

[0103] The target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including: the target device reads the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information in the local binary file; the target device obtains the data structure of the hardware abstraction layer information in the local binary file according to the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information; the target device configures the peripheral parameters of the target device according to the data structure of the hardware abstraction layer information.

[0104] It can be understood that the target device runs an initialization function at startup, and the initialization function is used to read the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information in the local binary file; the target device obtains the data structure of the hardware abstraction layer information in the local binary file according to the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information; the target device configures the peripheral parameters of the target device according to the data structure of the hardware abstraction layer information.

[0105] In the above implementation process, the first global variable can be quickly located, and the first global variable of the binary file includes the starting address position of the data structure of the abstract layer information and the memory size of the data structure of the hardware abstract layer information. The host computer and the target device can quickly obtain the starting address position of the data structure of the abstract layer information and the memory size of the data structure of the hardware abstract layer information based on the binary file, and quickly locate the data structure of the abstract layer information based on the starting address position of the data structure of the abstract layer information and the memory size of the data structure of the hardware abstract layer information, thereby improving the peripheral parameter configuration speed.

[0106] In the present application, the actual address of the data structure of the abstraction layer information in the first global variable and the content size of the data structure of the hardware abstraction layer information are pre-defined by the linker script.

[0107] In this application, the linker script is used to control the program memory layout of the host computer and / or the target device, and define the location of variables and modules in the memory.

[0108] In some embodiments, before the target device reads the local binary file burned locally, the method further includes:

[0109] The target device obtains the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information in the linker script to modify the second global variable stored in the target device;

[0110] The target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including:

[0111] The target device runs a first program, wherein the first program is used to read the starting address position of the data structure of the hardware abstraction layer information in the second global variable and the memory size of the data structure of the hardware abstraction layer information;

[0112] The data structure of the hardware abstraction layer information is read according to the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information.

[0113] Exemplarily, the first global variable is a kcf_info structure, which includes: the starting address hal_config_addr of the data structure of the hardware abstraction layer information and the memory size position hal_config_size of the data structure of the hardware abstraction layer information, and the first global variable is stored in the target device. The target device first modifies the hal_config_addr and hal_config_size definitions in the kcf_info structure to the values ​​defined by the linker script when starting.

[0114] Next, the target device executes an initialization function, which reads the hal_config_addr and hal_config_size variables of the kcf_info structure to find the address and size of the data structure of the HAL configuration segment (abstract layer information). The data of the HAL configuration segment is parsed to read the peripheral parameters configured by the host computer software.

[0115] In some embodiments, the host computer receives the peripheral configuration information, including: the host computer generates a visualization module, and receives the peripheral configuration information input by the user according to the visualization module.

[0116] For example, developers or users can configure the functions, electrical characteristics and other parameters (peripheral configuration information) of each pin through a graphical interface or command line interface, and collect these peripheral parameters in a structure. For each peripheral, the structure contains all the necessary initialization information, such as GPIO function configuration, pull-up and pull-down options, output drive capability, signal inversion, output mode, etc. After the configuration is completed, the host computer software will generate a structure containing the complete peripheral initialization configuration information (data structure of hardware abstraction layer information).

[0117] In the above implementation process, based on the visualization module, non-developers can quickly input peripheral configuration information and complete peripheral parameter configuration.

[0118] In summary, the method of the embodiment of the present application directly edits and generates configuration data through the host computer, and the new pin configuration can be quickly applied without recompiling the firmware. This technology simplifies the workflow of hardware configuration by directly burning the configuration data into the bin file, greatly improves the flexibility and production efficiency of the device pin configuration, saves development time and cost, and accelerates the development and listing process of the product. In addition, the present invention supports the adjustment of the pin configuration on site or by the end user, expanding the possibility of non-professional developers participating in the hardware configuration.

[0119] Example 2

[0120] See also Figure 2 The present application embodiment provides a peripheral parameter configuration method, which is applied to a host computer, and the method includes:

[0121] S21: receiving peripheral configuration information of the target device;

[0122] S22: Generate binary data of peripheral configuration information;

[0123] S23: Add the binary data to the binary file for burning into the target device, so that the target device reads the local binary file burned locally, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

[0124] The specific implementation methods of the above steps have been described in Example 1 and will not be repeated here.

[0125] Example 3

[0126] See also Figure 3 , the embodiment of the present application provides a peripheral parameter configuration method, which is applied to a target device, and the method includes:

[0127] S31: Read the local binary file burned locally;

[0128] S32: configuring the peripheral parameters of the target device according to the peripheral configuration information in the local binary file; the binary file is obtained in the following manner: the host computer receives the peripheral configuration information of the target device; generates binary data of the peripheral configuration information; the host computer adds the binary data to the binary file for burning into the target device.

[0129] The specific implementation methods of the above steps have been described in Example 1 and will not be repeated here.

[0130] ,Example 4

[0131] See also Figure 4 , an embodiment of the present application provides a peripheral parameter configuration system, the peripheral parameter configuration system comprising: a host computer 1 and a target device 2;

[0132] The host computer 1 is used to receive the peripheral configuration information of the target device 2;

[0133] The host computer 1 is also used to generate binary data of peripheral configuration information;

[0134] The host computer 1 is also used to add binary data to a binary file for burning into the target device 2;

[0135] Target device 2 is used to read the local binary file burned locally;

[0136] The target device 2 is also used to configure the peripheral parameters of the target device 2 according to the peripheral configuration information in the local binary file.

[0137] The host computer 1 and the target device 2 are also used to execute the method of the host computer 1 and the target device 2 in Example 1, which will not be repeated here.

[0138] In the present application, the host computer and the target device are both processing devices, and the processing device can be an electronic device.

[0139] This application also provides an electronic device, see Figure 5 , Figure 5 A block diagram of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 51, a communication interface 52, a memory 53, and at least one communication bus 54. The communication bus 54 is used to realize direct connection and communication between these components. The communication interface 52 of the electronic device in the embodiment of the present application is used to communicate signaling or data with other node devices. The processor 51 may be an integrated circuit chip with signal processing capabilities.

[0140] The processor 51 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor 51 can also be any conventional processor, etc.

[0141] The memory 53 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory 53 stores computer-readable instructions, and when the computer-readable instructions are executed by the processor 51, the electronic device may execute the various steps involved in the above method embodiment.

[0142] Optionally, the electronic device may further include a storage controller and an input / output unit.

[0143] The memory 53, storage controller, processor 51, peripheral interface, input and output unit components are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses 54. The processor 51 is used to execute executable modules stored in the memory 53, such as software function modules or computer programs included in the electronic device.

[0144] The input and output unit is used to provide users with the task creation and to create a start optional time period or preset execution time for the task to realize the interaction between the user and the server. The input and output unit can be, but is not limited to, a mouse and a keyboard.

[0145] Understandably, Figure 5 The structure shown is for illustration only. The electronic device may also include Figure 5 More or fewer components as shown, or with Figure 5 Different configurations shown. Figure 5Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0146] The embodiment of the present application also provides a storage medium having instructions stored thereon. When the instructions are run on a computer, the method of the method embodiment is implemented when the computer program is executed by a processor. To avoid repetition, it will not be described again here.

[0147] The present application also provides a computer program product. When the computer program product is run on a computer, the computer executes the method of the method embodiment.

[0148] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0149] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0150] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0151] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0152] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0153] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants 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, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A peripheral parameter configuration method, characterized in that: Applied to a peripheral parameter configuration system, the peripheral parameter configuration system comprises: a host computer and a target device, the method comprises: The host computer receives the peripheral configuration information of the target device; The host computer generates binary data of the peripheral configuration information; The host computer adds the binary data to a binary file for burning into the target device; The target device reads a local binary file burned locally; The target device configures peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

2. The peripheral parameter configuration method according to claim 1, characterized in that: The target device reads a local binary file burned locally, and configures peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including: The target device runs an initialization function when starting up, uses the initialization function to read the local binary file burned locally, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

3. The peripheral parameter configuration method according to claim 2, characterized in that: The host computer adds the binary data to a binary file for burning into the target device, including: The host computer adds the binary data as the hardware abstraction layer information of the target device to a binary file for burning into the target device.

4. The peripheral parameter configuration method according to claim 3, characterized in that: The binary file includes: a data structure of the hardware abstraction layer information; The host computer adds the binary data as the hardware abstraction layer information of the target device to a binary file for burning into the target device, including: The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data.

5. The peripheral parameter configuration method according to claim 4, characterized in that: After the host computer receives the peripheral configuration information of the target device, the method further includes: The host computer generates a configuration data structure of the peripheral configuration information according to the peripheral configuration information, wherein the format of the configuration data structure is the same as the format of the data structure of the hardware abstraction layer information; The host computer generates binary data of the peripheral configuration information, including: The host computer generates binary data of the configuration data structure; The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data, including: The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data of the configuration data structure.

6. The peripheral parameter configuration method according to claim 1, characterized in that: The peripheral configuration information includes: an initialization flag of at least one external device of the target device and configuration information of the at least one external device, wherein the initialization flag is used to identify whether the peripheral parameters need to be initialized; The target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including: The target device determines whether it is necessary to initialize the peripheral parameters corresponding to the at least one external device according to the initialization flag of the at least one external device in the peripheral configuration information of the local binary file, and if so, configures the peripheral parameters corresponding to the at least one external device according to the configuration information of the at least one external device.

7. The peripheral parameter configuration method according to claim 5, characterized in that: The binary file and the local binary file include: a first global variable, the first global variable including: a starting address position of a data structure of the hardware abstraction layer information and a memory size of the data structure of the hardware abstraction layer information; The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the binary data of the configuration data structure, including: The host computer modifies the data structure of the hardware abstraction layer information of the binary file according to the starting address position of the data structure of the hardware abstraction layer information, the memory size of the data structure of the hardware abstraction layer information, and the binary data of the configuration data structure; The target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including: The target device reads the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information in the local binary file; The target device obtains the data structure of the hardware abstraction layer information in the local binary file according to the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information; The target device configures peripheral parameters of the target device according to the data structure of the hardware abstraction layer information.

8. The peripheral parameter configuration method according to claim 7, characterized in that: Before the target device reads the local binary file burned locally, the method further includes: The target device obtains the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information in the linker script to modify the second global variable stored in the target device; The target device configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file, including: The target device runs a first program, wherein the first program is used to read the starting address position of the data structure of the hardware abstraction layer information in the second global variable and the memory size of the data structure of the hardware abstraction layer information; The data structure of the hardware abstraction layer information is read according to the starting address position of the data structure of the hardware abstraction layer information and the memory size of the data structure of the hardware abstraction layer information.

9. The peripheral parameter configuration method according to claim 1, characterized in that: The host computer receives peripheral configuration information, including: The host computer generates a visualization module, and receives the peripheral configuration information input by the user according to the visualization module.

10. A peripheral parameter configuration method, characterized in that: Applied to a host computer, the method includes: Receiving peripheral configuration information of a target device; Generate binary data of the peripheral configuration information; The binary data is added to a binary file for burning into the target device, so that the target device reads the local binary file burned locally, and configures the peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

11. A peripheral parameter configuration method, characterized in that: Applied to a target device, the method comprises: Read the local binary file burned locally; Configuring peripheral parameters of the target device according to the peripheral configuration information in the local binary file; The binary file is obtained in the following manner: a host computer receives peripheral configuration information of the target device; generates binary data of the peripheral configuration information; and the host computer adds the binary data to a binary file for burning into the target device.

12. A peripheral parameter configuration system, characterized in that: The peripheral parameter configuration system comprises: a host computer and a target device; The host computer is used to receive the peripheral configuration information of the target device; The host computer is also used to generate binary data of the peripheral configuration information; The host computer is also used to add the binary data to a binary file for burning into the target device; The target device is used to read a local binary file burned locally; The target device is also used to configure peripheral parameters of the target device according to the peripheral configuration information in the local binary file.

13. A processing device, characterized in that: include: Used to perform the steps of the method according to claim 10 or 11.