Embedded board startup method, device, central processing unit and embedded board
By obtaining common configuration information and target indication information to automatically match the execution code, the problem of low firmware compatibility for embedded board boot loading is solved, and efficient compatibility support for different hardware configuration boards is achieved.
Patent Information
- Application Number
- CN202310336251.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2043-03-30
AI Technical Summary
The boot loading firmware compatibility of existing embedded boards is low, resulting in users needing to compile multiple versions of firmware to adapt to different configuration boards, increasing the user's maintenance and compilation burden.
The memory is initialized by obtaining general configuration information, and the configuration information of the target board is obtained based on the target indication information, and the execution code is automatically matched to control the startup of the board.
Improves boot loading firmware compatibility, making it suitable for embedded boards with the same central processor but with different hardware configurations, reducing the number of user-maintained firmware versions.
Smart Images

Figure CN116400968B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronics, and in particular to a startup method and device for an embedded board, a central processing unit, and an embedded board. Background Art
[0002] In the embedded field, before the operating system runs, it is usually necessary to initialize the device configuration by loading the boot loader firmware pre-stored in the device, for example, initializing the hardware device, initializing the memory space mapping table and other configuration operations, so as to prepare for the startup of the operating system. However, for embedded boards with different central processors or different board hardware configurations, the corresponding boot loader firmware is also different, and the user needs to compile it manually, which leads to a large number of boot loader firmware versions that the user needs to maintain and compile. That is, the current boot loader firmware has low compatibility, and users need to compile more versions of boot loader firmware to adapt to embedded boards with different configurations.
[0003] Therefore, there is an urgent need for a startup method for an embedded board to improve the compatibility of startup loading firmware. Summary of the invention
[0004] The present application provides an embedded board startup method, device, central processing unit and embedded board, which are used to solve the problem in the related art that the user needs to compile a large number of firmware versions due to the low compatibility of the startup loading firmware.
[0005] In a first aspect, the present application provides a method for starting an embedded board, comprising:
[0006] Acquire general configuration information, and initialize and configure the memory according to the general configuration information; the general configuration information is the minimum configuration information compatible with various embedded boards with the same processor, and is used to configure the common modules in the various embedded boards with the same processor; the memory is used to store indication information, and the indication information is used to indicate the board configuration information corresponding to the embedded board corresponding to the memory;
[0007] If it is determined that the memory includes target indication information corresponding to the target board, acquiring target board configuration information corresponding to the target board according to the target indication information;
[0008] According to the target board configuration information, an execution code corresponding to the target board configuration information is determined; and according to the execution code and the target board configuration information, the target board is controlled to start up.
[0009] In one example, acquiring target board configuration information corresponding to the target board according to the target indication information includes:
[0010] In the pre-stored hardware configuration information set, the target board configuration information corresponding to the target board is obtained according to the target indication information; wherein the hardware configuration information set includes board configuration information corresponding to a variety of hardware carried by various boards, and the board configuration information corresponds to the indication information one by one.
[0011] In one example, the target board has a peripheral interface; the method further includes:
[0012] Initialize configuration of the peripheral interface according to the general configuration information;
[0013] If it is determined that the memory does not include the target indication information, a prompt message is sent to the user; the prompt message is used to prompt the user to determine the target indication information corresponding to the target board;
[0014] Based on the peripheral device interface, externally input target indication information is received.
[0015] In one example, the method further includes:
[0016] The externally input target indication information is written into the memory.
[0017] In one example, the number of the memories is multiple;
[0018] The step of writing the externally input target indication information into the memory includes:
[0019] Determine an access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory when obtaining indication information;
[0020] The target indication information is written into the memory corresponding to the highest access order priority.
[0021] In one example, the number of the memories is multiple;
[0022] The step of determining that the memory includes target indication information corresponding to the target board includes:
[0023] Determine an access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory when obtaining indication information;
[0024] According to the access order priority, the memory in the target board is accessed in sequence until the target indication information is acquired.
[0025] In a second aspect, the present application provides a startup device for an embedded board, comprising:
[0026] A first acquisition unit, used to acquire general configuration information;
[0027] A first configuration unit is used to initialize and configure the memory according to the general configuration information; the general configuration information is the minimum configuration information compatible with various embedded boards with the same processor, and is used to configure the general modules in the various embedded boards with the same processor; the memory is used to store indication information, and the indication information is used to indicate the board configuration information corresponding to the embedded board corresponding to the memory;
[0028] A second acquisition unit, if it is determined that the memory includes target indication information corresponding to the target board, acquires target board configuration information corresponding to the target board according to the target indication information;
[0029] A determination unit, configured to determine, according to the target board configuration information, an execution code corresponding to the target board configuration information;
[0030] The control unit is used to control the startup of the target board according to the execution code and the target board configuration information.
[0031] In one example, the second acquisition unit is specifically used to:
[0032] If it is determined that the memory includes target indication information corresponding to the target board, then in the pre-stored hardware configuration information set, the target board configuration information corresponding to the target board is obtained according to the target indication information; wherein the hardware configuration information set includes board configuration information corresponding to a variety of hardware carried by various boards, and the board configuration information corresponds to the indication information one-to-one.
[0033] In one example, the target board has a peripheral interface; the device further includes:
[0034] A second configuration unit, configured to initialize and configure the peripheral interface according to the general configuration information;
[0035] A sending unit, configured to send a prompt message to a user if it is determined that the memory does not include the target indication information; the prompt message is used to prompt the user to determine the target indication information corresponding to the target board;
[0036] The receiving unit is used to receive externally input target indication information based on the peripheral interface.
[0037] In one example, the device further includes:
[0038] A writing unit is used to write the externally input target indication information into the memory.
[0039] In one example, the number of the memories is multiple;
[0040] The writing unit comprises:
[0041] A first determination module is used to determine the access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory respectively when obtaining the indication information;
[0042] The writing module is used to write the target indication information into the memory corresponding to the highest access order priority.
[0043] In one example, the number of the memories is multiple;
[0044] The second acquisition unit includes:
[0045] A second determination module is used to determine the access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory respectively when obtaining the indication information;
[0046] A first acquisition module, used to sequentially access the memory in the target board according to the access order priority until the target indication information is acquired;
[0047] The second acquisition module is used to acquire the target board configuration information corresponding to the target board according to the target indication information.
[0048] In a third aspect, the present application provides a central processing unit, wherein the central processing unit is used to implement the method as described in any one of the first aspects.
[0049] In a fourth aspect, the present application provides an embedded board, which includes: a memory, a peripheral interface, and a central processing unit as described in the third aspect; the central processing unit is connected to the memory and the peripheral interface respectively.
[0050] In a fifth aspect, the present application provides an electronic device, comprising: the embedded board as described in the fourth aspect.
[0051] In a sixth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0052] In a seventh aspect, the present application provides a computer program product, comprising a computer program, which implements the method described in any one of the first aspects when executed by a processor.
[0053] The startup method, device, central processing unit and embedded board provided by the present application include: obtaining general configuration information, and initializing and configuring the memory according to the general configuration information; the general configuration information is the minimum configuration information compatible with various embedded boards with the same processor, and is used to configure the general modules in various embedded boards with the same processor; if it is determined that the memory includes the target indication information corresponding to the target board, then according to the target indication information, the target board configuration information corresponding to the target board is obtained; according to the target board configuration information, the execution code corresponding to the target board configuration information is determined; and according to the execution code and the target board configuration information, the target board is controlled to start. In the present application, in the process of starting the embedded board, in order to determine the execution code corresponding to the target board to be started, the target indication information corresponding to the target board can be obtained first, and then the target board configuration information corresponding to the target board can be further obtained based on the obtained target indication information. After determining the target board configuration information, the execution code corresponding to the target board configuration information can be automatically matched, and then the startup of the embedded board is completed according to the execution code obtained by matching. That is, in the present application, the board configuration information corresponding to the board is determined through the above two acquisition actions, and based on the determined target board configuration information, the execution code corresponding to the target board configuration information is automatically matched, so that the boot loading firmware containing multiple execution codes can be adapted to the startup of different embedded boards. It can be understood that, compared with the related art, each embedded board is pre-set with its corresponding boot loading firmware, and the boot loading firmware is directly run at startup to complete the startup of the embedded board, the startup method of the present application is conducive to improving the compatibility of the boot loading firmware, that is, it is applicable to embedded boards with the same central processor and different hardware configuration information. When the above boot loading firmware with multiple execution codes is set to embedded boards with different hardware configuration information, it can ensure that the embedded boards can select the execution code that matches their own configuration information to complete the normal startup of the board, and the corresponding hardware can also work normally. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] 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.
[0055] Figure 1 A schematic diagram of a method for starting an embedded board provided in an embodiment of the present application;
[0056] Figure 2 A schematic diagram of a process flow of another method for starting an embedded board provided in an embodiment of the present application;
[0057] Figure 3A schematic diagram of the structure of an embedded board provided in an embodiment of the present application;
[0058] Figure 4 A schematic diagram of the structure of a startup device of an embedded board provided in an embodiment of the present application;
[0059] Figure 5 A schematic diagram of the structure of another startup device of an embedded board provided in an embodiment of the present application;
[0060] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0061] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0062] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.
[0063] In the embedded field, before the operating system runs, it is usually necessary to load the bootloader firmware to initialize the device and prepare for the startup of the operating system. However, for embedded boards with different chip architectures, different central processors, or different board hardware configurations, the corresponding bootloader firmware is also different, and users need to compile them manually, which leads to a large number of bootloader firmware versions that users need to maintain and compile.
[0064] In a possible implementation, in order to improve the compatibility of the boot loading firmware, the user will configure multiple execution codes in the boot loading firmware. The user can compile the boot loading firmware with multiple execution codes according to the hardware configuration information corresponding to the embedded board, that is, the user selects an execution code of the boot loading firmware that meets the current hardware configuration information from the multiple execution codes. After the user compiles successfully, the compiled firmware is stored in the corresponding embedded board, so that the embedded board can subsequently load the boot loading firmware according to the execution code indicated by the user to realize the startup of the embedded board.
[0065] In the above method, the boot loading firmware compiled successfully by the user can still only be applied to the board with the same chip architecture, the same central processor and the same hardware configuration information as the embedded board, and the user still needs to perform a lot of boot loading firmware configuration.
[0066] In a possible implementation, for boards with the same partial central processor and the same hardware configuration information, the boot loading firmware is set to support only the initialization of the same functions between the above boards, so that the boot loading firmware is adapted to some embedded boards. This solution improves the compatibility of the firmware to a certain extent, but the compatibility range is also limited, and the difference parts of the boards are not supported by the boot loading firmware, resulting in functional loss, that is, the embedded boards cannot start normally.
[0067] The embedded board startup method, device, central processing unit and embedded board provided in the present application are used to solve the above-mentioned technical problems.
[0068] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0069] Figure 1 A schematic diagram of a method for starting an embedded board provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0070] S101, obtaining general configuration information, and initializing a configuration memory according to the general configuration information; the general configuration information is the minimum configuration information compatible with various embedded boards with the same processor, and is used to configure general modules in various embedded boards; the memory is used to store indication information, and the indication information is used to indicate the board configuration information corresponding to the embedded board corresponding to the memory.
[0071] For example, the execution subject of the startup method of the embedded board provided in this embodiment may be a central processing unit provided in the embedded board, or other control units. The central processing unit is taken as an example for description in this application.
[0072] When it is necessary to control the startup of an embedded board, first, the central processing unit set on the embedded board can obtain the pre-stored general configuration information, wherein the general configuration information can be understood as the minimum configuration information required for the initialization startup of the general modules in various embedded boards compatible with the same processor, and the minimum configuration information only contains the necessary configuration parameters to initialize the general modules uniformly carried in various embedded boards. For example, the general module may include a memory storing board information set on the embedded board. In practical applications, the minimum configuration information may be the same configuration information corresponding to various embedded boards with the same processor, such as an EEPROM or other memory storing board configuration information, and initialization information corresponding to a serial port device communicating with a user.
[0073] After obtaining the general configuration information, the central processing unit can initialize the configuration of the memory set on the embedded board according to the general configuration information. After the memory is initialized, the central processing unit can access the memory.
[0074] In addition, the memory provided on the embedded board can be used to store indication information indicating the configuration information of the board. When the central processor accesses the memory, it can match the memory according to the indication information and call the board configuration information corresponding to each embedded board respectively.
[0075] S102: If it is determined that the memory includes target indication information corresponding to the target board, then, according to the target indication information, obtain target board configuration information corresponding to the target board.
[0076] Exemplarily, after the CPU initializes the memory on the board (i.e., the target board) corresponding to the configuration, the CPU can access the memory on the target board to obtain the target indication information in the memory for indicating the target board configuration information corresponding to the target board. If the CPU determines that the target indication information exists in the target board, the target board configuration information indicated by the target indication information can be further obtained according to the target indication information. For example, the target indication information can be the storage location of the target board configuration information, and then the corresponding target board configuration information can be determined according to the storage location.
[0077] In one example, when the configuration information of the target board is obtained according to the target indication information, the target indication information can be directly fed back to the user to notify the user to input the target board configuration information or the acquisition address information of the target board configuration information.
[0078] S103: Determine the execution code corresponding to the target board configuration information according to the target board configuration information.
[0079] For example, in this embodiment, in order to control the startup of the target board, after determining the target board configuration information of the target board, it is also necessary to determine the execution code corresponding to the target board configuration information. The execution code is the code that needs to be executed when the target board with the above target board configuration information is started.
[0080] For example, in actual applications, a plurality of different execution codes are stored in the boot loading firmware corresponding to each embedded board, wherein each execution code corresponds to a configuration information of an embedded board. By setting the execution codes corresponding to the various embedded boards in the boot loading firmware, the boot loading firmware can be applied to a plurality of embedded boards with the same central processor and different board configuration information. Since different types of embedded boards have the same processor but different other modules, when the embedded board is started later, it is only necessary to match the target board configuration information corresponding to the current target board, and initialize the other modules carried in the target board, such as the sound card, the network card, etc., according to the execution codes obtained by the match, so as to start all the modules in the target board and start the embedded board.
[0081] S104, controlling the target board to start up according to the execution code and the target board configuration information.
[0082] Exemplarily, after determining the execution code corresponding to the target board, the central processing unit further configures the target board configuration information based on the acquired execution code to control the startup of the target board.
[0083] It should be noted that, in this embodiment, during the startup process of the embedded board, in order to determine the execution code corresponding to the target board to be started, the target indication information corresponding to the target board can be first obtained, and then the target board configuration information corresponding to the target board can be further obtained based on the obtained target indication information. After the target board configuration information is determined, the execution code corresponding to the target board configuration information can be automatically matched, and then the startup of the embedded board is completed according to the matched execution code. It can be understood that, compared with the related art in which each embedded board has its own corresponding boot loading firmware pre-set independently, and at startup, the boot loading firmware is directly run to complete the startup of the embedded board, the boot loading firmware provided in this embodiment has higher compatibility, that is, it is suitable for embedded boards with the same central processor and different hardware configuration information; and, based on the setting of the above-mentioned boot loading firmware, two acquisition actions can be performed during the startup process: that is, obtaining target indication information, and obtaining the corresponding target board configuration information according to the target indication information, and the target board configuration information is obtained; then, the corresponding execution code is automatically matched, thereby ensuring that when the above-mentioned boot loading firmware with different execution codes is set to embedded boards with different hardware configuration information, it can ensure that various embedded boards can complete normal startup and their corresponding hardware can also work normally.
[0084] Figure 2 A flowchart of another method for starting an embedded board provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the method includes:
[0085] S201. Obtain general configuration information.
[0086] S202, initializing the configuration memory according to the general configuration information; the general configuration information is the minimum configuration information compatible with various embedded boards with the same processor, and is used to configure the general modules in various embedded boards with the same processor; the memory is used to respectively store the indication information corresponding to various embedded boards, and the indication information is used to indicate the board configuration information corresponding to the embedded board corresponding to the memory.
[0087] For example, the execution subject of this embodiment is described by taking the central processing unit provided in the embedded board as an example. The technical principles of steps S201 and S202 can refer to step S101, and will not be repeated here.
[0088] S203: Initialize and configure the peripheral interface according to the general configuration information, and the target board has the peripheral interface.
[0089] Exemplarily, in the present embodiment, a peripheral interface can also be set in the target board, wherein the peripheral interface can be used as an interface for interacting with the user, and the user can issue instructions to the central processing unit through the interface. In the present embodiment, after the central processing unit is powered on and the initialization configuration memory is completed, the peripheral interface in the target board can also be initialized by the obtained general configuration information, so that the central processing unit can accurately identify the peripheral interface, and obtain the instruction information input by the user based on the peripheral interface, and send information to the user based on the peripheral interface. That is, the above-mentioned general configuration information can also include initialization information corresponding to the peripheral interface of various boards with the same central processing unit. It should be noted that step S203 can be executed after step S201, and is executed after determining that the target indication information is not included in the memory, and is not specifically limited in the present embodiment.
[0090] S204. If it is determined that the memory includes target indication information corresponding to the target board, then in the pre-stored hardware configuration information set, the target board configuration information corresponding to the target board is obtained according to the target indication information; wherein the hardware configuration information set includes board configuration information corresponding to a variety of hardware carried by various boards, and the board configuration information corresponds to the indication information one by one.
[0091] Exemplarily, the various embedded boards provided in this embodiment may include boot loading firmware with different execution codes. In addition, board configuration information corresponding to the various embedded boards to which the boot loading firmware is applicable is pre-stored.
[0092] For example, when the boot loading firmware set in the embedded board is applicable to three embedded boards (for example, board 1, board 2 and board 3) with the same central processor and different hardware configuration information, at this time, the embedded board also stores the board configuration information corresponding to board 1, board 2 and board 3 respectively. These board configuration information constitute a hardware configuration information set, which is stored in the above-mentioned various embedded boards, and the board configuration information and the indication information correspond one to one.
[0093] When the target board needs to be started, the central processing unit determines that the memory includes target indication information by accessing the memory. At this time, a hardware configuration information set can be pre-set in the memory to correspond to the board configuration information corresponding to each embedded board, and matching is performed in the hardware configuration information set according to the target indication information to automatically determine the target board configuration information corresponding to the target board. For example, after the development of the target board is completed, the developer can write the target indication information corresponding to the board into the memory carried by the target board. In actual applications, the target indication information can be the board identification information corresponding to the target board or the corresponding product serial number, which is not specifically limited in this embodiment.
[0094] For example, when the target indication information is a product serial number, the target board configuration information may also include the above product serial number. Furthermore, after obtaining the target indication information, the board configuration information including the above target indication information may be searched in the pre-stored hardware configuration information set as the configuration information of the target board.
[0095] It can be understood that in this embodiment, the embedded board is not only provided with boot loading firmware suitable for different boards, but also may pre-store a set of hardware configuration information. When the target board is started, the target indication information may be first obtained, and the target board configuration information corresponding to the target board may be obtained from the pre-stored set of hardware configuration information according to the obtained target indication information, thereby eliminating the need for the user to manually input configuration information or to access and obtain configuration information from other devices (i.e., devices other than the target board), which is beneficial to improving the startup efficiency of the target board.
[0096] In some embodiments, when a plurality of memories can be set in the target board, when executing the step S201 of "determining that the memory includes the target indication information corresponding to the target board", the following steps may be included: determining the access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory when obtaining the indication information; according to the access order priority, the memory in the target board is accessed in sequence until the target indication information is obtained. ".
[0097] For example, when there are multiple memories on the target board, when the CPU needs to obtain the target indication information, at this time, the CPU can first obtain the access order priority of the preset memory, wherein the access order priority of the memory is used to indicate the access order of the multiple memories by the CPU when obtaining the indication information. Afterwards, the CPU can access each memory in turn according to the access order priority until all memory accesses are completed or the indication information is found in the memory, at which time, the CPU's access process to the memory is terminated.
[0098] For example, if the CPU obtains the target indication information during the target indication information access process, it can stop accessing the memory. If the CPU cannot find the target indication information after accessing all memories, it is determined that the target indication information does not exist in the memory, and it is necessary to receive the indication information input from the outside based on the peripheral interface.
[0099] It can be understood that by setting the above access order priority, the user can specify that the memory storing the indication information has the highest access priority. Compared with the central processing unit randomly accessing the memory on the embedded board, the above method is beneficial for the central processing unit to obtain the indication information as soon as possible, thereby speeding up the startup efficiency of the embedded board.
[0100] S205: If it is determined that the memory does not include the target indication information, a prompt message is sent to the user; the prompt message is used to prompt the user to determine the target indication information corresponding to the target board.
[0101] Exemplarily, if the CPU determines that the target indication information is not written into the memory by accessing the memory on the target board, at this time, the CPU in the target board sends a prompt message to the user so that the user can promptly feedback the target indication information corresponding to the target board to the CPU through the peripheral interface. For example, in practical applications, an indicator light can be set on the target board, and when the CPU determines that the current memory does not include the target indication information, the CPU can control the indicator light to flash, thereby prompting the user to output the indication information to the CPU. Alternatively, a buzzer can be set in the target board, and when the CPU determines that the current memory does not include the target indication information, the CPU can control the indication buzzer to sound, thereby prompting the user to output the indication information to the CPU. It should be noted that in this embodiment, there is no specific restriction on the way to send the prompt message.
[0102] S206: Receive external target indication information based on the peripheral interface.
[0103] Illustratively, in this embodiment, the central processing unit may be connected to a peripheral interface provided on the target board, and may receive externally input target indication information through the peripheral interface.
[0104] Furthermore, after the CPU receives the target indication information inputted from the outside, the step of "obtaining the target board configuration information corresponding to the target board according to the target indication information in the pre-stored hardware configuration information set" in step S204 can be executed to start the target board.
[0105] It is understandable that, in this embodiment, a peripheral interface may also be provided on the embedded board, thereby avoiding the phenomenon that the embedded board cannot be started normally when the developer does not set the instruction information in the memory.
[0106] S207: Write the externally input target indication information into the memory.
[0107] Exemplarily, in this embodiment, after step S206, when the central processing unit obtains the indication information of the external input through the peripheral interface, it further stores the target indication information in the memory set on the target board. Then, in the subsequent startup process of the target board, the target indication information can be directly obtained from the memory without the need for external input by the user.
[0108] It can be understood that in this embodiment, after the central processing unit obtains the target indication information input from the outside, it can also back up the received target indication information and store it in the memory on the target board so that when the target board is started later, there is no need to waste time requesting the corresponding target indication information from the user again.
[0109] For example, when the target board includes multiple memories, the above-mentioned target indication information can be written into each memory in the target board, so that when a memory failure occurs later, the target indication information can be obtained from the remaining memories that have not failed, so as to obtain the target board configuration information corresponding to the target board according to the target indication information, and then match the corresponding execution code to start the target board.
[0110] In one example, when there are multiple memories on the target board, step S207 may include the following steps: "Determine the access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory when obtaining indication information; write the target indication information into the memory corresponding to the highest access order priority."
[0111] Exemplarily, in this embodiment, there are multiple memories on the target board, and the multiple memories also have their own corresponding access order priorities (i.e., the access order priority represents the access order corresponding to the central processing unit accessing the memory when obtaining the target indication information from the memory). After the central processing unit obtains the target indication information input from the outside, when it is determined that there are multiple memories on the current target board, the access order priority corresponding to each memory can be obtained, and the target indication information can be written into the memory with the highest access priority, so that the subsequent central processing unit can obtain the indication information from the multiple memories as quickly as possible, thereby improving the startup efficiency of the target board. It should be noted that the access order priority corresponding to the memory can be information pre-configured by the user, and can be directly obtained from the configuration information.
[0112] S208: Determine the execution code corresponding to the target board configuration information according to the target board configuration information.
[0113] S209: Control the target board to start up according to the execution code and the target board configuration information.
[0114] Exemplarily, the specific implementation principles of step S208 and step S209 can refer to step S103 and step S104, and are not specifically limited in this embodiment.
[0115] It is understandable that, in the present embodiment, the embedded board is not only provided with a startup loading firmware suitable for different boards, but also a hardware configuration information set can be pre-stored. When the target board is started, the target indication information can be first obtained, and the target board configuration information corresponding to the target board can be obtained in the pre-stored hardware configuration information set according to the obtained target indication information, and then there is no need for the user to manually input the configuration information or to access and obtain the remaining devices (i.e., the devices other than the target board), which is conducive to improving the startup efficiency of the target board. In addition, the peripheral interface can also be set on the embedded board, so as to avoid the phenomenon that the embedded board cannot be started normally when the developer does not set the indication information in the memory. After the central processing unit obtains the target indication information of the external input based on the peripheral interface, the received target indication information can also be stored in the memory on the target board, so that the subsequent target board does not need to be time-consuming to request the corresponding target indication information from the user again when starting. In addition, when there are multiple memories on the target board, the target indication information can be written into the memory with the highest access priority, so that the subsequent central processing unit can obtain the indication information from multiple memories as soon as possible, so as to improve the startup efficiency of the target board.
[0116] It should be noted that the configuration information provided in this embodiment can use the dtb data structure of the device tree (dts for short) to describe the configuration information of the peripheral interfaces corresponding to each embedded board, the configuration information of the memory, and the configuration information of the remaining hardware devices. In addition, when packaging the device tree data, the FIT-image format provided in the relevant technology can also be used for packaging, so as to be applicable to a variety of central processing units and facilitate the central processing unit to parse.
[0117] Figure 3 A schematic diagram of the structure of an embedded board provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, in the embedded board, there are multiple memories connected to the central processing unit, and only one memory is drawn in the figure. The above memory can be used to store one or more of the boot loading firmware, hardware configuration information set, general configuration information and indication information involved in the embodiment of the present application. In one example, information such as boot loading firmware, hardware configuration information set, general configuration information can also be stored in the storage space contained in the central processing unit. In addition, the type of memory is not specifically limited in this embodiment, for example, it can be SPI flash (i.e., a non-volatile memory that communicates based on a serial peripheral interface bus), or EEPROM (Electrically Erasable Programmable read only memory), etc.
[0118] In addition, the embedded board is also provided with a peripheral interface, which is connected to the central processing unit. The central processing unit can be used to communicate with external devices through the external interface. In this embodiment, it is mainly used when the central processing unit determines that it cannot obtain indication information from the memory. At this time, the indication information of the external input can be received through the peripheral interface.
[0119] The embedded board provided in this embodiment is used to implement the technical solution provided by the above method. Its implementation principle and technical effect are similar and will not be described in detail.
[0120] For example, in actual applications, the same boot loading firmware can be configured in various embedded boards with the same central processor and different other hardware configurations. Among them, the boot loading firmware includes execution codes adapted to the startup of various embedded boards. In addition, the above-mentioned various embedded boards are also provided with general configuration information that can be used for the minimized startup of various embedded boards. For example, the general configuration information includes configuration information corresponding to some memories and configuration information corresponding to general peripheral interfaces, that is, the general configuration information can be used to configure the minimized common configuration in the above-mentioned various boards, but not all the configuration information corresponding to the entire board. In addition, the minimized common configuration can only be used to support the central processor to access the memory, the memory resources required for the device startup, and to identify the indication information based on the peripheral interface input.
[0121] When the target board is started, the central processor set by the target board is first powered on and initialized. After that, the central processor can obtain the general configuration and initialize the configuration of the multiple memories installed on the target board and the peripheral interfaces set on the target board. After the initialization configuration is completed, the central processor obtains the target indication information corresponding to the target board for the second time, wherein the target indication information can be directly obtained from the memory by the central processor, or it can be the external input received by the peripheral interface when the central processor determines that the memory does not include the target indication information. After obtaining the target indication information, the target board configuration information corresponding to the target indication information is selected from the pre-stored hardware configuration information set. And, after obtaining the target indication information, if it is determined that the target indication information is externally input, the target indication information can be stored in the memory corresponding to the target board. Specifically, it can be stored in multiple memories, or it can be stored in the memory with the highest access order priority. Furthermore, through the above two acquisition processes, the target board configuration information corresponding to the target board is successfully identified. After that, the execution code corresponding to the target board configuration information can be selected in the startup loading firmware according to the determined target board configuration information, and the target board startup is controlled based on the selected execution code and the target board configuration information. Here, it should be noted that the target board configuration information obtained by the second acquisition is all the configuration information corresponding to the board. It can be understood that due to the different hardware devices and resource allocations set on various boards, all the configuration information corresponding to the above various boards is different, but some common configurations (i.e., the above common configuration information), such as storage configuration, interface configuration, etc., all have common parts.
[0122] Figure 4 A schematic diagram of a startup device for an embedded board provided in an embodiment of the present application is shown in FIG. Figure 4As shown, the startup device is applied to the central processor set in the embedded board, and the device includes:
[0123] The first acquisition unit 401 is used to acquire general configuration information.
[0124] The first configuration unit 402 is used to initialize the configuration memory according to the general configuration information; the general configuration information is the minimum configuration information compatible with various embedded boards with the same processor, and is used to configure the general modules in various embedded boards with the same processor; the memory is used to store indication information, and the indication information is used to indicate the board configuration information corresponding to the embedded board corresponding to the memory.
[0125] The second acquisition unit 403 acquires the target board configuration information corresponding to the target board according to the target indication information if it is determined that the memory includes the target indication information corresponding to the target board.
[0126] The determination unit 404 is used to determine the execution code corresponding to the target board configuration information according to the target board configuration information.
[0127] The control unit 405 is used to control the target board to start up according to the execution code and the target board configuration information.
[0128] The device provided in this embodiment is used to implement the technical solution provided by the above method. Its implementation principle and technical effect are similar and will not be described in detail.
[0129] Figure 5 A schematic diagram of the structure of another startup device of an embedded board provided in an embodiment of the present application, wherein the startup device is applied to a central processor provided in the embedded board. Figure 4 Based on the structure shown, in one example, the second acquisition unit 403 is specifically used to:
[0130] If it is determined that the memory includes target indication information corresponding to the target board, then in the pre-stored hardware configuration information set, the target board configuration information corresponding to the target board is obtained according to the target indication information; wherein the hardware configuration information set includes board configuration information corresponding to a variety of hardware carried by various boards, and the board configuration information corresponds to the indication information one-to-one.
[0131] In one example, the target board has a peripheral interface; the device further includes:
[0132] The second configuration unit 406 is used to initialize and configure the peripheral interface according to the general configuration information.
[0133] The sending unit 407 is used to send a prompt message to the user if it is determined that the memory does not include the target indication information; the prompt message is used to prompt the user to determine the target indication information corresponding to the target board.
[0134] The receiving unit 408 is used to receive externally input target indication information based on the peripheral interface.
[0135] In one example, the device further includes:
[0136] The writing unit 409 is used to write the externally input target indication information into the memory.
[0137] In one example, the number of memories is multiple;
[0138] The writing unit 409 includes:
[0139] The first determination module 4091 is used to determine the access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory when obtaining the indication information.
[0140] The writing module 4092 is used to write the target indication information into the memory corresponding to the highest access order priority.
[0141] In one example, the number of memories is multiple;
[0142] The second acquisition unit 403 includes:
[0143] The second determination module 4031 is used to determine the access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory when obtaining the indication information;
[0144] The first acquisition module 4032 is used to access the memory in the target board in sequence according to the access order priority until the target indication information is acquired.
[0145] The second acquisition module 4033 is used to acquire the target board configuration information corresponding to the target board according to the target indication information.
[0146] The device provided in this embodiment is used to implement the technical solution provided by the above method. Its implementation principle and technical effect are similar and will not be described in detail.
[0147] The present application provides a central processing unit, which is used to implement the method provided in any one of the above embodiments.
[0148] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the electronic device includes:
[0149] The electronic device further includes a central processing unit (291) and a memory (memory) 292; it may also include a communication interface (Communication Interface) 293 and a bus 294. The central processing unit 291, the memory 292, and the communication interface 293 may communicate with each other through the bus 294. The communication interface 293 may be used for information transmission. The central processing unit 291 may call the logic instructions in the memory 292 to execute the method of the above embodiment.
[0150] In addition, the logic instructions in the above-mentioned memory 292 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0151] The memory 292 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present application. The central processing unit 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, that is, implementing the methods in the above method embodiments.
[0152] The memory 292 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 292 may include a high-speed random access memory and may also include a non-volatile memory.
[0153] The present application provides a central processing unit, which is used to implement the method provided by any of the above embodiments.
[0154] The present application provides an embedded board, which includes: a memory, a peripheral interface and the above-mentioned central processing unit; the central processing unit is connected to the memory and the peripheral interface respectively.
[0155] The present application provides an electronic device, including: the above-mentioned embedded board.
[0156] The present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement any one of the methods.
[0157] The present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, any one of the methods is implemented.
[0158] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
[0159] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for starting an embedded board, characterized in that: include: Acquire general configuration information, and initialize and configure the memory and peripheral interface of the embedded board according to the general configuration information; The general configuration information is the minimum configuration information compatible with various embedded boards with the same processor, and is used to configure the general modules in the various embedded boards with the same processor; The memory is used to store indication information and the boot loading firmware corresponding to the embedded board, and the indication information is used to indicate the board configuration information corresponding to the embedded board corresponding to the memory; If it is determined that the memory includes target indication information corresponding to the target board, then in the pre-stored hardware configuration information set, according to the target indication information, the target board configuration information corresponding to the target board is obtained; wherein the hardware configuration information set includes board configuration information corresponding to a variety of hardware carried by various boards, and the board configuration information corresponds to the indication information one by one; the target indication information is the storage location of the target board configuration information; According to the target board configuration information, select an execution code corresponding to the target board configuration information in the startup loading firmware; and control the startup of the target board according to the execution code and the target board configuration information; The method further includes: if it is determined that the memory does not include the target indication information, receiving the target indication information input from the outside based on the peripheral interface.
2. The method according to claim 1, characterized in that The method further comprises: When the target indication information is not included in the memory, prompt information is sent to the user; the prompt information is used to prompt the user to determine the target indication information corresponding to the target board.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: The target indication information input from the outside is written into the memory.
4. The method according to claim 3, characterized in that The number of the memories is multiple; The step of writing the externally input target indication information into the memory comprises: Determine an access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory when obtaining indication information; The target indication information is written into the memory corresponding to the highest access order priority.
5. The method according to claim 1, characterized in that: The number of the memories is multiple; The step of determining that the memory includes target indication information corresponding to the target board includes: Determine an access order priority corresponding to each memory; the access order priority is used to indicate the order in which the processor accesses each memory when obtaining indication information; According to the access order priority, the memory in the target board is accessed in sequence until the target indication information is acquired.
6. A startup device for an embedded board, characterized in that: include: A first acquisition unit, used to acquire general configuration information; A first configuration unit, configured to initialize and configure the memory and peripheral interface of the embedded board according to the general configuration information; the general configuration information is the minimum configuration information compatible with various embedded boards with the same processor, and is used to configure the general modules in the various embedded boards with the same processor; The memory is used to store indication information and the boot loading firmware corresponding to the embedded board, and the indication information is used to indicate the board configuration information corresponding to the embedded board corresponding to the memory; The second acquisition unit, if it is determined that the memory includes the target indication information corresponding to the target board, then acquires the target board configuration information corresponding to the target board in the pre-stored hardware configuration information set according to the target indication information; wherein the hardware configuration information set includes board configuration information corresponding to a variety of hardware carried by various boards, and the board configuration information corresponds to the indication information one by one; the target indication information is the storage location of the target board configuration information; A determination unit, configured to select, in the boot loading firmware, an execution code corresponding to the target board configuration information according to the target board configuration information; A control unit, used for controlling the target board to start up according to the execution code and the target board configuration information; The device also includes: The receiving unit is configured to receive the target indication information input from the outside based on the peripheral interface if it is determined that the target indication information is not included in the memory.
7. A central processing unit, characterized in that: The central processing unit is used to implement the method according to any one of claims 1 to 5.
8. An embedded board, characterized in that: The embedded board includes: a memory, a peripheral interface and the central processing unit as claimed in claim 7; the central processing unit is connected to the memory and the peripheral interface respectively.
9. An electronic device, characterized in that: include: The embedded board as claimed in claim 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.
11. 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 method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device achieving embedded type device bootstrap program generality
CN103135997A
Processor initialization method and device
CN103514001A