Chip parameter configuration method, storage medium and computer program product

By implementing the chip parameter configuration method on the MCU, using the MCU to communicate with different chips, obtain and write corresponding data, the problem of limited application scope of chip parameter configuration in the existing technology is solved, and wider applicability and lower difficulty in development and maintenance.

CN119025185BActive Publication Date: 2025-02-25深圳市通微科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411496290.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-25
Estimated Expiration
2044-10-25

AI Technical Summary

Technical Problem

The scope of application of existing chip parameter configuration methods is limited and cannot be applied to all types of chips, which increases the difficulty of chip development and maintenance.

Method used

The MCU is used as the control core to communicate with different types of chips, obtain corresponding write data from the MCU's flash memory or host computer according to the chip type and needs, and transmit this data to the target chip.

Benefits of technology

It realizes the versatility of chip parameter configuration, expands the scope of application, reduces dependence on specific CPU or EEPROM support, and reduces the difficulty of development and maintenance during chip configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025185B_ABST
    Figure CN119025185B_ABST
Patent Text Reader

Abstract

The present application discloses a chip parameter configuration method, storage medium and computer program product, which relates to the field of data processing technology. The method is applied to MCU, and the MCU is respectively connected to the chip and the host computer in communication. The method includes: determining the current working scene of the chip, and obtaining write data from the flash memory of the MCU or the host computer based on the current working scene, wherein the current working scene includes a chip initialization scene, a chip debugging scene and a chip setting scene; sending the write data to the chip, wherein the chip writes the received write data into the hardware component corresponding to the write data. The present application realizes the removal of the dependence on chip characteristics during chip configuration, thereby expanding the scope of application of chip parameter configuration and improving the versatility of chip parameter configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a chip parameter configuration method, a storage medium, and a computer program product. Background Art

[0002] Chip parameter configuration refers to the process of setting and adjusting various operating parameters of the chip to ensure that the chip can operate according to the expected functions and performance requirements. Currently, chip parameter configuration is generally performed through the following two solutions:

[0003] The chip is connected to the CPU (Central Processing Unit) through a communication bus, and the chip is initialized by a program running on the CPU. However, this solution is only suitable for systems with a CPU and relies on the initialization program on the CPU side. The solution cannot be applied to all types of chips, has a limited scope of application, and has poor versatility.

[0004] An EEPROM (Electrically Erasable Programmable Read Only Memory) chip is mounted on the chip. When the chip is powered on, the data in the EEPROM is actively loaded into the chip. However, this solution requires the chip itself to support the function of mounting an EEPROM chip, which cannot be applied to all types of chips. The scope of application of the solution is limited and its versatility is poor.

[0005] In summary, the current chip parameter configuration process has a limited scope of application, which increases the difficulty of chip development and maintenance.

[0006] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0007] The main purpose of the present application is to provide a chip parameter configuration method, a storage medium and a computer program product, aiming to solve the technical problem that the current chip parameter configuration process has a limited scope of application.

[0008] To achieve the above purpose, the present application proposes a chip parameter configuration method, which is applied to an MCU (Microcontroller Unit), wherein the MCU is communicated with the chip and the host computer respectively, and the chip parameter configuration method includes:

[0009] Determine the current working scenario of the chip, and obtain write data from the flash memory of the MCU or the host computer based on the current working scenario, wherein the current working scenario includes a chip initialization scenario, a chip debugging scenario, and a chip setting scenario;

[0010] The write data is sent to the chip, wherein the chip writes the received write data into a hardware component corresponding to the write data.

[0011] In one embodiment, the current working scenario is the chip initialization scenario, and the step of acquiring write data from the flash memory of the MCU or the host computer based on the current working scenario includes:

[0012] Based on the chip initialization scenario, preset chip status data is acquired from the flash memory of the MCU, and the chip status data is used as write data.

[0013] In one embodiment, the chip initialization scenario includes a pin level initialization scenario and a register value initialization scenario, and the step of obtaining preset chip status data from the flash memory of the MCU includes:

[0014] If the chip initialization scenario is the pin level initialization scenario, read a chip pin level update flag from the flash memory of the MCU, and when the chip pin level update flag is a valid flag, read preset initialization chip pin level status data from the flash memory;

[0015] If the chip initialization scenario is the register value initialization scenario, a chip register update flag is read from the flash memory, and when the chip register update flag is the valid flag, a preset initialization register value is read from the flash memory.

[0016] In one embodiment, the current working scenario is the chip debugging scenario, and the step of acquiring write data from the flash memory of the MCU or the host computer based on the current working scenario includes:

[0017] Receiving the debugging instruction sent by the host computer;

[0018] The debugging instruction is parsed to obtain chip debugging data carried by the debugging instruction, and the chip debugging data is used as write data.

[0019] In one embodiment, the debugging instruction is a register debugging instruction, and after the step of sending the write data to the chip, the step further includes:

[0020] Reading current register data of the chip through a first communication interface, wherein the MCU is communicatively connected with the chip through the first communication interface;

[0021] The current register data is sent to the host computer via a second communication interface, wherein the MCU is communicatively connected with the host computer via the second communication interface.

[0022] In one embodiment, the current working scenario is the chip setting scenario, and the step of acquiring write data from the flash memory of the MCU or the host computer based on the current working scenario includes:

[0023] Receiving a setting instruction issued by the host computer;

[0024] The setting instruction is parsed to obtain a setting register value carried by the setting instruction, and the setting register value is used as write data.

[0025] In one embodiment, after the step of sending the write data to the chip, the method further includes:

[0026] Running a preset chip test program to test and obtain the current performance of the chip;

[0027] If the current performance does not match the preset performance, returning to the step of receiving the setting instruction issued by the host computer;

[0028] If the current performance matches the preset performance, the setting register value is saved as the initialization register value in the flash memory of the MCU, and the chip register update flag is set as a valid flag in the flash memory.

[0029] In one embodiment, the step of determining the current working scene of the chip includes:

[0030] If the chip is in a power-on state or a restart state, determining that the current working scene of the chip is the chip initialization scene;

[0031] If the MCU receives the debugging instruction sent by the host computer, it determines that the current working scene is the chip debugging scene;

[0032] If the MCU receives the setting instruction sent by the host computer, it determines that the current working scene is the chip setting scene.

[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes an MCU, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the chip parameter configuration method as described above.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the chip parameter configuration method described above are implemented.

[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the chip parameter configuration method described above are implemented.

[0036] In the present application, the MCU determines the current working scenario of the chip, and obtains write data from the flash memory of the MCU or the host computer based on the current working scenario, wherein the current working scenario includes a chip initialization scenario, a chip debugging scenario, and a chip setting scenario; the write data is sent to the chip, wherein the chip writes the received write data into the hardware component corresponding to the write data.

[0037] Compared to relying on the CPU and its initialization program, or relying on the chip's own support for EEPROM, this application introduces MCU as the control core. MCU can communicate with different types of chips, obtain corresponding write data from the MCU's flash memory or host computer according to different chip types and requirements, and then transmit these data to the target chip. This application makes the chip parameter configuration no longer directly dependent on specific CPU or EEPROM support, eliminates the dependence on chip characteristics during the chip configuration process, thereby expanding the scope of application of chip parameter configuration and improving the versatility of chip parameter configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0040] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the chip parameter configuration method of the present application;

[0041] Figure 2 A schematic diagram of a brief process of initializing the power-on hardware pin level of a chip according to an embodiment of the present application;

[0042] Figure 3 A schematic diagram of a brief process of initializing the internal register value on the chip according to an embodiment of the present application;

[0043] Figure 4 A schematic diagram of a brief process of online debugging of chip hardware level and internal registers involved in an embodiment of the present application;

[0044] Figure 5 A schematic diagram of a brief process of online setting of chip register values ​​according to an embodiment of the present application;

[0045] Figure 6 A schematic diagram of the communication flow of a chip parameter configuration method provided in an embodiment of the present application;

[0046] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the chip parameter configuration method in the embodiment of the present application.

[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] The main solution of the embodiment of the present application is: the MCU determines the current working scenario of the chip, and obtains write data from the flash memory of the MCU or the host computer based on the current working scenario, wherein the current working scenario includes a chip initialization scenario, a chip debugging scenario, and a chip setting scenario; the write data is sent to the chip, wherein the chip writes the received write data into the hardware component corresponding to the write data.

[0051] In this embodiment, for the convenience of description, the following description is made with MCU as the execution subject.

[0052] In the fields of embedded systems, industrial automation, automotive electronics, etc., chip parameter configuration is a key link to ensure the normal operation of the system and performance optimization. Chip parameter configuration refers to the process of setting and adjusting various operating parameters of the chip to ensure that the chip can operate according to the expected functions and performance requirements. Currently, chip parameter configuration is generally carried out through the following two solutions:

[0053] 1. Connect the chip to the CPU (Central Processing Unit) through a communication bus, and initialize the chip through a program running on the CPU. However, this solution is only suitable for chips with a CPU and relies on the initialization program on the CPU side. The solution cannot be applied to all types of chips, has a limited scope of application, and has poor versatility.

[0054] 2. An EEPROM (Electrically Erasable Programmable Read Only Memory) chip is mounted on the chip. When the chip is powered on, the data in the EEPROM is actively loaded into the chip. However, this solution requires the chip itself to support the function of mounting an EEPROM chip and cannot be applied to all types of chips. The scope of application of the solution is limited and its versatility is poor.

[0055] In summary, the current chip parameter configuration process has a limited scope of application, which increases the difficulty of chip development and maintenance.

[0056] The present application provides a solution, which enables the MCU to determine the current working scenario of the chip, and obtain write data from the flash memory of the MCU or the host computer based on the current working scenario, wherein the current working scenario includes a chip initialization scenario, a chip debugging scenario, and a chip setting scenario; the write data is sent to the chip, wherein the chip writes the received write data into the hardware component corresponding to the write data.

[0057] Compared to relying on the CPU and its initialization program, or relying on the chip's own support for EEPROM, this application introduces MCU as the control core. MCU can communicate with different types of chips, obtain corresponding write data from the MCU's flash memory or host computer according to different chip types and requirements, and then transmit these data to the target chip. This application makes the chip parameter configuration no longer directly dependent on specific CPU or EEPROM support, eliminates the dependence on chip characteristics during the chip configuration process, thereby expanding the scope of application of chip parameter configuration and improving the versatility of chip parameter configuration.

[0058] It should be noted that the execution subject of this embodiment can be an MCU, which is connected to the chip and the host computer in communication, and the host computer can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can realize the above functions, etc., which is not limited here. The following embodiment and the following embodiments are described with MCU as the execution subject.

[0059] Based on this, the embodiment of the present application provides a chip parameter configuration method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the chip parameter configuration method of the present application.

[0060] In this embodiment, the chip parameter configuration method includes steps S10 to S20:

[0061] Step S10, determining the current working scenario of the chip, and acquiring write data from the flash memory of the MCU or the host computer based on the current working scenario, wherein the current working scenario includes a chip initialization scenario, a chip debugging scenario, and a chip setting scenario;

[0062] It should be noted that the current working scenario refers to the current operating environment or task state of the chip, which determines the functions that the chip needs to perform and the required configuration parameters. Different working scenarios may require different hardware configurations or software parameters to adapt to different task requirements. For example, in the initialization phase, the chip needs to load basic startup parameters; in the debugging phase, it may be necessary to adjust the value of the internal register to observe the MCU behavior; in the tuning phase, it may be necessary to perform final parameter optimization based on the actual operating conditions. Specifically, the current working scenario may include the chip initialization scenario, the chip debugging scenario, and the chip tuning scenario. The chip initialization scenario is the preparation stage before the chip starts to perform its intended function after power-on or reset. In this stage, the chip will load basic configuration parameters, such as clock settings, I / O port configuration, etc., to ensure that the chip can start normally and enter the working state; the chip debugging background refers to the environment and conditions when performing chip function verification and troubleshooting. The debugging background may include specific test equipment, test software, and a series of preset test steps. During the debugging process, you may need to adjust the chip's internal parameters or observe its output signals to locate and resolve potential problems. The chip tuning scenario is the stage where chip parameters are finally optimized and adjusted according to actual application requirements after the initial debugging of the chip is completed. The tuning scenario usually occurs before the chip is about to be put into actual use. The purpose is to ensure that the chip's performance and stability are in the best state. During the tuning process, you may need to adjust parameters multiple times and perform tests and verifications.

[0063] The MCU determines the current working scenario of the chip, and then obtains the corresponding data for writing into the chip (hereinafter referred to as write data for distinction) from the MCU's flash memory or the host computer based on the current working scenario. It can be understood that by identifying different working scenarios, the chip configuration can be flexibly adjusted according to the needs of different scenarios, and data can be automatically obtained from the MCU flash memory or the host computer, which reduces manual intervention and improves the automation and convenience of the configuration process.

[0064] The specific method by which the MCU determines the current working scene is not limited here and can be set according to actual needs. For example, in one feasible implementation, the current working scene can be determined by detecting the state change of the external input signal; in another feasible implementation, the current working state and configuration of the chip can be determined by reading the register or status flag inside the chip; in another feasible implementation, the user can send instructions through the host computer or other interactive interface, and the MCU can determine the working scene of the chip based on the received instructions. Exemplarily, in one feasible implementation, in step S10: determining the current working scene of the chip can include:

[0065] Step S101, if the chip is in a power-on state or a restart state, determining that the current working scene of the chip is the chip initialization scene;

[0066] When the chip is in the power-on or restart state, the chip needs to establish its operating environment from scratch, including loading basic firmware, configuring internal registers, and initializing peripherals. Therefore, once it is detected that the chip is in the power-on or restart state, it can be determined that its current working scenario is the chip initialization scenario.

[0067] It is understandable that when the chip is powered on or restarted, its internal state is unknown and may contain residual data or configuration from the last run. Therefore, an initialization operation is first performed to clear these residual data and load the necessary startup code and configuration parameters. This ensures that the chip can start running in a consistent state each time it is started, avoiding potential problems caused by the state left over from the last run.

[0068] Step S102, if the MCU receives the debugging instruction sent by the host computer, it determines that the current working scene is the chip debugging scene;

[0069] During the development or maintenance process, it may be necessary to verify or troubleshoot the chip's functions. At this time, the host computer will send debugging instructions to the MCU, requiring the chip to enter debugging mode. Once the MCU receives these instructions, it can determine that the current working scenario is the chip debugging scenario.

[0070] It is understandable that debugging instructions are a communication method between the host computer and the MCU, which are used to instruct the chip to enter a specific debugging state. In the debugging scenario, the chip will suspend the normal execution process and perform debugging-related operations, such as pausing execution, reading internal register values, modifying memory contents, etc. Debugging operations are crucial for understanding the behavior of the chip, locating the problem, and verifying the repair effect.

[0071] Step S103: If the MCU receives the setting instruction sent by the host computer, it determines that the current working scene is the chip setting scene.

[0072] After the initial debugging of the chip is completed, the chip parameters need to be finally optimized and adjusted according to the actual application requirements. The host computer sends a tuning command to the MCU, requiring the chip to enter the tuning mode. Once the MCU receives these commands, it can determine that the current working scene is the chip tuning scene. Through the tuning process, the chip parameters can be finely adjusted according to specific application requirements, thereby optimizing the overall performance of the chip.

[0073] It is understandable that in the tuning scenario, the chip will adjust its internal parameters (such as clock frequency, voltage threshold, power management, etc.) according to the received tuning instructions to achieve the best operating effect. These adjustments are usually made based on the needs of actual applications and test results, aiming to make the chip show the best performance and stability in a specific working environment and conditions.

[0074] Step S20: sending the write data to the chip, wherein the chip writes the received write data into a hardware component corresponding to the write data.

[0075] The acquired write data is sent to the chip. After receiving the data, the chip writes it into the corresponding hardware component. It should be noted that the hardware component corresponding to the write data refers to the physical component or module inside or outside the chip that is directly related to the write data. For example, if the write data is the value of the configuration register, the corresponding hardware component is the module where the register is located; if the write data is a level signal that controls the I / O port, the corresponding hardware component is the I / O port and the external device connected to it.

[0076] It can be understood that once the write data is acquired, it is sent to the chip and written into the hardware components, so that the configuration takes effect immediately, shortening the configuration cycle. The data is written directly to the hardware components, ensuring the precision and accuracy of the configuration and avoiding performance degradation or chip instability due to improper configuration.

[0077] Compared to relying on the CPU and its initialization program, or relying on the chip's own support for EEPROM, this application introduces MCU as the control core. MCU can communicate with different types of chips, obtain corresponding write data from the MCU's flash memory or host computer according to different chip types and requirements, and then transmit these data to the target chip. This application makes the chip parameter configuration no longer directly dependent on specific CPU or EEPROM support, eliminates the dependence on chip characteristics during the chip configuration process, thereby expanding the scope of application of chip parameter configuration and improving the versatility of chip parameter configuration.

[0078] In addition, this embodiment also improves the stability and reliability of the system by reducing manual intervention and configuration errors, which is particularly important for chip applications that require frequent configuration adjustments or work in different scenarios, such as embedded systems, industrial automation and other fields.

[0079] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above description, and will not be repeated in the following. On this basis, the current working scene is the chip initialization scene, and in the step S10: the step of obtaining write data from the flash memory of the MCU or the host computer based on the current working scene includes:

[0080] Step S104: acquiring preset chip status data from the flash memory of the MCU based on the chip initialization scenario, and using the chip status data as write data.

[0081] Specifically, the MCU can determine whether it is currently in the chip initialization scene by detecting the power-on state or restart state of the chip. Once it is confirmed that the current scene is in the chip initialization scene, the MCU will access the flash memory area of ​​the MCU. In the flash memory, the MCU finds the preset state data corresponding to the chip initialization scene. These data may include basic configuration parameters, startup code, firmware version information, etc. The read preset state data is prepared to be sent to the chip as write data. The write data will be used to initialize the internal state of the chip to ensure that the chip can start running as expected.

[0082] Exemplarily, when the chip is powered on or restarted, the MCU first enters the initialization scene. During the initialization process, the MCU accesses its internal flash memory area, which stores preset chip status data. These data may include: clock configuration parameters, I / O port configuration, interrupt vector table, firmware version information, etc.; the MCU reads this data (that is, writes data) to provide necessary configuration information for subsequent initialization operations; the MCU sends the read write data to the chip, and the chip writes the received write data to the corresponding hardware components, such as configuring the GPIO (general input and output) port to connect sensors and actuators.

[0083] It is understandable that by directly reading the preset chip status data from the MCU flash memory, the chip can quickly complete the initialization process and enter the normal working state, reducing the startup time and improving the response speed of the system. The preset chip status data ensures that the chip can start running in the same state each time it is initialized, which can maintain the consistency and predictability of the system and reduce potential problems caused by inconsistent initialization states. In addition, obtaining write data from the MCU flash memory reduces dependence on the host computer. In some cases, if the host computer is unavailable or the connection is unstable, the chip can still complete the initialization by reading the preset data in the flash memory.

[0084] In one feasible implementation, the chip initialization scenario includes a pin level initialization scenario and a register value initialization scenario, and the step S104: the step of obtaining preset chip status data from the flash memory of the MCU includes:

[0085] Step S1041, if the chip initialization scenario is the pin level initialization scenario, read a chip pin level update flag from the flash memory of the MCU, and when the chip pin level update flag is a valid flag, read preset initialization chip pin level status data from the flash memory;

[0086] When the MCU determines that it is currently in the pin level initialization scenario, the MCU reads a specific flag from the MCU's flash memory. The flag is used to indicate whether the pin level configuration needs to be updated. This flag may be a simple binary value, such as 0 for no update and 1 for update. The MCU checks whether the read pin level update flag is a valid flag (usually a non-zero value). If the flag is valid, it indicates that there is updated pin level configuration data in the flash memory and needs to be read. After confirming that the update flag is valid, the MCU reads the preset initialization chip pin level status data from the flash memory. The initialization chip pin level status data may include the level status of each GPIO pin (high level or low level), pull-up and pull-down resistor configuration, interrupt trigger mode, etc., which are not limited here.

[0087] Step S1042, if the chip initialization scenario is the register value initialization scenario, read the chip register update flag from the flash memory, and when the chip register update flag is the valid flag, read the preset initialization register value from the flash memory.

[0088] When the MCU determines that it is currently in the register value initialization scenario, it reads a specific flag from the flash memory. The flag is used to indicate whether the register configuration needs to be updated. The MCU checks whether the read register update flag is a valid flag. If the flag is valid, it means that there is updated register configuration data in the flash memory and it needs to be read. After confirming that the update flag is valid, the MCU reads the preset initialization register value from the flash memory. The initialization register value is used to configure the internal registers of the MCU to set the correct working parameters and status.

[0089] It can be understood that by checking the validity of the update flag, the MCU can avoid performing a complete initialization operation at each startup. If the configuration data in the flash memory has not changed, the MCU can skip unnecessary initialization steps, thereby speeding up the startup. In addition, storing the initialization data in the flash memory and initializing by reading this data when needed can reduce system instability or failure caused by manual configuration errors or omissions. This automated initialization process improves the reliability and stability of the system.

[0090] For example, please refer to Figure 2 The process of chip power-on hardware pin level initialization can be: after the MCU is powered on, the MCU program starts running, the MCU first reads the chip pin level update flag saved in the internal flash (flash memory), and detects whether the (chip pin level) update flag is valid. If the update flag is valid, the pre-saved chip pin level status data is loaded from the internal flash (that is, the pin level data stored in the MCU internal flash is read), and the IO level status connected to the chip hardware pin is set according to the data (that is, the data is parsed and the corresponding pin level is set) to realize the initialization of the chip pin level. If the update flag is invalid, the chip power-on hardware pin level initialization operation is terminated.

[0091] Please refer to Figure 3 The process of initializing the internal register value when the chip is powered on can be: after the MCU is powered on, the MCU program starts running, and the MCU first reads the chip register update flag saved in the internal flash. If the (chip register) update flag is valid, the pre-saved register value data is loaded from the internal flash (that is, the pin level data stored in the MCU internal flash is read), and the data is written into the chip register (that is, the data is parsed and written into the chip register) to realize the initialization of the chip register value.

[0092] In a feasible implementation manner, the current working scenario is the chip debugging scenario, and the step S10: the step of obtaining write data from the flash memory of the MCU or the host computer based on the current working scenario includes:

[0093] Step S105, receiving a debugging instruction issued by the host computer;

[0094] MCU or the equipment connected to it (such as debugger, serial communication module, etc.) is responsible for receiving debugging instructions from the host computer (such as PC, workstation, etc.). The host computer usually runs special debugging software to send control commands and data to MCU for debugging operations. Debugging instructions can be transmitted through communication interfaces such as serial port, USB, network, etc., depending on the MCU design and communication protocol, which is not limited here.

[0095] Step S106, parsing the debugging instruction to obtain chip debugging data carried by the debugging instruction, and using the chip debugging data as write data.

[0096] After receiving the debug command, the MCU or related equipment needs to parse it to extract the chip debug data carried in the debug command. The debug data may include specific values ​​that need to be written to the chip register or memory to modify the chip's operating mode, configuration parameters, or trigger specific behaviors. The parsing process may involve decoding the debug command, verifying its legitimacy (such as checksum, signature verification, etc.), and extracting valid data. Once the parsing is completed and the validity of the debug data is confirmed, the debug data is written into the chip as write data.

[0097] It is understandable that by sending debugging instructions and data directly from the host computer to the MCU and automatically parsing and executing these instructions, the efficiency of the debugging process can be improved. Instead of manually setting each parameter or executing each step, the debugger can quickly complete complex debugging tasks through the debugging software of the host computer. In addition, the automated parsing and execution of debugging instructions can reduce the risk of human error. The debugging instructions and data can be verified and tested on the host computer before sending to ensure their correctness and legality. In addition, through the automated process, errors caused by repeated operations or carelessness can be reduced, allowing debuggers to debug the MCU through the host computer at any time and any place without physical contact with the MCU itself. This enhances the flexibility of the debugging process, especially in remote debugging or distributed systems. For complex debugging scenarios that require modifying multiple parameters or executing multiple steps at the same time, it can be more convenient to implement it by sending debugging instructions and data from the host computer. Debuggers can write scripts or programs on the host computer to automatically perform a series of debugging operations, thereby simplifying the debugging process and improving efficiency.

[0098] In a feasible implementation manner, the debugging instruction is a register debugging instruction, and after the step S20: sending the write data to the chip, the step further includes:

[0099] Step S30, reading the current register data of the chip through the first communication interface, wherein the MCU is communicatively connected with the chip through the first communication interface;

[0100] The MCU first selects the first communication interface required to communicate with the chip (such as SPI, I2C, GPIO simulated parallel bus, etc.), and configures the interface parameters (such as clock frequency, data bit length, address bit, etc.) according to the requirements of the communication protocol. Then, the MCU sends a request to read the register to the chip through the first communication interface. The register request contains the address or index of the register to be read. After receiving the read request, the chip will send the current value of the corresponding internal register as response data to the MCU through the first communication interface. The MCU is responsible for receiving this data and storing it in the internal register or memory for subsequent processing. The MCU can verify the received data to ensure the integrity and correctness of the data. The verification method may include checksum check, range check, etc., which are not limited here.

[0101] Step S40: sending the current register data to the host computer via a second communication interface, wherein the MCU is communicatively connected to the host computer via the second communication interface.

[0102] MCU uses the second communication interface directly connected to it to send the current register data to the host computer. The specific process can be: MCU uses the second communication interface (such as serial port, USB, Ethernet, etc.) required for communication with the host computer, and configures the interface parameters according to the requirements of the communication protocol; MCU packages the read register data (which may also contain other relevant information, such as timestamp, status code, etc.) in the format agreed with the host computer. The packaging process may involve data encoding, adding checksums, and encapsulating into data packets; MCU sends the packaged data to the host computer through the second communication interface. The sending process may involve the generation of data frames, the management of the sending buffer, flow control, etc., which are not specifically limited here; after receiving the data, the host computer may send a confirmation response to the MCU to indicate that the data has been successfully received. The MCU can confirm the success or failure of the data transmission based on this.

[0103] It is understandable that by reading and sending the current register data of the chip to the host computer in real time, developers can monitor the working status of the chip in real time, quickly locate problems and debug. This improves the efficiency and accuracy of debugging. Real-time monitoring and debugging help to promptly discover and solve potential problems and hidden dangers, thereby improving the reliability and stability of the product. This is especially important for application scenarios that require high reliability and long life.

[0104] In a feasible implementation, the host computer can display the received register data in a graphical or tabular form, making the analysis and understanding of the data more intuitive and convenient. Developers can use this data to conduct more in-depth performance analysis, troubleshooting or optimization design.

[0105] For example, please refer to Figure 4 The process of online debugging of chip hardware level and internal register can be: after the system is powered on, the MCU program starts to run, and starts to receive host computer commands through the communication interface (UART: Universal Asynchronous Receiver / Transmitter, or USB: Universal Serial Bus). When the host computer issues an instruction to change the chip pin level state, the corresponding pin level is set; when the host computer issues a command to read the chip register value, the MCU first reads the corresponding register value of the chip, and returns the register value to the host computer through the communication interface (that is, write the chip register value and read it back and return it to the host computer); when the host computer issues a command to write the chip register value, the MCU writes the value into the corresponding register of the chip, reads back the written register value, and returns it to the host computer through the communication interface.

[0106] In a feasible implementation manner, the current working scenario is the chip setting scenario, and the step S10: the step of obtaining write data from the flash memory of the MCU or the host computer based on the current working scenario includes:

[0107] Step S107, receiving the setting instruction issued by the host computer;

[0108] MCU receives the setting instructions from the host computer through the communication interface between it and the host computer (such as serial port, USB, Ethernet, etc.). The setting instructions are generated by the host computer (such as PC-side control software or remote server) according to MCU requirements or user configuration, and are intended to guide the MCU to perform parameter setting operations on the chip. The setting instructions usually include the specific parameter value of the setting, the address of the target register, and possible control flags. It is understandable that in large systems or distributed systems, centrally managing the setting parameters of all chips through the host computer can simplify the management process and reduce the error rate.

[0109] Step S108, parsing the setting instruction to obtain the setting register value carried by the setting instruction, and using the setting register value as write data.

[0110] After receiving the setting instruction, the MCU first parses it. The parsing process usually includes identifying the start and end flags of the instruction, extracting valid data in the instruction (such as the setting register value), verifying the integrity and correctness of the data (such as checksum check), etc. After the parsing is completed, the MCU will extract the setting register value as write data to be sent to the corresponding register of the target chip.

[0111] It can be understood that the precise analysis of the setting instructions ensures that the setting parameters can be accurately applied to the registers of the target chip, thereby improving the accuracy and reliability of the system. The automated analysis and configuration process reduces human intervention and reduces errors and failures caused by improper human operation.

[0112] By sending setting instructions from the host computer and automatically parsing and executing them by the MCU, efficient automation of chip parameter configuration is achieved, which improves work efficiency. Setting instructions can be sent remotely, so that the system can adjust and optimize parameters without interrupting operation, thereby improving the system's availability and maintainability.

[0113] In a feasible implementation manner, after the step S20: sending the write data to the chip, the step further includes:

[0114] Step S50, running a preset chip test program to test and obtain the current performance of the chip;

[0115] The MCU will execute a preset chip test program, which is designed to comprehensively evaluate the performance of the chip under the current configuration. The test may include functional testing, performance benchmark testing, stability testing and other aspects to ensure that the chip can work normally under the adjusted parameters and meet the preset performance requirements. The specific test content is not limited here. After the test is completed, the MCU will collect and analyze the test results to obtain the current performance data of the chip.

[0116] It is understandable that by running the test program, performance problems caused by improper configuration can be discovered and corrected in a timely manner, ensuring that the chip can perform at its best in actual applications. The test process can verify the stability and reliability of the chip under different working conditions, reducing failures and downtime caused by improper configuration.

[0117] Step S60, if the current performance does not match the preset performance, returning to the step of receiving the setting instruction issued by the host computer;

[0118] If the test results show that the current performance of the chip does not match the preset performance, it means that the current setting parameters may not be suitable for the current working conditions or requirements. At this time, the MCU will return to the step of receiving the setting instructions sent by the host computer, that is, re-enter the setting process to adjust the setting parameters according to the new instructions and re-test.

[0119] By returning to the steps of executing the tuning instructions, iterative optimization of parameters can be achieved, gradually approaching the optimal configuration and improving the overall performance of the system. In a complex and changing working environment, the system can automatically adjust the configuration to adapt to different needs, improving the system's adaptive ability.

[0120] Step S70: If the current performance matches the preset performance, the setting register value is saved as the initialization register value in the flash memory of the MCU, and the chip register update flag is set as a valid flag in the flash memory.

[0121] If the test results show that the current performance of the chip matches the preset performance, it means that the current setting parameters are appropriate. At this time, the MCU will save the setting register value as the initialization register value and store it in the MCU's flash memory so that these parameters can be quickly loaded when the system is restarted or the default configuration needs to be restored. At the same time, the MCU will also set a chip register update flag in the flash memory as a valid flag to indicate that the MCU has completed the parameter setting and verification process.

[0122] For example, please refer to Figure 5 The process of online adjustment of chip register value can be as follows: after the system is powered on, the MCU program starts to run and starts to receive host computer commands through the communication interface (UART or USB). When the host computer sends a command to write chip register value, the MCU writes the value into the corresponding register of the chip. After the register value is written successfully, the chip performance is tested and this operation is repeated. When the chip performance reaches the best, the current register value is saved in the MCU internal flash and the chip register update flag is set (that is, the current register is saved to the internal flash and the update flag is set). The next time the power is turned on or restarted, if the update flag is valid, the saved register value is read out and written into the chip register.

[0123] It can be understood that by saving the tuning parameters as initialization register values ​​and setting the update flag, the system can quickly recover to the tuned state when restarted or needed, improving the system's recovery capability and reliability. In the subsequent configuration process, the MCU can determine whether the tuning operation needs to be re-performed by checking the update flag, thereby simplifying the configuration process and reducing unnecessary duplication of work.

[0124] In this embodiment, by introducing the testing, feedback and saving mechanisms, the chip parameter configuration method can ensure that the chip can play the best performance in actual applications and can automatically adapt to different working conditions and requirements. At the same time, through iterative optimization and fast recovery mechanisms, the system's adaptability, reliability and recovery capabilities are improved. These beneficial effects jointly improve the overall performance of the system and user experience.

[0125] In one feasible implementation, the MCU internal flash is used to store the chip pin level status and register value data, and its read and write speed and life have an important impact on the performance and reliability of the MCU. Frequent read and write operations may accelerate the wear of the flash and reduce its service life. In this implementation, multiple small data blocks can be merged into a larger data block for writing to reduce the number of write operations, because each write operation will cause a certain amount of loss to the flash, and merged writing can reduce this loss; for example, a volatile memory such as RAM (Random Access Memory) can be used as a cache, and the data to be written to the flash is first stored in the cache. When the data in the cache accumulates to a certain amount, it is written to the flash at one time, thereby reducing the number of writes. For frequently read data, it can be considered to be stored in the RAM to reduce the number of direct reads of the flash. At the same time, the page read feature of the flash can be used to read multiple bytes at a time to improve the reading efficiency; for example, a write cache area can be set in the MCU, and the data to be written to the flash is first stored in the cache area. When the cache area is full or reaches a preset condition, the data is written to the flash in batches, which can significantly reduce the number of writes to the flash, thereby extending its service life. For frequently accessed data, it can be stored in the read cache. When the data needs to be read, it is first searched from the cache. If found, it is directly returned without accessing the flash again. This can reduce the number of flash reads and increase the reading speed. For example, you can also check the life indicators of the flash (such as the number of erase and write times) and choose chips with longer lifespans. This can ensure that the flash can work reliably throughout the life cycle of the MCU.

[0126] In a feasible implementation, the MCU can accurately control the IO level state connected to the chip hardware pin to initialize the chip pin level. However, due to factors such as noise and interference in the circuit, the pin level state may be unstable. In this implementation, a de-jitter algorithm can be implemented in the MCU program to eliminate the mechanical jitter generated when a mechanical button or switch is pressed or released. By detecting the change in the pin level state and delaying for a period of time (usually a few milliseconds to tens of milliseconds) and then detecting again, if the pin level state remains unchanged, it is considered to be a valid level change; for example, a filter circuit (such as a low-pass filter, a band-pass filter, etc.) can be added to the pin input or output to filter out unnecessary noise and interference signals. The design of the filter circuit should be carried out according to specific needs to ensure that the transmission of useful signals is not affected while filtering out noise; for example, a protection circuit (such as a current limiting resistor, a transient suppression diode, etc.) can be added to the pin input to prevent the external circuit from damaging the MCU pin. The design of the protection circuit should fully consider the reliability and safety of the circuit.

[0127] In a feasible implementation, during the chip hardware level and internal register online debugging process, due to the complexity and diversity of the chip register value, there may be write errors or verification failures. In this implementation, the register value specification can be pre-set, wherein the register value specification includes the register type, address range, data format and expected function; then the chip register value read by the MCU from the flash memory is checked to see if it meets the preset register value specification attribute data for data verification; if it meets, the chip register value is sent to the chip, and the chip writes the received data into the register.

[0128] For example, to help understand the implementation process of the chip parameter configuration method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 6 , Figure 6 A communication flow diagram of a chip parameter configuration method is provided. Specifically, in this embodiment, an additional MCU is added to connect the pins of the chip that need to be configured with a level state to the IO interface of the MCU, and the communication interface of the chip (which may be an I2C: Inter-Integrated Circuit, integrated circuit bus, SPI: Serial Peripheral Interface, serial peripheral interface, etc.) is connected to the communication interface of the MCU. The MCU also includes a communication interface (such as UART or USB) for communicating with a host computer.

[0129] In this embodiment, the following application scenarios may be included:

[0130] 1. Chip power-on hardware pin level initialization. After the system is powered on, the MCU program starts running. The MCU first reads the chip pin level update flag saved in the internal flash. If the update flag is valid, the pre-saved chip pin level status data is loaded from the internal flash, and the IO level status connected to the chip hardware pin is set according to the data to initialize the chip pin level.

[0131] 2. Initialization of internal register values ​​when the chip is powered on. After the system is powered on, the MCU program starts running. The MCU first reads the register value update flag saved in the internal flash. If the update flag is valid, the pre-saved register value data is loaded from the internal flash and the data is written into the chip register to initialize the chip register value.

[0132] 3. Online debugging of chip hardware level and internal registers. After the system is powered on, the MCU program starts running and starts to receive host computer commands through the communication interface (UART or USB). When the host computer issues an instruction to change the chip pin level status, the corresponding IO pin level is set; when the host computer issues a command to read the chip register value, the MCU first reads the corresponding register value of the chip and returns the register value to the host computer through the communication interface; when the host computer issues a command to write the chip register value, the MCU writes the value into the corresponding register of the chip, and reads back the written register value and returns it to the host computer through the communication interface.

[0133] 4. Online adjustment of chip register values. After the system is powered on, the MCU program starts running and starts receiving host computer commands through the communication interface (UART or USB). When the host computer issues a command to write the chip register value, the MCU writes the value into the corresponding register of the chip. After the register value is written successfully, the chip performance is tested and this operation is repeated. When the chip performance reaches the best, the current register value is saved in the MCU internal flash and the chip register update flag is set. The next time the system is powered on or restarted, if the update flag is valid, the saved register value is read out and written into the chip register.

[0134] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the chip parameter configuration method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0135] The present application also provides a chip parameter configuration device, which is applied to an MCU, and the MCU is communicatively connected with the chip and a host computer respectively.

[0136] The chip parameter configuration device provided by the present application adopts the chip parameter configuration method in the above embodiment, which can solve the technical problem that the application scope of the current chip parameter configuration process is limited. Compared with the prior art, the beneficial effects of the chip parameter configuration device provided by the present application are the same as the beneficial effects of the chip parameter configuration method provided by the above embodiment, and the other technical features in the chip parameter configuration device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0137] The present application provides a chip parameter configuration device, which includes: at least one MCU; and a memory connected to the at least one MCU for communication; wherein the memory stores instructions that can be executed by the at least one MCU, and the instructions are executed by the at least one MCU so that the at least one MCU can execute the chip parameter configuration method in each of the above embodiments.

[0138] Reference below Figure 7 , which shows a schematic diagram of the structure of a chip parameter configuration device suitable for implementing the embodiment of the present application. The chip parameter configuration device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), etc., and fixed terminals such as desktop computers, etc. Figure 7 The chip parameter configuration device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0139] like Figure 7As shown, the chip parameter configuration device may include an MCU 1001, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM) 1004. Various programs and data required for the operation of the chip parameter configuration device are also stored in the RAM 1004. The MCU 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following chip parameter configuration devices may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the chip parameter configuration device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a chip parameter configuration device with various chip parameter configuration devices, it should be understood that it is not required to implement or have all the chip parameter configuration devices shown. More or fewer chip parameter configuration devices may be implemented or have instead.

[0140] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from a storage device 1003, or installed from ROM1002. When the computer program is executed by MCU1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0141] The chip parameter configuration device provided by the present application adopts the chip parameter configuration method in the above embodiment, which can solve the technical problem that the application scope of the current chip parameter configuration process is limited. Compared with the prior art, the beneficial effects of the chip parameter configuration device provided by the present application are the same as the beneficial effects of the chip parameter configuration method provided by the above embodiment, and the other technical features in the chip parameter configuration device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0142] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0143] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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.

[0144] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the chip parameter configuration method in the above-mentioned embodiment.

[0145] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0146] The computer-readable storage medium may be included in the chip parameter configuration device; or may exist independently without being assembled into the chip parameter configuration device.

[0147] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the chip parameter configuration device, the chip parameter configuration device implements the chip parameter configuration method of the above embodiment.

[0148] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0149] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0150] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0151] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned chip parameter configuration method, and can solve the technical problem that the current chip parameter configuration process has a limited scope of application. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the chip parameter configuration method provided by the above-mentioned embodiment, and will not be elaborated here.

[0152] The present application also provides a computer program product, including a computer program, which implements the steps of the chip parameter configuration method as described above when executed by a processor.

[0153] The computer program product provided by this application can solve the technical problem that the application scope of the current chip parameter configuration process is limited. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the chip parameter configuration method provided by the above embodiment, which will not be repeated here.

[0154] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A chip parameter configuration method, characterized in that: The chip parameter configuration method is applied to an MCU, and the MCU is respectively connected to the chip and the host computer in communication. The chip parameter configuration method includes: The MCU determines a current working scenario of the chip, and acquires write data from a flash memory of the MCU or the host computer based on the current working scenario, wherein the current working scenario includes a chip initialization scenario, a chip debugging scenario, and a chip setting scenario; Sending the write data to the chip, wherein the chip writes the received write data into a hardware component corresponding to the write data; The current working scenario is the chip initialization scenario, which includes a pin level initialization scenario and a register value initialization scenario. The step of acquiring write data from the flash memory of the MCU or the host computer based on the current working scenario includes: If the chip initialization scenario is the pin level initialization scenario, read a chip pin level update flag from the flash memory of the MCU, and when the chip pin level update flag is a valid flag, read preset initialization chip pin level status data from the flash memory, and use the initialization chip pin level status data as write data; If the chip initialization scenario is the register value initialization scenario, read a chip register update flag from the flash memory, and when the chip register update flag is the valid flag, read a preset initialization register value from the flash memory, and use the initialization register value as the write data; The current working scenario is the chip debugging scenario, and the step of acquiring write data from the flash memory of the MCU or the host computer based on the current working scenario includes: Receiving the debugging instruction sent by the host computer, parsing the debugging instruction to obtain the chip debugging data carried by the debugging instruction, and using the chip debugging data as the write data; The current working scenario is the chip setting scenario, and the step of acquiring write data from the flash memory of the MCU or the host computer based on the current working scenario includes: Receiving the setting instruction sent by the host computer, parsing the setting instruction to obtain the setting register value carried by the setting instruction, and using the setting register value as write data; Wherein, after the step of sending the write data to the chip, the method further includes: Upon receiving a chip register value write command issued by the host computer, the write data is written into the register corresponding to the chip, and after successfully writing the register, the chip performance of the chip is repeatedly tested until the current performance of the chip matches the preset performance, the current register value of the register is saved in the flash memory, and the chip register update flag is set as a valid flag in the flash memory, and the next time the chip is powered on or restarted, if the chip register update flag is valid, the current register value is read out and written into the chip register; The step of the MCU determining the current working scene of the chip includes: If the chip is in a power-on state or a restart state, the MCU determines that the current working scene of the chip is the chip initialization scene; If the MCU receives the debugging instruction sent by the host computer, the MCU determines that the current working scene is the chip debugging scene; If the MCU receives the setting instruction sent by the host computer, the MCU determines that the current working scene is the chip setting scene.

2. The chip parameter configuration method according to claim 1, characterized in that: The debugging instruction is a register debugging instruction. After the step of sending the write data to the chip, the method further includes: Reading current register data of the chip through a first communication interface, wherein the MCU is communicatively connected with the chip through the first communication interface; The current register data is sent to the host computer via a second communication interface, wherein the MCU is communicatively connected with the host computer via the second communication interface.

3. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the chip parameter configuration method according to any one of claims 1 to 2 are implemented.

4. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the chip parameter configuration method according to any one of claims 1 to 2 are implemented.

Citation Information

Patent Citations

  • An I2C control circuit for fast writing of chip parameters

    CN218848742U