CN118152016A - Peripheral chip initializing method, device, equipment and storage medium - Google Patents

Peripheral chip initializing method, device, equipment and storage medium Download PDF

Info

Publication number
CN118152016A
CN118152016A CN202410209181.2A CN202410209181A CN118152016A CN 118152016 A CN118152016 A CN 118152016A CN 202410209181 A CN202410209181 A CN 202410209181A CN 118152016 A CN118152016 A CN 118152016A
Authority
CN
China
Prior art keywords
initialization
peripheral chip
count value
result
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410209181.2A
Other languages
Chinese (zh)
Inventor
许心一
程诚
蔡林
张莉莎
王洪涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongfeng Motor Group Co Ltd
Original Assignee
Dongfeng Motor Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dongfeng Motor Group Co Ltd filed Critical Dongfeng Motor Group Co Ltd
Priority to CN202410209181.2A priority Critical patent/CN118152016A/en
Publication of CN118152016A publication Critical patent/CN118152016A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4403Processor initialisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a peripheral chip initializing method, a device, equipment and a storage medium, and belongs to the technical field of chip initialization. The method comprises the steps of obtaining an initialization writing value when initializing a peripheral chip; comparing the initialized writing value with a preset readback value to obtain a comparison result; determining an initialization result according to the comparison result; and the initialization of the peripheral chip is completed according to the initialization result, and the initialization fault can be conveniently and efficiently identified, so that the peripheral chip is timely protected in a targeted manner according to the detection result, and the initialization effect of the peripheral chip is improved.

Description

Peripheral chip initializing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of chip initialization technologies, and in particular, to a peripheral chip initialization method, apparatus, device, and storage medium.
Background
New energy automobiles are vigorously developed, the complex programs of the electric/electronic architecture of the automobiles are higher and higher, the number of ECUs (Electronic Control Unit, electronic control units) is increased continuously, and the system functions of the controllers are expanded continuously. To realize the complex function of a system, a plurality of peripheral chips are often needed to be combined for assistance besides a main control chip (a singlechip). When the system is electrified and initialized, the singlechip is required to initialize functions of peripheral chips of different division work according to a specific time sequence, and the system can enter a normal operation state after the peripheral chips are completely and abnormally free, however, due to reasons such as temperature, power supply fluctuation or random hardware failure, the chip initialization process can be abnormal, so that the system functions are loophole, the operation is abnormal, the faults are caused, the personal safety is endangered, and serious economic loss is caused.
The existing peripheral chip initialization can not accurately detect the faults existing in the initialization, so that the initialization effect is poor.
Disclosure of Invention
The invention mainly aims to provide a peripheral chip initializing method, device, equipment and storage medium, and aims to solve the technical problem that the peripheral chip initializing effect is poor in the prior art.
In order to achieve the above object, the present invention provides a peripheral chip initializing method, which includes the steps of:
when initializing a peripheral chip, acquiring an initialization writing value;
comparing the initialized writing value with a preset readback value to obtain a comparison result;
Determining an initialization result according to the comparison result;
and finishing the initialization of the peripheral chip according to the initialization result.
Optionally, the initializing the peripheral chip according to the initializing result includes:
when the initialization result is that the initialization fails, storing the failure fault information of the peripheral chip initialization failure into a preset memory, and generating a protection strategy;
Executing corresponding protection on the peripheral chip through the protection strategy;
and generating initialization failure information, exiting the initialization of the peripheral chip, and resetting the values of the write-in frequency counter and the fault counter.
Optionally, when the initialization result is the initialization failure, storing the peripheral chip initialization failure fault information into a preset memory, and generating a protection policy, including:
When the initialization result is the initialization failure, storing the peripheral chip initialization failure fault into a preset memory;
Acquiring the types of the peripheral chips;
and generating a corresponding protection strategy according to the category.
Optionally, the determining an initialization result according to the comparison result includes:
when the comparison result is that the initialization writing value is equal to the preset readback value, a first count value of a fault counter is obtained;
Determining whether the first count value is larger than a preset count value;
When the first count value is larger than the preset count value, determining that the initialization result is an initialization failure;
And when the first count value is smaller than or equal to the preset count value, determining that the initialization result is successful in initialization.
Optionally, the obtaining the initialization writing value when initializing the peripheral chip includes:
When initializing a peripheral chip, resetting the numerical values of a write-in frequency counter and a fault counter;
Acquiring a second count value of the write-in frequency counter;
detecting whether the second count value is larger than a preset count value;
when the second count value is smaller than or equal to the preset count value, calling an initialization function of the peripheral chip;
Configuring a register of a peripheral chip through the initialization function;
And after waiting for the preset time, reading back the register value of the peripheral chip to obtain the initialized writing value of the peripheral chip.
Optionally, after detecting whether the second count value is greater than a preset count value, the method further includes:
when the second count value is larger than the preset count value, a first count value of a fault counter is obtained;
detecting whether the first count value is larger than the preset count value or not to obtain a detection result;
And determining an initialization result of the peripheral chip according to the detection result.
Optionally, the initializing the peripheral chip according to the initializing result includes:
When the initialization result is that the initialization is successful, exiting the initialization stage;
and resetting the numerical values of the write-in times counter and the fault counter to finish the initialization of the peripheral chip.
In addition, to achieve the above object, the present invention also proposes a peripheral chip initializing device including:
The acquisition module is used for acquiring an initialization writing value when initializing the peripheral chip;
The comparison module is used for comparing the initialization writing value with a preset readback value to obtain a comparison result;
the determining module is used for determining an initialization result according to the comparison result;
and the initialization module is used for completing the initialization of the peripheral chip according to the initialization result.
In addition, to achieve the above object, the present invention also proposes a peripheral chip initializing apparatus including: a memory, a processor, and a peripheral chip initialization program stored on the memory and executable on the processor, the peripheral chip initialization program configured to implement the steps of the peripheral chip initialization method as described above.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon a peripheral chip initialization program which, when executed by a processor, implements the steps of the peripheral chip initialization method as described above.
The method comprises the steps of obtaining an initialization writing value when initializing a peripheral chip; comparing the initialized writing value with a preset readback value to obtain a comparison result; determining an initialization result according to the comparison result; and the initialization of the peripheral chip is completed according to the initialization result, and the initialization fault can be conveniently and efficiently identified, so that the peripheral chip is timely protected in a targeted manner according to the detection result, and the initialization effect of the peripheral chip is improved.
Drawings
FIG. 1 is a schematic diagram of a peripheral chip initialization device of a hardware runtime environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a peripheral chip initialization method according to a first embodiment of the present invention;
FIG. 3 is a flow chart illustrating the initialization of a peripheral chip in the prior art;
FIG. 4 is a schematic overall flow chart of a peripheral chip initializing method according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a peripheral chip initialization method according to a second embodiment of the present invention;
FIG. 6 is a flowchart illustrating a peripheral chip initialization method according to a third embodiment of the present invention;
FIG. 7 is a flowchart of a peripheral chip initializing method according to a fourth embodiment of the present invention;
FIG. 8 is a schematic diagram of a system architecture of an embodiment of a peripheral chip initialization method according to the present embodiment;
FIG. 9 is a schematic diagram of a peripheral chip initialization method according to an embodiment of the present invention;
Fig. 10 is a block diagram of a peripheral chip initializing device according to a first embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a peripheral chip initializing device in a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the peripheral chip initializing device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in fig. 1 does not constitute a limitation on the peripheral chip initialization apparatus, and may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a peripheral chip initialization program may be included in the memory 1005 as one type of storage medium.
In the peripheral chip initializing device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the peripheral chip initializing device of the present invention may be disposed in the peripheral chip initializing device, and the peripheral chip initializing device calls the peripheral chip initializing program stored in the memory 1005 through the processor 1001 and executes the peripheral chip initializing method provided by the embodiment of the present invention.
An embodiment of the present invention provides a peripheral chip initializing method, and referring to fig. 2, fig. 2 is a flowchart of a first embodiment of the peripheral chip initializing method of the present invention.
In this embodiment, the peripheral chip initializing method includes the following steps:
Step S10: and when initializing the peripheral chip, acquiring an initialization writing value.
It should be noted that, the execution body of the embodiment may be a peripheral chip initializing device, for example, a controller in a single chip microcomputer, or may be other devices capable of implementing the same or similar functions, which is not limited in this embodiment, and the peripheral chip initializing device is exemplified in this embodiment.
As shown in fig. 3, fig. 3 is a schematic flow chart of the current initialization of the peripheral chip, after the system is powered on, the single chip may perform necessary function configuration on the peripheral chip through communication modes such as spi\uart\i2c, i.e. the initialization, the initialization flow of the peripheral chip is usually performed only once, and there is no verification mechanism, and then the system enters a normal running state, but if the initialization fails, the system functions are affected, and since there is no fault record, the cause locking during the problem investigation is difficult, thereby resulting in poor initialization effect. In order to ensure safety, the initialization abnormal state of the peripheral chip is monitored in real time, and when the initialization is abnormal, protection treatment measures are timely taken to ensure the normal function of the system to the greatest extent.
Therefore, the embodiment provides a peripheral chip initializing method, which monitors the initializing state of each peripheral chip in real time in the power-on initializing stage, acquires the actual initializing value and compares the actual initializing value with the preset value, considers that the initializing process is abnormal when the actual initializing value and the preset value are inconsistent, and adopts targeted protection measures according to the chip functions and the controller types, thereby realizing the system functions most efficiently and safely. As shown in fig. 4, fig. 4 is a schematic overall flow chart of initializing peripheral chips in the present embodiment, after the system is powered on, peripheral chip is initialized, and whether the initialization is successful is detected, if yes, the system enters a normal operation state, and if not, necessary protection is adopted. The normal operation state of the system means that: if the system is an executor controller such as a BMS, a DC-DC, a motor controller and the like, after entering the state, the system CAN send a high-voltage connection permission signal to the whole vehicle controller through the CAN, so that the system is characterized by normal functions and enters a state of waiting for high-voltage connection; if the system is a VCU whole vehicle controller, a functional logic judgment is carried out to judge whether the high-voltage connection of a plurality of high-voltage related actuators is allowed, if so, a relay high-voltage connection instruction is sent to the BMS, the whole vehicle enters a high-voltage state, and then the vehicle can normally run (e.g. a motor can send torque according to the VCU instruction); if not, the VCU is protected according to the protection strategy of the VCU.
When initializing the peripheral chip, in order to determine whether there is a fault in initializing the peripheral chip, an initialization write value, that is, a value that is read back from a register value of the peripheral chip when initializing the peripheral chip, may be obtained.
Further, step S10 specifically includes:
When initializing a peripheral chip, resetting the numerical values of a write-in frequency counter and a fault counter;
Acquiring a second count value of the write-in frequency counter;
detecting whether the second count value is larger than a preset count value;
when the second count value is smaller than or equal to the preset count value, calling an initialization function of the peripheral chip;
Configuring a register of a peripheral chip through the initialization function;
And after waiting for the preset time, reading back the register value of the peripheral chip to obtain the initialized writing value of the peripheral chip.
It can be understood that when the peripheral chip is initialized, the system is powered on, enters an initialization stage, carries out zero clearing operation of the write-in frequency counter and the fault counter, acquires the count value of the write-in frequency counter after zero clearing, namely, the second count value, detects whether the count value of the write-in counter is larger than the preset count value, and the preset count value can be set to be 2, 3 and the like, and can be set according to specific conditions, so that proper values are selected, if the setting is too small, the fault is easy to misreport, the system is too sensitive, the fault tolerance is low, if the setting is too large, the fault detection is slow, the protection is not timely, and the system safety is poor.
When the second counter value is smaller than the preset counter value, the peripheral chip can be initialized, so that the singlechip invokes an initialization function of the peripheral chip through communication modes such as SPI/I2C/UART, and accordingly, a target value writing operation of the peripheral chip initialization is executed through the initialization function, a chip function related register is configured, the value of the writing frequency counter is added with 1, and after waiting for preset time, the peripheral chip register value is read back, so that a peripheral chip initialization writing value is obtained.
The preset time can be set to 3s, 5s, etc., and is directly related to the selected communication mode and the peripheral chip because the transmission of the communication data requires time.
The process of initializing the peripheral chip may be as follows:
void INITxxxx_16bits(void)
{
//initialize main logic
RegisterInitial(REG1,A);
RegisterInitial(REG2,B);
RegisterInitial(REG3,C);
}
Where REG1\2\3 represents the address of the different register, A\B\C represents the value to be written into the register, and the configuration of these values represents different functions.
In a specific implementation, the second count value may be greater than the preset count value, so after the step of detecting whether the second count value is greater than the preset count value, the method further includes: when the second count value is larger than the preset count value, a first count value of a fault counter is obtained; detecting whether the first count value is larger than the preset count value or not to obtain a detection result; and determining an initialization result of the peripheral chip according to the detection result.
When the second count value is greater than the preset count value, the first count value of the fault counter is obtained, and the first count value is the count value of the fault counter, so that whether the first count value is greater than the preset count value is detected, a detection result is obtained, and the initialization result of the peripheral chip is determined according to the detection result.
The detection result may be that the first count value is greater than the preset count value or the first count value is less than or equal to the preset count value, and the initialization result includes successful or failed initialization of the peripheral chip.
Step S20: and comparing the initialized writing value with a preset readback value to obtain a comparison result.
It should be noted that, the initialized writing value may be compared with the preset reading value, so as to obtain a comparison result.
In a specific implementation, the preset readback value is a target value that should be written when the peripheral chip is initialized, if the initialized write-in value is not equal to the preset readback value, the count value of the fault counter is increased by 1, and the step of detecting whether the count value of the write-in counter is greater than the preset count value is returned.
If the initialization writing value is equal to the preset readback value, whether the peripheral chip is initialized successfully is further determined.
Step S30: and determining an initialization result according to the comparison result.
It should be noted that, the initialization result of the peripheral chip may be determined according to the comparison result.
The initialization result comprises the success or failure of initialization, and the step of determining the initialization result according to the comparison result comprises the following steps: when the comparison result is that the initialization writing value is equal to the preset readback value, a first count value of a fault counter is obtained; determining whether the first count value is larger than a preset count value; when the first count value is larger than the preset count value, determining that the initialization result is an initialization failure; and when the first count value is smaller than or equal to the preset count value, determining that the initialization result is successful in initialization.
It should be noted that, when the comparison result is that the initialized writing value is equal to the preset reading value, the first count value of the fault counter may be obtained, so as to compare the first count value with the preset count value, and determine whether the first count value is greater than the preset count value.
In a specific implementation, if the first count value of the fault counter is greater than the preset count value, the initialization result is determined to be the initialization failure, and if the first count value of the fault counter is less than or equal to the preset count value, the initialization result is determined to be the initialization success.
Step S40: and finishing the initialization of the peripheral chip according to the initialization result.
In a specific implementation, the initialization of the peripheral chip can be completed according to the initialization result of the peripheral chip, for example, when the initialization fails, corresponding protection measures are taken, and the initialization stage is exited.
In the embodiment, when initializing the peripheral chip, an initialization writing value is obtained; comparing the initialized writing value with a preset readback value to obtain a comparison result; determining an initialization result according to the comparison result; and the initialization of the peripheral chip is completed according to the initialization result, and the initialization fault can be conveniently and efficiently identified, so that the peripheral chip is timely protected in a targeted manner according to the detection result, and the initialization effect of the peripheral chip is improved.
Referring to fig. 5, fig. 5 is a flowchart illustrating a peripheral chip initializing method according to a second embodiment of the present invention.
Based on the first embodiment, the peripheral chip initializing method in this embodiment includes, at step S40:
Step S401: and when the initialization result is the initialization failure, storing the failure fault information of the peripheral chip initialization failure into a preset memory, and generating a protection strategy.
It should be understood that when the initialization result is the initialization failure, the data may be stored in the preset memory, that is, the peripheral chip initialization failure fault information is stored in the preset memory, so as to facilitate the tracing of the initialization failure and generate the protection policy.
It should be noted that, to ensure the security of the system, a corresponding protection policy may be generated after the initialization failure of the peripheral chip, so as to take targeted protection measures, thereby implementing the system function most efficiently and safely.
The preset Memory may be a ROM (Read-Only Memory) or a RAM (Random Access Memory ), and may be uniformly stored to the ROM before power-down by storing the peripheral chip initialization failure fault information to a RAM area that specifically stores the fault code when the initialization fails. And fault information can be uploaded to the cloud through remote monitoring, so that big data analysis is facilitated.
Step S402: and executing corresponding protection on the peripheral chip through the protection strategy.
It should be noted that, the corresponding protection may be performed on the peripheral chip according to the corresponding protection policy.
Step S403: and generating initialization failure information, exiting the initialization of the peripheral chip, and resetting the values of the write-in frequency counter and the fault counter.
In specific implementation, after the corresponding protection measures are executed, initialization failure information is generated, the initialization of the peripheral chip is exited, the initialization failure is performed, the values of the write-in frequency counter and the fault counter are cleared, and the next initialization of the peripheral chip is facilitated.
In this embodiment, when the initialization result is an initialization failure, the peripheral chip initialization failure fault information is stored into a preset memory, and a protection policy is generated; executing corresponding protection on the peripheral chip through the protection strategy; generating initialization failure information, exiting the initialization of the peripheral chip, resetting the values of the write-in frequency counter and the fault counter, and storing data into a preset memory when a fault occurs, so that the tracing is convenient, corresponding protection is adopted, and the initialization safety is improved.
Referring to fig. 6, fig. 6 is a flowchart illustrating a third embodiment of a peripheral chip initializing method according to the present invention.
Based on the above second embodiment, the peripheral chip initializing method of the present embodiment includes, in the step S401:
step S4011: and when the initialization result is the initialization failure, storing the peripheral chip initialization failure fault information into a preset memory.
When the initialization result is the initialization failure, the peripheral chip initialization failure fault information is stored in the preset memory, so that the follow-up fault tracing is facilitated.
Step S4012: and obtaining the types of the peripheral chips.
The protection measures can be formulated according to the types of the single chip controllers and the types of the peripheral chips with different functions, so that the types of the peripheral chips can be obtained.
In an implementation, for example, the peripheral chips are communication chips, power management chips, and other peripheral chips may be included.
Step S4013: and generating a corresponding protection strategy according to the category.
In a specific implementation, the corresponding protection policy may be generated according to the type of the peripheral chip.
For example, the singlechip controller is a motor controller, and different protection strategies are generated according to the types of peripheral chips as shown in the following table 1:
TABLE 1
When the peripheral chip is a power management chip, the corresponding protection strategy is to record fault codes to ROM so as to facilitate the subsequent problem investigation, and send a motor system fault lamp lighting request to an instrument through a CAN bus to prompt a user; meanwhile, a request which is not allowed to be connected with the high voltage is sent to the PDCU so as to limit the high voltage on the whole vehicle and avoid further deterioration of the fault.
In the embodiment, when the initialization result is the initialization failure, the peripheral chip initialization failure fault is stored into a preset memory; acquiring the types of the peripheral chips; and generating a corresponding protection strategy according to the types, and adopting targeted protection according to different peripheral chips to improve the safety of the system.
Referring to fig. 7, fig. 7 is a flowchart illustrating a peripheral chip initializing method according to a fourth embodiment of the present invention.
Based on the first embodiment, the peripheral chip initializing method in this embodiment includes, at step S40:
Step S401': and when the initialization result is that the initialization is successful, exiting the initialization stage.
It should be noted that, when the initialization result is that the initialization is successful, the initialization stage may be exited.
Step S402': and resetting the numerical values of the write-in times counter and the fault counter to finish the initialization of the peripheral chip.
It will be appreciated that the values of the write-in number counter and the failure counter may be cleared to facilitate the next initialization or initialization of different kinds of peripheral chips.
As shown in fig. 8, fig. 8 is a schematic diagram of a system architecture for initializing a peripheral chip according to the present embodiment, including a single chip microcomputer and a peripheral chip, where the single chip microcomputer and the peripheral chip both include a communication module, so as to communicate with each other, and the single chip microcomputer sends an initialization target instruction to the peripheral chip and receives an actual initialization status read back of the peripheral chip, and the single chip microcomputer further includes an initialization status detection and protection function module, so that corresponding protection measures are adopted when the initialization of the peripheral chip fails.
As shown in fig. 9, fig. 9 is a schematic diagram of still another overall flow of the peripheral chip initializing method, after the system is powered on, entering an initializing stage, resetting the write-in number counter and the fault counter, judging whether the value of the write-in number counter is greater than 2 (calibratable), if yes, judging whether the value of the fault counter is greater than 2, if the value of the write-in number counter is not greater than 2, executing peripheral chip initializing target value writing operation, adding 1 to the value of the write-in number counter, readbacking the value of the peripheral chip register, comparing whether the initialized write-in value is consistent with the readback value, if the write-in value is not equal to the readback value, adding 1 to the value of the fault counter, and returning to the step of judging whether the value of the write-in number counter is greater than 2, if the write-in value is equal to the readback value, judging whether the value of the fault counter is greater than 2, if the value of the fault counter is greater than 2, storing information of the peripheral chip initializing failure fault to a corresponding memory and executing corresponding protection, and exiting the initializing failure information, and exiting the initializing stage if the initializing failure information is equal to 2, and exiting the initializing stage is less than the initializing stage. After exiting the initialization stage, the values of the write-in times counter and the fault counter are cleared to complete the initialization of the peripheral chip.
In the embodiment, when the initialization result is that the initialization is successful, the initialization stage is exited; and resetting the numerical values of the write-in frequency counter and the fault counter to finish the initialization of the peripheral chip, and can finish the initialization of the peripheral chip according to the result of the initialization detection quickly, thereby improving the initialization effect of the peripheral chip.
Referring to fig. 10, fig. 10 is a block diagram illustrating a first embodiment of a peripheral chip initializing apparatus according to the present invention.
As shown in fig. 10, the peripheral chip initializing device according to the embodiment of the present invention includes:
the acquiring module 10 is configured to acquire an initialization write value when initializing the peripheral chip.
And the comparison module 20 is used for comparing the initialized writing value with a preset readback value to obtain a comparison result.
A determining module 30, configured to determine an initialization result according to the comparison result.
And an initialization module 40, configured to complete initialization of the peripheral chip according to the initialization result.
In the embodiment, when initializing the peripheral chip, an initialization writing value is obtained; comparing the initialized writing value with a preset readback value to obtain a comparison result; determining an initialization result according to the comparison result; and the initialization of the peripheral chip is completed according to the initialization result, and the initialization fault can be conveniently and efficiently identified, so that the peripheral chip is timely protected in a targeted manner according to the detection result, and the initialization effect of the peripheral chip is improved.
In an embodiment, the initialization module 40 is further configured to store the peripheral chip initialization failure fault information into a preset memory and generate a protection policy when the initialization result is an initialization failure; executing corresponding protection on the peripheral chip through the protection strategy; and generating initialization failure information, exiting the initialization of the peripheral chip, and resetting the values of the write-in frequency counter and the fault counter.
In an embodiment, the initialization module 40 is further configured to store a peripheral chip initialization failure fault into a preset memory when the initialization result is an initialization failure; acquiring the types of the peripheral chips; and generating a corresponding protection strategy according to the category.
In an embodiment, the determining module 30 is further configured to obtain a first count value of the fault counter when the comparison result is that the initialized writing value is equal to the preset readback value; determining whether the first count value is larger than a preset count value; when the first count value is larger than the preset count value, determining that the initialization result is an initialization failure; and when the first count value is smaller than or equal to the preset count value, determining that the initialization result is successful in initialization.
In an embodiment, the obtaining module 10 is further configured to zero the values of the write-in number counter and the failure counter when initializing the peripheral chip; acquiring a second count value of the write-in frequency counter; detecting whether the second count value is larger than a preset count value; when the second count value is smaller than or equal to the preset count value, calling an initialization function of the peripheral chip; configuring a register of a peripheral chip through the initialization function; and after waiting for the preset time, reading back the register value of the peripheral chip to obtain the initialized writing value of the peripheral chip.
In an embodiment, the obtaining module 10 is further configured to obtain a first count value of the failure counter when the second count value is greater than the preset count value; detecting whether the first count value is larger than the preset count value or not to obtain a detection result; and determining an initialization result of the peripheral chip according to the detection result.
In an embodiment, the initialization module 40 is further configured to exit the initialization stage when the initialization result is that the initialization is successful; and resetting the numerical values of the write-in times counter and the fault counter to finish the initialization of the peripheral chip.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium stores a peripheral chip initialization program, and the peripheral chip initialization program realizes the steps of the peripheral chip initialization method when being executed by a processor.
Because the storage medium adopts all the technical schemes of all the embodiments, the storage medium has at least all the beneficial effects brought by the technical schemes of the embodiments, and the description is omitted here.
It should be understood that the foregoing is illustrative only and is not limiting, and that in specific applications, those skilled in the art may set the invention as desired, and the invention is not limited thereto.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
In addition, technical details not described in detail in this embodiment may refer to the peripheral chip initialization method provided in any embodiment of the present invention, which is not described herein.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read Only Memory)/RAM, magnetic disk, optical disk) and including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A peripheral chip initialization method, the peripheral chip initialization method comprising:
when initializing a peripheral chip, acquiring an initialization writing value;
comparing the initialized writing value with a preset readback value to obtain a comparison result;
Determining an initialization result according to the comparison result;
and finishing the initialization of the peripheral chip according to the initialization result.
2. The peripheral chip initialization method according to claim 1, wherein the initializing the peripheral chip according to the initialization result comprises:
when the initialization result is that the initialization fails, storing the failure fault information of the peripheral chip initialization failure into a preset memory, and generating a protection strategy;
Executing corresponding protection on the peripheral chip through the protection strategy;
and generating initialization failure information, exiting the initialization of the peripheral chip, and resetting the values of the write-in frequency counter and the fault counter.
3. The peripheral chip initialization method according to claim 2, wherein when the initialization result is an initialization failure, storing peripheral chip initialization failure information into a preset memory, and generating a protection policy, comprises:
When the initialization result is the initialization failure, storing the peripheral chip initialization failure fault into a preset memory;
Acquiring the types of the peripheral chips;
and generating a corresponding protection strategy according to the category.
4. The peripheral chip initialization method according to claim 1, wherein the determining an initialization result according to the comparison result comprises:
when the comparison result is that the initialization writing value is equal to the preset readback value, a first count value of a fault counter is obtained;
Determining whether the first count value is larger than a preset count value;
When the first count value is larger than the preset count value, determining that the initialization result is an initialization failure;
And when the first count value is smaller than or equal to the preset count value, determining that the initialization result is successful in initialization.
5. The peripheral chip initializing method according to claim 1, wherein the obtaining an initializing writing value when initializing the peripheral chip comprises:
When initializing a peripheral chip, resetting the numerical values of a write-in frequency counter and a fault counter;
Acquiring a second count value of the write-in frequency counter;
detecting whether the second count value is larger than a preset count value;
when the second count value is smaller than or equal to the preset count value, calling an initialization function of the peripheral chip;
Configuring a register of a peripheral chip through the initialization function;
And after waiting for the preset time, reading back the register value of the peripheral chip to obtain the initialized writing value of the peripheral chip.
6. The peripheral chip initialization method according to claim 5, wherein after detecting whether the second count value is greater than a preset count value, further comprising:
when the second count value is larger than the preset count value, a first count value of a fault counter is obtained;
detecting whether the first count value is larger than the preset count value or not to obtain a detection result;
And determining an initialization result of the peripheral chip according to the detection result.
7. The peripheral chip initialization method according to any one of claims 1 to 6, wherein the completion of the initialization of the peripheral chip according to the initialization result comprises:
When the initialization result is that the initialization is successful, exiting the initialization stage;
and resetting the numerical values of the write-in times counter and the fault counter to finish the initialization of the peripheral chip.
8. A peripheral chip initializing apparatus, characterized in that the peripheral chip initializing apparatus comprises:
The acquisition module is used for acquiring an initialization writing value when initializing the peripheral chip;
The comparison module is used for comparing the initialization writing value with a preset readback value to obtain a comparison result;
the determining module is used for determining an initialization result according to the comparison result;
and the initialization module is used for completing the initialization of the peripheral chip according to the initialization result.
9. A peripheral chip initializing apparatus, characterized by comprising: a memory, a processor, and a peripheral chip initialization program stored on the memory and executable on the processor, the peripheral chip initialization program configured to implement the peripheral chip initialization method of any one of claims 1 to 7.
10. A storage medium having stored thereon a peripheral chip initialization program which, when executed by a processor, implements the peripheral chip initialization method of any one of claims 1 to 7.
CN202410209181.2A 2024-02-26 2024-02-26 Peripheral chip initializing method, device, equipment and storage medium Pending CN118152016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410209181.2A CN118152016A (en) 2024-02-26 2024-02-26 Peripheral chip initializing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410209181.2A CN118152016A (en) 2024-02-26 2024-02-26 Peripheral chip initializing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118152016A true CN118152016A (en) 2024-06-07

Family

ID=91284447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410209181.2A Pending CN118152016A (en) 2024-02-26 2024-02-26 Peripheral chip initializing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118152016A (en)

Similar Documents

Publication Publication Date Title
US10216550B2 (en) Technologies for fast boot with adaptive memory pre-training
CN102509046B (en) The operating system effectively measured with the overall situation of dormancy support is started
CN110457907B (en) Firmware program detection method and device
CN111158767A (en) BMC-based server secure starting method and device
EP3629176B1 (en) Fault detection circuit with progress register and status register
CN104914815A (en) Processor monitoring method, device and system
CN106528347B (en) A kind of data back up method and mobile terminal
JP2005135407A (en) System and method for testing component of computer system by using voltage margining
US8260974B1 (en) Techniques for accelerating the processing of enclosures in SAS disk storage arrays
CN103838651A (en) Mainboard function test management and control system and method
CN113094107A (en) Data protection method, device, equipment and computer storage medium
CN118152016A (en) Peripheral chip initializing method, device, equipment and storage medium
CN110865906B (en) Motor initial position angle storage method and device, vehicle and storage medium
JP2011008702A (en) Fault processor
CN116501156A (en) Power supply time sequence control method, device, equipment and storage medium
CN113722212B (en) CPLD upgrading test method, device, equipment and medium
CN113111017B (en) Information processing method and electronic equipment
CN111104334B (en) Test method and device based on EEPROM module interface software and readable storage medium
US20130055017A1 (en) Device and method for restoring information in a main storage unit
CN113094221A (en) Fault injection method and device, computer equipment and readable storage medium
US10528467B2 (en) Information processing device and information processing method
JP2005149503A (en) System and method for testing memory using dma
CN112951316A (en) Solid state disk drive-and-retract D3hotState testing method and device and computer equipment
CN108369558B (en) Method for operating a microcontroller
CN118012764A (en) Program running detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination