WO2012051834A1 - 一种多外设系统引导程序的实现方法、设备及系统 - Google Patents

一种多外设系统引导程序的实现方法、设备及系统 Download PDF

Info

Publication number
WO2012051834A1
WO2012051834A1 PCT/CN2011/072215 CN2011072215W WO2012051834A1 WO 2012051834 A1 WO2012051834 A1 WO 2012051834A1 CN 2011072215 W CN2011072215 W CN 2011072215W WO 2012051834 A1 WO2012051834 A1 WO 2012051834A1
Authority
WO
WIPO (PCT)
Prior art keywords
command
server
boot
external device
download
Prior art date
Application number
PCT/CN2011/072215
Other languages
English (en)
French (fr)
Inventor
孙恒
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012051834A1 publication Critical patent/WO2012051834A1/zh

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

Definitions

  • the present invention relates to the field of computer network technologies, and in particular, to a method, a device and a system for implementing a multi-peripheral system boot program with a reliability detection function applied to an embedded product. Background technique
  • the system boot program (boot) is the first piece of code that the embedded system powers up and runs.
  • the code is usually hardened into the bootrom of the chip and is a subroutine that runs before the user application runs. Through this subroutine, you can initialize the hardware device, establish a map of memory space, and prepare the correct running environment for the final download user application.
  • Embedded system application software is generally programmed by the device developer to the external storage medium (NOR FLASH or EEPROM) through EJTAG debugger or programmer during trial production or production. Its boot function is very weak, especially for multi-peripheral embedded systems. In terms of the boot, there are many ways. During the system debugging process, the boot process fails due to physical connection errors, application exceptions, and chip anomalies. In this case, special equipment or simulators are needed for debugging analysis. Since ordinary customers do not have the above conditions, and the debugging and error positioning time is long, the after-sales cost and maintenance cycle are increased.
  • the main object of the present invention is to provide a method, a device and a system for implementing a multi-peripheral boot with reliability detection function, which are intended to provide reliable boot boot programs for multi-peripheral embedded products. Sex detection to improve system performance.
  • the invention provides a multi-peripheral boot implementation method with reliability detection function, comprising: before an external device connects to a server through a peripheral interface, selecting a corresponding boot startup mode; when the external device is connected with the server, according to the selected boot The startup mode performs an initialization operation, and registers a corresponding data receiving and transmitting function;
  • the server performs the boot command interaction to detect the boot download process.
  • the command transmission protocol includes: command description information of the server sending command, command packet information, and command response information of the external device; the command description information includes a command identifier, a packet length, a command type, and a command content;
  • the command packet information includes command data determined by the command type;
  • the command response information includes a response identifier, a response type, a response content, and a command execution status.
  • the command type includes code download, test, breakpoint retransmission, and/or setting to send fixed data.
  • the detecting according to the agreed command transmission protocol, interacting with the server to perform a boot command, and detecting the boot download process includes:
  • the command is a download code command
  • the code program is downloaded, and a command response message is returned to the server;
  • the download code is run, and the command response information is returned to the server;
  • the test function command is processed according to the test function type and the command response information is returned to the server.
  • the method further includes: The command transmission protocol between the server and the external device is formulated according to the peripheral interface.
  • the invention also provides a multi-peripheral boot implementation device with a reliability detection function, comprising: a boot mode selection module, configured to select a corresponding boot startup mode before connecting to a server through a peripheral interface;
  • An initialization module configured to perform an initialization operation according to the selected boot startup mode after the external device is connected to the server, and register a corresponding data receiving and transmitting function
  • the boot detection module interacts with the server through the boot command according to the agreed command transmission protocol to implement detection of the boot download process.
  • the boot detection module includes:
  • a command receiving unit configured to receive a command sent by the server
  • a command response unit configured to: when the command is a download code command, download the code program, and return a command response message to the server; when the command is a code download completion command, run the download code, and return a command response message to the server And when the command is a test function command, the test function command is processed according to the test function type and the command response information is returned to the server.
  • the device further includes a transmission protocol formulating module, configured to formulate the command transmission protocol between the server and the external device according to the peripheral interface.
  • a transmission protocol formulating module configured to formulate the command transmission protocol between the server and the external device according to the peripheral interface.
  • the present invention also provides an implementation system of a multi-peripheral boot with a reliability detection function, including: an external device and a server connected to the external device through a peripheral interface;
  • the external device is configured to select a corresponding boot startup mode before connecting with the server; when the external device is connected to the server, perform an initialization operation according to the selected boot startup mode, and register a corresponding data receiving and transmitting function;
  • the command transmission protocol interacts with the server to perform the boot command to detect the boot download process.
  • the server is configured to perform a boot command interaction with an external device according to an agreed command transmission protocol to implement detection of a boot download process.
  • the server is further configured to send a command to the external device; and receive command response information returned by the external device according to the command;
  • the external device is further configured to receive a command sent by the server, when the command is a download code command, download the code program, and return a command response message to the server; when the command is the code downloading, run the download code, And returning command response information to the server; and when the command is a test function command, the test function command is processed according to the test function type and the command response information is returned to the server.
  • the method, device and system for implementing multi-peripheral boot with reliability detection function according to the characteristics of the multi-peripheral interface, formulate a corresponding command transmission protocol, and select a corresponding boot startup mode according to the type of peripheral interface selected by the user. And in accordance with the established command transmission protocol, the command data is exchanged between the external device and the host server to implement the detection of the boot download process, thereby ensuring the correct operation of the system boot program in the event of an uncertain factor.
  • the implementation method is simple and reliable.
  • Embodiment 1 is a schematic flow chart of Embodiment 1 of a method for implementing a multi-peripheral boot with a reliability detection function according to the present invention
  • FIG. 2 is a schematic flowchart of a method for implementing a boot command process by performing a boot command interaction with a server according to an agreed command transmission protocol
  • Embodiment 3 is a schematic flowchart of Embodiment 2 of a method for implementing a multi-peripheral boot with a reliability detection function according to the present invention
  • Embodiment 4 is a schematic structural diagram of Embodiment 1 of an apparatus for implementing a multi-peripheral boot with a reliability detecting function according to the present invention
  • FIG. 5 is a schematic structural diagram of a boot detecting module of a device for implementing a multi-peripheral boot with a reliability detecting function according to the present invention
  • FIG. 6 is a second embodiment of an apparatus for implementing a multi-peripheral boot with reliability detection function according to the present invention. Schematic diagram of the structure
  • Fig. 7 is a schematic structural view showing an implementation system of a multi-peripheral boot with a reliability detecting function according to the present invention. detailed description
  • the solution of the embodiment of the present invention mainly formulates a corresponding command transmission protocol according to the characteristics of the multi-peripheral interface, selects a corresponding boot startup mode according to the type of the peripheral interface selected by the user, and follows the established command transmission protocol on the external device and the host server. The interaction of command data is performed to detect the boot download process.
  • an embodiment of the present invention provides a method for implementing a multi-peripheral boot with a reliability detection function, including:
  • Step S101 Before the external device connects to the server through the peripheral interface, select a corresponding boot startup mode.
  • the peripheral interface may be an SPI (Serial Peripheral Interface), a USB (Universal Serial BUS) interface, and an SDIO (Secure Digital Input and Output Card).
  • SPI Serial Peripheral Interface
  • USB Universal Serial BUS
  • SDIO Secure Digital Input and Output Card
  • server can be a host with multiple peripheral interfaces in the embedded system, such as PC, notebook, etc., external devices can have a variety of peripheral interfaces, and can be based on the peripheral interface of the server Choose to determine your own peripheral interface and connect to the server;
  • the embodiment performs a command interaction between the server and the external device through a predetermined command transmission protocol between the server and the external device, thereby achieving the purpose of detecting the boot download process;
  • the boot boot mode depends on the peripheral interface selected by the user.
  • the user can set the boot boot mode through an external device according to his own needs, including which peripheral interface, master/slave mode, clock, etc.;
  • the user can select the corresponding server to download the code according to the actual needs, so as to select the corresponding boot startup mode, so that after the system is powered on in the subsequent process, the external device is initialized according to the corresponding peripheral interface.
  • Step S102 after the external device is connected to the server, perform an initialization operation according to the selected boot startup mode, and register a corresponding data receiving and transmitting function;
  • the external device After the system is powered on, the external device enters the waiting for receiving command state.
  • step S103 the boot command is exchanged with the server according to the agreed command transmission protocol, and the boot download process is detected.
  • command transmission protocol there is an agreed command transmission protocol between the server and the external device. Because in the boot phase, the requirements for the correctness of the data transmission are far greater than the requirements of the transmission speed, and in the boot phase, the peripheral driver requirements are simplified. Therefore, the normal transmission mode can be used; the command transmission protocol can be divided into three stages: command description, command data packet, and command response;
  • the command transmission protocol includes: command description information of the server sending command, command packet information, and command response information of the external device; wherein, the command description information includes a command identifier, a packet length, a command type, and a command content, wherein the command content For example, the command description checksum, the download code address, etc.; the command packet information includes the command data determined by the command type; the command type includes code download, test, breakpoint retransmission, and/or setting to send fixed data, etc.; command response information includes response Identifier, response type, response content, command execution status, etc.; wherein, for the code download command, the response content is a checksum that feeds back all downloaded data; since the command description information can specify the packet length, therefore, the server sends In the data packet phase, the data of the specified length of the packet length field can be transmitted at one time.
  • the command description information includes a command identifier, a packet length, a command type, and a command content, wherein the command content
  • the command content For example,
  • the server When the external device commands the response phase, the checksum of the data of the data packet phase is read. If the verification result is correct, the server transmits the next phase number. According to the package, on the contrary, the data packet is retransmitted;
  • the external device and the server perform a boot command interaction according to the agreed command transmission protocol. According to the user's selection, the server sends a command to the external device, and the external device receives the command sent by the server, and performs corresponding according to the command.
  • the received command is a download code command, download the code program, and return a command response message to the server, wherein the download of the code program can be downloaded in segments; if the received command is a code download completion command, the download code is run, And returning command response information to the server; if the command is a test function command, the test function command is processed according to the test function type and the command response information is returned;
  • the server can learn the status of the command in the response message according to the command returned by the external device, and the execution success and failure of the command sent by the server, so as to feedback the execution result to the user.
  • step S103 includes:
  • Step S1031 Receive a command sent by the server.
  • Step S1032 When the command is a download code command, download the code program, and return a command response message to the server;
  • the download of the code program can be downloaded in sections.
  • Step S1033 When the command is a code download completion command, the download code is run, and the command response information is returned to the server.
  • Step S1034 When the command is a test function command, the test function command is processed according to the test function type and the command response information is returned to the server;
  • the test function command can be, for example, a read/write register or the like.
  • a corresponding command transmission protocol is formulated according to the characteristics of the multi-peripheral interface, and a corresponding boot startup mode is selected according to the type of the peripheral interface selected by the user, and a command is executed between the external device and the host server according to the established command transmission protocol.
  • the interaction of the data realizes the detection of the boot download process, thereby ensuring the correct operation of the system boot program in the event of uncertain factors, and the implementation method is simple and reliable.
  • another embodiment of the present invention provides a method for implementing a multi-peripheral boot with a reliability detection function, including:
  • Step S300 formulating a command transmission protocol between the server and the external device according to the peripheral interface.
  • Step S301 Before the external device connects to the server through the peripheral interface, select a corresponding boot startup mode.
  • Step S302 After the external device is connected to the server, perform an initialization operation according to the selected boot startup mode, and register a corresponding data receiving and transmitting function.
  • step S303 the boot command is exchanged with the server according to the agreed command transmission protocol, and the boot download process is detected.
  • the difference between this embodiment and the above embodiment is that the command transmission protocol between the server and the external device is made by the external device.
  • the command transmission protocol between the server and the external device is made by the external device.
  • it is necessary to consider the characteristics of each external device, including the depth of FIFO (First In First Out) of various external devices, and the guarantee of correctness of command transmission.
  • FIFO First In First Out
  • command transfer protocol between the server and the external device can also be made by the server.
  • an embodiment of the present invention provides a device for implementing a multi-peripheral boot with a reliability detection function, including: a boot mode selection module 401, an initialization module 402, and a boot detection module 403;
  • the boot mode selection module 401 is configured to select a corresponding boot startup mode before connecting to the server through the peripheral interface;
  • the peripheral interfaces may be SPI, USB interface, SDI0 interface, and the like.
  • the server can be a host with multiple peripheral interfaces in the embedded system, such as a PC, a notebook, etc.
  • the external device can have various peripheral interfaces, and can select and determine its own peripheral according to the peripheral interface of the server. Interface, connected to the server.
  • the present embodiment performs the command exchange between the server and the external device through a predetermined command transmission protocol between the server and the external device, thereby achieving the purpose of detecting the boot download process.
  • the boot mode selection module 401 selects a corresponding boot startup mode, and the boot startup mode is determined according to the peripheral interface selected by the user, and the user can pass the external device according to his own needs.
  • Set the boot startup mode including which peripheral interface, master/slave mode, clock, etc.; through the setting of the external device, the user can select the corresponding server to download the code according to actual needs, thereby selecting the corresponding boot startup mode for subsequent
  • the external device is initialized according to the corresponding peripheral interface.
  • the initialization module 402 when the external device is connected to the server, is configured to perform an initialization operation according to the selected boot startup mode, and register a corresponding data receiving and transmitting function;
  • the boot detection module 403 is configured to perform a boot command exchange with the server according to the agreed command transmission protocol to implement detection of the boot download process.
  • command transmission protocol there is an agreed command transmission protocol between the server and the external device. Because in the boot phase, the requirements for the correctness of the data transmission are far greater than the requirements of the transmission speed, and in the boot phase, the peripheral driver requirements are simplified. Therefore, the normal transfer mode can be used; the command transfer protocol can be divided into three stages: command description, command packet, and command response.
  • the command transmission protocol specifically includes: command description information of the server sending command, command packet information, and command response information of the external device; wherein, the command description information includes a command identifier, a packet length, a command type, and a command content, wherein the command The content such as the command description checksum, the download code address, etc.; the command packet information includes command data determined by the command type; the command type includes code download, test, breakpoint retransmission, and/or setting to send fixed data;
  • the command response information includes a response identifier, a response type, a response content, a command execution status, and the like; wherein, for the code download command, the response content is a checksum that feeds back all downloaded data.
  • the command description information can specify the length of the data packet
  • the data of the specified length of the data packet length field can be transmitted at one time, and the data of the data phase of the data packet is read when the external device commands the response phase. And, if the verification result is correct, the server transmits the next stage data packet, and vice versa, retransmits the data packet.
  • the external device and the server perform a boot command interaction according to the agreed command transmission protocol.
  • the server sends a command to the external device, and the external device receives the command sent by the server, and performs corresponding according to the command. deal with. If the received command is a download code command, the code program is downloaded, and a command response message is returned to the server, wherein the download of the code program can be downloaded in segments; if the received command is a code download completion command, the download code is run, and The server returns a command response message; if the command is a test function command, the test function command is processed according to the test function type and the command response message is returned.
  • the server can learn the status of the command in the response message according to the command returned by the external device, and the execution success and failure of the command sent by the server, so as to feedback the execution result to the user.
  • the boot detection module 403 includes: a command receiving unit 4031 and a command response unit 4032;
  • the command receiving unit 4031 is configured to receive a command sent by the server.
  • the command response unit 4032 is configured to: when the command is a download code command, download the code program, and return a command response message to the server; when the command is a code download completion command, run the download code, and return a command response message to the server; When the command is a test function command, the test function command is processed according to the test function type and the command response information is returned to the server.
  • FIG. 6 another embodiment of the present invention provides a multi-peripheral with reliability detection function.
  • the implementation device of the boot includes: a transport protocol setting module 600, a boot mode selecting module 601, an initializing module 602, and a boot detecting module 603;
  • a transmission protocol setting module 600 configured to formulate the command transmission protocol between the server and the external device according to the peripheral interface
  • the boot mode selection module 601 is configured to select a corresponding boot startup mode before connecting to the server through the peripheral interface;
  • the initialization module 602 is configured to perform an initialization operation according to the selected boot startup mode after the external device is connected to the server, and register a corresponding data receiving and transmitting function;
  • the boot detection module 603 is configured to perform a boot command exchange with the server according to the agreed command transmission protocol to implement detection of the boot download process.
  • the boot mode selection module 601, the initialization module 602, and the boot detection module 603 are the same as those of the boot mode selection module 401, the initialization module 402, and the boot detection module 403 in the foregoing embodiment, and are not described herein again.
  • the transmission protocol formulation module 600 in the external device formulates a command transmission protocol between the server and the external device.
  • the command transmission protocol it is necessary to consider the characteristics of each external device, including the FIFO of various external devices. Depth, guarantee of correct transmission of commands, etc.
  • an embodiment of the present invention provides a system for implementing a multi-peripheral boot with a reliability detection function, including: an external device 701, and a server 702 connected to the external device 701 through a peripheral interface;
  • the external device 701 is configured to select a corresponding boot startup mode before connecting with the server 702. After the external device is connected to the server, perform an initialization operation according to the selected boot startup mode, and register a corresponding data receiving and transmitting function;
  • the command transmission protocol interacts with the server 702 to perform a boot command to detect the boot download process;
  • the server 702 is configured to perform a boot command interaction with the external device 701 according to the agreed command transmission protocol to implement detection of the b00t download process. Further, the server 702 is further configured to send a command to the external device 701, and receive command response information returned by the external device 701 according to the command;
  • the external device 701 is further configured to receive a command sent by the server 702, when the command is a download code command, download the code program, and return a command response message to the server 702; when the command is the code downloading, run the download code, and The server returns a command response message; and when the command is a test function command, the test function command is processed accordingly and the command response message is returned to the server.
  • the peripheral interfaces may be SPI, USB interface, SDIO interface, and the like.
  • the method, device and system for implementing multi-peripheral boot with reliability detection function according to embodiments of the present invention according to the characteristics of the multi-peripheral interface, formulate a corresponding command transmission protocol, and select according to the type of peripheral interface selected by the user
  • the corresponding boot startup mode, and the command data transmission between the external device and the host server according to the established command transfer protocol realizes the detection of the boot download process, thereby ensuring the system boot program in the case of uncertain factors.
  • the correct operation, the implementation method is simple and reliable.

Landscapes

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

Description

一种多外设系统引导程序的实现方法、 设备及系统 技术领域
本发明涉及计算机网络技术领域, 尤其涉及一种应用于嵌入式产品的 带可靠性检测功能的多外设系统引导程序的实现方法、 设备及系统。 背景技术
系统引导程序(boot )是嵌入式系统上电启动运行的第一段代码, 该代 码通常被固化到芯片的 bootrom中,是在用户应用程序运行之前,运行的一 段子程序。 通过这段子程序, 可以初始化硬件设备, 建立内存空间的映射 图, 为最终下载用户应用程序准备好正确的运行环境。
嵌入式系统应用软件一般由设备开发商在试制或生产时通过 EJTAG调 试器或编程器烧录到外部存储介质 ( NOR FLASH或 EEPROM )中,其 boot 功能很弱, 尤其对于多外设嵌入式系统而言, 对应 boot的方式很多。 在系 统调试的过程中, 往往会因为接口的物理连接错误、 应用程序异常、 芯片 异常等原因, 导致 boot过程失败。 此种情形下, 则需要专门的仪器设备或 仿真器进行调试分析, 由于普通的客户不具备上述条件, 而且调试和错误 定位时间较长, 增加了售后成本和维修周期。
目前, 虽然存在少数支持多种外设的嵌入式系统, 但是其不具备可靠 性检测功能, 在出现不确定因素问题的情况下, 容易导致 boot过程失败。 因此, 支持多外设的 boot技术有待改进和发展。 发明内容
本发明的主要目的在于提供一种带可靠性检测功能的多外设 boot的实 现方法、 设备及系统, 旨在为多外设嵌入式产品的 boot引导程序提供可靠 性检测, 提高系统使用性能。
本发明一种带可靠性检测功能的多外设 boot的实现方法, 包括: 外部设备通过外设接口与服务器连接前, 选择相应的 boot启动模式; 当外部设备与服务器连接后, 根据选择的 boot启动模式进行初始化操 作, 并注册相应的数据收、 发函数;
根据约定的命令传输协议与服务器进行 boot命令交互, 实现对 boot下 载过程的检测。
优选地, 所述命令传输协议包括: 服务器发送命令的命令描述信息、 命令数据包信息以及外部设备的命令应答信息; 所述命令描述信息包含命 令标识符、 数据包长度、 命令类型以及命令内容; 所述命令数据包信息包 含所述命令类型确定的命令数据; 所述命令应答信息包含应答标识符、 应 答类型、 应答内容以及命令执行状态。
优选地, 所述命令类型包括代码下载、 测试、 断点续传和 /或设置发送 固定数据。
优选地, 所述根据约定的命令传输协议与服务器进行 boot命令交互, 实现对 boot下载过程的检测包括:
接收服务器发送的命令;
当所述命令为下载代码命令时, 下载代码程序, 并向服务器返回命令 应答信息;
当所述命令为代码下载完毕命令时, 运行下载代码, 并向服务器返回 命令应答信息;
当所述命令为测试功能命令时, 根据测试功能类型对所述测试功能命 令进行相应处理并向服务器返回命令应答信息。
优选地,所述外部设备通过外设接口与服务器连接前,选择相应的 boot 启动模式之前还包括: 根据外设接口制定服务器与外部设备之间的所述命令传输协议。
本发明还提出一种带可靠性检测功能的多外设 boot的实现设备,包括: boot模式选择模块, 用于通过外设接口与服务器连接前, 选择相应的 boot启动模式;
初始化模块, 用于当外部设备与服务器连接后, 根据选择的 boot启动 模式进行初始化操作, 并注册相应的数据收、 发函数;
boot检测模块,根据约定的命令传输协议与服务器进行 boot命令交互, 实现对 boot下载过程的检测。
优选地, 所述 boot检测模块包括:
命令接收单元, 用于接收服务器发送的命令;
命令应答单元, 用于当所述命令为下载代码命令时, 下载代码程序, 并向服务器返回命令应答信息; 当所述命令为代码下载完毕命令时, 运行 下载代码, 并向服务器返回命令应答信息; 以及当所述命令为测试功能命 令时, 根据测试功能类型对所述测试功能命令进行相应处理并向服务器返 回命令应答信息。
优选地, 所述设备还包括传输协议制定模块, 用于根据外设接口制定 服务器与外部设备之间的所述命令传输协议。
本发明还提出一种带可靠性检测功能的多外设 boot的实现系统,包括: 外部设备以及与所述外部设备通过外设接口连接的服务器; 其中,
所述外部设备, 用于与服务器连接前, 选择相应的 boot启动模式; 当 外部设备与服务器连接后, 根据选择的 boot启动模式进行初始化操作, 并 注册相应的数据收、 发函数; 根据约定的命令传输协议与服务器进行 boot 命令交互, 实现对 boot下载过程的检测;
所述服务器, 用于根据约定的命令传输协议与外部设备进行 boot命令 交互, 实现对 boot下载过程的检测。 优选地, 所述服务器, 还用于向所述外部设备发送命令; 以及接收外 部设备根据所述命令返回的命令应答信息;
所述外部设备, 还用于接收服务器发送的命令, 当所述命令为下载代 码命令时, 下载代码程序, 并向服务器返回命令应答信息; 当所述命令为 代码下载完毕时, 运行下载代码, 并向服务器返回命令应答信息; 以及当 所述命令为测试功能命令时, 根据测试功能类型对所述测试功能命令进行 相应处理并向服务器返回命令应答信息。
本发明提供的带可靠性检测功能的多外设 boot的实现方法、 设备及系 统, 根据多外设接口的特点制定相应的命令传输协议, 根据用户选择的外 设接口类型选择相应的 boot启动模式, 并按照制定的命令传输协议在外部 设备与主机服务器之间进行命令数据的交互,实现对 boot下载过程的检测, 从而确保在出现不确定因素的情况下, 保证系统引导程序的正确运行, 该 实现方法简单、 可靠。 附图说明
图 1是本发明带可靠性检测功能的多外设 boot的实现方法的实施例一 的流程示意图;
图 2是本发明根据约定的命令传输协议与服务器进行 boot命令交互, 实现对 boot下载过程的检测的方法的流程示意图;
图 3是本发明带可靠性检测功能的多外设 boot的实现方法的实施例二 的流程示意图;
图 4是本发明带可靠性检测功能的多外设 boot的实现设备的实施例一 的结构示意图;
图 5是本发明带可靠性检测功能的多外设 boot的实现设备的 boot检测 模块的结构示意图;
图 6是本发明带可靠性检测功能的多外设 boot的实现设备的实施例二 的结构示意图;
图 7是本发明带可靠性检测功能的多外设 boot的实现系统的结构示意 图。 具体实施方式
本发明实施例解决方案主要是根据多外设接口的特点制定相应的命令 传输协议, 根据用户选择的外设接口类型选择相应的 boot启动模式, 并按 照制定的命令传输协议在外部设备与主机服务器之间进行命令数据的交 互, 实现对 boot下载过程的检测。
如图 1所示,本发明一实施例提出一种带可靠性检测功能的多外设 boot 的实现方法, 包括:
步骤 S101 , 外部设备通过外设接口与服务器连接前, 选择相应的 boot 启动模式;
在本实施例中, 外设接口可以为 SPI ( Serial Peripheral Interface , 串行 外设接口)、 USB ( Universal Serial BUS , 通用串行总线)接口以及 SDIO, ( Secure Digital Input and Output Card , 安全数字输入输出卡)接口等; 服务器可以为嵌入式系统中设置有多个外设接口的主机, 比如 PC机、 笔记本等, 外部设备可以带有多种外设接口, 并可以根据服务器的外设接 口来选择确定自己的外设接口, 与服务器进行连接;
在嵌入式系统中, 在用户应用程序运行之前, 需要运行 boot, 以初始 化外部设备, 建立内存空间的映射图, 为最终下载用户应用程序准备好正 确的运行环境;
为了保证 boot下载的成功运行, 本实施例通过服务器与外部设备之间 预定的命令传输协议进行服务器与外部设备之间的命令交互, 从而达到对 boot下载过程进行检测的目的;
首先,在外部设备通过外设接口与服务器连接前,需要选择相应的 boot 启动模式, boot启动模式根据用户选择的外设接口而定, 用户可以根据自 身的需求, 通过外部装置设置 boot启动模式, 包括使用何种外设接口、 主 / 从模式、 时钟等; 通过外部装置的设置, 用户可以根据实际需要选择相应 的服务器进行代码下载, 从而选择相应的 boot启动模式, 以便后续过程中 系统上电后, 根据相应的外设接口对外部设备进行初始化操作。
步骤 S102, 当外部设备与服务器连接后, 根据选择的 boot启动模式进 行初始化操作, 并注册相应的数据收、 发函数;
系统上电之后, 外部设备便进入等待接收命令状态。
步骤 S103 , 根据约定的命令传输协议与服务器进行 boot命令交互, 实 现对 boot下载过程的检测。
在本实施例中, 服务器与外部设备之间有约定的命令传输协议, 由于 在 boot阶段, 对数据传输的正确性的要求远大于传输速度的要求, 而且在 boot 阶段, 外设驱动要求精简, 因此可使用普通传输模式; 命令传输协议 可以分为命令描述、 命令数据包、 命令应答三个阶段;
命令传输协议包括: 服务器发送命令的命令描述信息、 命令数据包信 息以及外部设备的命令应答信息; 其中, 命令描述信息包含命令标识符、 数据包长度、 命令类型以及命令内容等, 其中, 命令内容比如命令描述校 验和、 下载代码地址等; 命令数据包信息包含命令类型确定的命令数据; 命令类型包括代码下载、 测试、 断点续传和 /或设置发送固定数据等; 命令 应答信息包含应答标识符、 应答类型、 应答内容以及命令执行状态等; 其 中, 对于代码下载命令而言, 应答内容为反馈所有下载数据的校验和; 由于命令描述信息可以指定数据包长度, 因此, 在服务器发送数据包 阶段, 可以一次性传输数据包长度字段指定长度的数据, 在外部设备命令 应答阶段时, 再读取数据包阶段数据的校验和, 如果校验结果正确, 则服 务器传送下一阶段数据包, 反之, 则重传此数据包; 为了实现对 boot下载过程的检测, 外部设备与服务器根据约定的命令 传输协议进行 boot命令交互, 根据用户的选择, 服务器向外部设备发送命 令, 外部设备接收到服务器发送的命令, 根据命令进行相应的处理; 如果 接收的命令为下载代码命令时, 则下载代码程序, 并向服务器返回命令应 答信息, 其中代码程序的下载可以分段下载; 若接收的命令为代码下载完 毕命令时, 运行下载代码, 并向服务器返回命令应答信息; 若命令为测试 功能命令时, 根据测试功能类型对测试功能命令进行相应处理并返回命令 应答信息;
服务器可以根据外部设备返回的命令应答信息中的命令执行状态得 知, 其所发的命令的执行成功与失败情况, 从而将执行结果反馈给用户。
如图 2所示, 步骤 S103包括:
步骤 S1031 , 接收服务器发送的命令。
步骤 S1032, 当命令为下载代码命令时, 下载代码程序, 并向服务器返 回命令应答信息;
其中, 代码程序的下载可以分段下载。
步骤 S1033 , 当命令为代码下载完毕命令时, 运行下载代码, 并向服务 器返回命令应答信息。
步骤 S1034, 当命令为测试功能命令时,根据测试功能类型对测试功能 命令进行相应处理并向服务器返回命令应答信息;
其中, 测试功能命令比如可以为读写寄存器等。
本实施例通过根据多外设接口的特点制定相应的命令传输协议, 根据 用户选择的外设接口类型选择相应的 boot启动模式, 并按照制定的命令传 输协议在外部设备与主机服务器之间进行命令数据的交互, 实现对 boot下 载过程的检测, 从而确保在出现不确定因素的情况下, 保证系统引导程序 的正确运行, 该实现方法简单、 可靠。 如图 3 所示, 本发明另一实施例提出一种带可靠性检测功能的多外设 boot的实现方法, 包括:
步骤 S300,根据外设接口制定服务器与外部设备之间的命令传输协议。 步骤 S301 , 外部设备通过外设接口与服务器连接前, 选择相应的 boot 启动模式。
步骤 S302, 当外部设备与服务器连接后, 根据选择的 boot启动模式进 行初始化操作, 并注册相应的数据收、 发函数。
步骤 S303 , 根据约定的命令传输协议与服务器进行 boot命令交互, 实 现对 boot下载过程的检测。
本实施例与上述实施例的区别在于, 服务器与外部设备之间的命令传 输协议由外部设备所制定。 在制定命令传输协议时, 需要考虑各个外部设 备的特点, 包括各种外部设备的 FIFO ( First In First Out, 先进先出 ) 的深 度、 命令传输正确性的保证等。
其他与上述实施例相同, 在此不再赘述。 同理, 服务器与外部设备之 间的命令传输协议还可由服务器制定。
如图 4所示,本发明一实施例提出一种带可靠性检测功能的多外设 boot 的实现设备, 包括: boot模式选择模块 401、 初始化模块 402以及 boot检 测模块 403; 其中,
boot模式选择模块 401 , 用于通过外设接口与服务器连接前,选择相应 的 boot启动模式;
在本实施例中, 外设接口可以为 SPI、 USB接口以及 SDI0接口等。 服务器可以为嵌入式系统中设置有多个外设接口的主机, 比如 PC机、 笔记本等, 外部设备可以带有多种外设接口, 并可以根据服务器的外设接 口来选择确定自己的外设接口, 与服务器进行连接。
在嵌入式系统中, 在用户应用程序运行之前, 需要运行 boot, 以初始 化外部设备, 建立内存空间的映射图, 为最终下载用户应用程序准备好正 确的运行环境。
为了保证 boot下载的成功运行, 本实施例通过服务器与外部设备之间 预定的命令传输协议进行服务器与外部设备之间的命令交互, 从而达到对 boot下载过程进行检测的目的。
首先, 在外部设备通过外设接口与服务器连接前, 由 boot模式选择模 块 401选择相应的 boot启动模式, boot启动模式根据用户选择的外设接口 而定, 用户可以根据自身的需求, 通过外部装置设置 boot启动模式, 包括 使用何种外设接口、 主 /从模式、 时钟等; 通过外部装置的设置, 用户可以 根据实际需要选择相应的服务器进行代码下载, 从而选择相应的 boot启动 模式, 以便后续过程中系统上电后, 根据相应的外设接口对外部设备进行 初始化操作。
初始化模块 402, 当外部设备与服务器连接后, 用于根据选择的 boot 启动模式进行初始化操作, 并注册相应的数据收、 发函数;
boot检测模块 403 , 用于根据约定的命令传输协议与服务器进行 boot 命令交互, 实现对 boot下载过程的检测。
在本实施例中, 服务器与外部设备之间有约定的命令传输协议, 由于 在 boot阶段, 对数据传输的正确性的要求远大于传输速度的要求, 而且在 boot 阶段, 外设驱动要求精简, 因此可使用普通传输模式; 该命令传输协 议可以分为命令描述、 命令数据包、 命令应答三个阶段。
命令传输协议具体包括: 服务器发送命令的命令描述信息、 命令数据 包信息以及外部设备的命令应答信息; 其中, 命令描述信息包含命令标识 符、 数据包长度、 命令类型以及命令内容等, 其中, 命令内容比如命令描 述校验和、 下载代码地址等; 命令数据包信息包含命令类型确定的命令数 据; 命令类型包括代码下载、 测试、 断点续传和 /或设置发送固定数据等; 命令应答信息包含应答标识符、 应答类型、 应答内容以及命令执行状态等; 其中, 对于代码下载命令而言, 应答内容为反馈所有下载数据的校验和。
由于命令描述信息可以指定数据包长度, 因此, 在服务器发送数据包 阶段, 可以一次性传输数据包长度字段指定长度的数据, 在外部设备命令 应答阶段时, 再读取数据包阶段数据的校验和, 如果校验结果正确, 则服 务器传送下一阶段数据包, 反之, 则重传此数据包。
为了实现对 boot下载过程的检测, 外部设备与服务器根据约定的命令 传输协议进行 boot命令交互, 根据用户的选择, 服务器向外部设备发送命 令, 外部设备接收到服务器发送的命令, 根据命令进行相应的处理。 如果 接收的命令为下载代码命令时, 则下载代码程序, 并向服务器返回命令应 答信息, 其中代码程序的下载可以分段下载; 若接收的命令为代码下载完 毕命令时, 运行下载代码, 并向服务器返回命令应答信息; 若命令为测试 功能命令时, 根据测试功能类型对测试功能命令进行相应处理并返回命令 应答信息。
服务器可以根据外部设备返回的命令应答信息中的命令执行状态得 知, 其所发的命令的执行成功与失败情况, 从而将执行结果反馈给用户。
如图 5所示, boot检测模块 403包括: 命令接收单元 4031、 命令应答 单元 4032; 其中,
命令接收单元 4031 , 用于接收服务器发送的命令;
命令应答单元 4032, 用于当命令为下载代码命令时, 下载代码程序, 并向服务器返回命令应答信息; 当命令为代码下载完毕命令时, 运行下载 代码, 并向服务器返回命令应答信息; 以及当命令为测试功能命令时, 根 据测试功能类型对测试功能命令进行相应处理并向服务器返回命令应答信 息。
如图 6所示, 本发明另一实施例提出一种带可靠性检测功能的多外设 boot的实现设备, 包括: 传输协议制定模块 600、 boot模式选择模块 601、 初始化模块 602以及 boot检测模块 603; 其中,
传输协议制定模块 600,用于根据外设接口制定服务器与外部设备之间 的所述命令传输协议;
boot模式选择模块 601 , 用于通过外设接口与服务器连接前,选择相应 的 boot启动模式;
初始化模块 602, 用于当外部设备与服务器连接后, 根据选择的 boot 启动模式进行初始化操作, 并注册相应的数据收、 发函数;
boot检测模块 603 , 用于根据约定的命令传输协议与服务器进行 boot 命令交互, 实现对 boot下载过程的检测。
在本实施例中, boot模式选择模块 601、 初始化模块 602以及 boot检 测模块 603与上述实施例中 boot模式选择模块 401、 初始化模块 402以及 boot检测模块 403功能结构对应相同, 在此不再赘述。
在本实施例中, 由外部设备中传输协议制定模块 600制定服务器与外 部设备之间的命令传输协议, 在制定命令传输协议时, 需要考虑各个外部 设备的特点,包括各种外部设备的 FIFO的深度、命令传输正确性的保证等。
如图 7所示,本发明一实施例提出一种带可靠性检测功能的多外设 boot 的实现系统, 包括: 外部设备 701、 与外部设备 701通过外设接口连接的服 务器 702; 其中,
外部设备 701 , 用于与服务器 702连接前, 选择相应的 boot启动模式; 当外部设备与服务器连接后, 根据选择的 boot启动模式进行初始化操作, 并注册相应的数据收、 发函数; 根据约定的命令传输协议与服务器 702进 行 boot命令交互, 实现对 boot下载过程的检测;
服务器 702, 用于根据约定的命令传输协议与外部设备 701进行 boot 命令交互, 实现对 b00t下载过程的检测。 进一步的, 服务器 702还用于向外部设备 701发送命令, 以及接收外 部设备 701根据命令返回的命令应答信息;
外部设备 701还用于接收服务器 702发送的命令, 当命令为下载代码 命令时, 下载代码程序, 并向服务器 702返回命令应答信息; 当所述命令 为代码下载完毕时, 运行下载代码, 并向服务器返回命令应答信息; 以及 当命令为测试功能命令时, 对测试功能命令进行相应处理并向服务器返回 命令应答信息。
在本实施例中, 外设接口可以为 SPI、 USB接口以及 SDIO接口等。 本发明实施例提出的一种带可靠性检测功能的多外设 boot 的实现方 法、 设备及系统, 通过根据多外设接口的特点制定相应的命令传输协议, 根据用户选择的外设接口类型选择相应的 boot启动模式, 并按照制定的命 令传输协议在外部设备与主机服务器之间进行命令数据的交互, 实现对 boot 下载过程的检测, 从而确保在出现不确定因素的情况下, 保证系统引 导程序的正确运行, 该实现方法简单、 可靠。
以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本发明说明书及附图内容所作的等效结构或流程变换, 或直接或 间接运用在其它相关的技术领域, 均同理包括在本发明的专利保护范围内。

Claims

权利要求书
1、 一种带可靠性检测功能的多外设 boot的实现方法, 其特征在于, 包 括:
外部设备通过外设接口与服务器连接前, 选择相应的 boot启动模式; 当外部设备与服务器连接后, 根据选择的 boot启动模式进行初始化操 作, 并注册相应的数据收、 发函数;
根据约定的命令传输协议与服务器进行 boot命令交互, 实现对 boot下 载过程的检测。
2、 根据权利要求 1所述的方法, 其特征在于,
所述命令传输协议包括: 服务器发送命令的命令描述信息、 命令数据 包信息以及外部设备的命令应答信息; 所述命令描述信息包含命令标识符、 数据包长度、 命令类型以及命令内容; 所述命令数据包信息包含所述命令 类型确定的命令数据; 所述命令应答信息包含应答标识符、 应答类型、 应 答内容以及命令执行状态。
3、 根据权利要求 2所述的方法, 其特征在于, 所述命令类型包括代码 下载、 测试、 断点续传和 /或设置发送固定数据。
4、 根据权利要求 3所述的方法, 其特征在于, 所述根据约定的命令传 输协议与服务器进行 boot命令交互, 实现对 boot下载过程的检测包括: 接收服务器发送的命令;
当所述命令为下载代码命令时, 下载代码程序, 并向服务器返回命令 应答信息;
当所述命令为代码下载完毕命令时, 运行下载代码, 并向服务器返回 命令应答信息;
当所述命令为测试功能命令时, 根据测试功能类型对所述测试功能命 令进行相应处理并向服务器返回命令应答信息。
5、 根据权利要求 1至 4任一所述的方法, 其特征在于, 所述外部设备 通过外设接口与服务器连接前, 选择相应的 boot启动模式之前还包括: 根 据外设接口制定服务器与外部设备之间的所述命令传输协议。
6、 一种带可靠性检测功能的多外设 boot的实现设备, 其特征在于, 包 括:
boot模式选择模块, 用于通过外设接口与服务器连接前, 选择相应的 boot启动模式;
初始化模块, 用于当外部设备与服务器连接后, 根据选择的 boot启动 模式进行初始化操作, 并注册相应的数据收、 发函数;
boot检测模块,根据约定的命令传输协议与服务器进行 boot命令交互, 实现对 boot下载过程的检测。
7、根据权利要求 6所述的设备,其特征在于,所述 boot检测模块包括: 命令接收单元, 用于接收服务器发送的命令;
命令应答单元, 用于当所述命令为下载代码命令时, 下载代码程序, 并向服务器返回命令应答信息; 当所述命令为代码下载完毕命令时, 运行 下载代码, 并向服务器返回命令应答信息; 以及当所述命令为测试功能命 令时, 根据测试功能类型对所述测试功能命令进行相应处理并向服务器返 回命令应答信息。
8、 根据权利要求 6或 7所述的设备, 其特征在于, 所述设备还包括: 传输协议制定模块, 用于根据外设接口制定服务器与外部设备之间的 所述命令传输协议。
9、 一种带可靠性检测功能的多外设 boot的实现系统, 其特征在于, 包 括: 外部设备以及与所述外部设备通过外设接口连接的服务器; 其中, 所述外部设备, 用于与服务器连接前, 选择相应的 boot启动模式; 当 外部设备与服务器连接后, 根据选择的 boot启动模式进行初始化操作, 并 注册相应的数据收、 发函数; 根据约定的命令传输协议与服务器进行 boot 命令交互, 实现对 boot下载过程的检测;
所述服务器, 用于根据约定的命令传输协议与外部设备进行 boot命令 交互, 实现对 boot下载过程的检测。
10、 根据权利要求 9所述的系统, 其特征在于,
所述服务器, 还用于向所述外部设备发送命令; 以及接收外部设备根 据所述命令返回的命令应答信息;
所述外部设备, 还用于接收服务器发送的命令, 当所述命令为下载代 码命令时, 下载代码程序, 并向服务器返回命令应答信息; 当所述命令为 代码下载完毕时, 运行下载代码, 并向服务器返回命令应答信息; 以及当 所述命令为测试功能命令时, 根据测试功能类型对所述测试功能命令进行 相应处理并向服务器返回命令应答信息。
PCT/CN2011/072215 2010-10-19 2011-03-28 一种多外设系统引导程序的实现方法、设备及系统 WO2012051834A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010511539.5 2010-10-19
CN201010511539.5A CN102455970B (zh) 2010-10-19 2010-10-19 带可靠性检测功能的多外设boot实现方法、设备及系统

Publications (1)

Publication Number Publication Date
WO2012051834A1 true WO2012051834A1 (zh) 2012-04-26

Family

ID=45974648

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/072215 WO2012051834A1 (zh) 2010-10-19 2011-03-28 一种多外设系统引导程序的实现方法、设备及系统

Country Status (2)

Country Link
CN (1) CN102455970B (zh)
WO (1) WO2012051834A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138373B (zh) * 2015-08-27 2018-10-23 深圳市元征软件开发有限公司 汽车诊断设备固件升级方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1425963A (zh) * 2001-12-11 2003-06-25 深圳市中兴通讯股份有限公司上海第二研究所 嵌入式系统软件加载装置及方法
CN101562532A (zh) * 2008-04-18 2009-10-21 北京瑞佳晨科技有限公司 一种基于网络环境自动获取计算机硬件信息的系统和方法
CN101763279A (zh) * 2010-01-15 2010-06-30 上海维宏电子科技有限公司 一种BootLoader架构设计方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6895576B2 (en) * 2001-10-18 2005-05-17 Hewlett-Packard Development Company, L.P. Method and system for device driver and operating system debugging of portable computers
CN101673237B (zh) * 2009-09-02 2011-09-28 太仓市同维电子有限公司 一种利用网络调试启动程序的方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1425963A (zh) * 2001-12-11 2003-06-25 深圳市中兴通讯股份有限公司上海第二研究所 嵌入式系统软件加载装置及方法
CN101562532A (zh) * 2008-04-18 2009-10-21 北京瑞佳晨科技有限公司 一种基于网络环境自动获取计算机硬件信息的系统和方法
CN101763279A (zh) * 2010-01-15 2010-06-30 上海维宏电子科技有限公司 一种BootLoader架构设计方法

Also Published As

Publication number Publication date
CN102455970A (zh) 2012-05-16
CN102455970B (zh) 2014-10-22

Similar Documents

Publication Publication Date Title
US9122810B2 (en) System and method for providing input/output functionality to a processing node
CN101680932B (zh) 具有用于验证外部接口的功能性的自测试特征的集成电路
CN104185836B (zh) 用于在系统改变之后验证计算设备的适当操作的方法和系统
US7290051B2 (en) Method and apparatus for hardware implementation independent verification of network layers
CN106030548B (zh) 用于可信计算的多节点中枢
US20020056047A1 (en) System and method for communicating software debug, diagostic and maintenance information between devices
US20180143939A1 (en) Flow Control in Remote Direct Memory Access Data Communications with Mirroring of Ring Buffers
WO2017112115A1 (en) SECURE REMOTE DEBUGGING OF SoCs
US7383547B1 (en) Apparatus and technique for device emulation
CN111708662B (zh) 调试方法及装置
CN116881929B (zh) 安全防护方法、装置、电子设备以及基板控制器芯片
Humbel et al. A Model-Checked I 2 C Specification
WO2012051834A1 (zh) 一种多外设系统引导程序的实现方法、设备及系统
US20060080636A1 (en) Method of building intelligent platform management interface firmware architecture
JP2011039781A (ja) 協調シミュレーション装置及びシミュレーション方法
CN114328045A (zh) 一种bmc的i2c调试方法、系统、装置及计算机可读存储介质
TW200945028A (en) Computer system error detecting method and electronic device
Jeřábek Open-source and Open-hardware CAN FD Protocol Support
Dong et al. Refinement-Based Verification of Device-to-Device Information Flow.
Shilaskar et al. Post Silicon Validation for I2C (SMBUS) Peripheral
WO2016078222A1 (zh) 引导程序传输方法、嵌入式系统及引导程序传输系统
US20080288692A1 (en) Semiconductor integrated circuit device and microcomputer
CN112257381B (zh) 一种AXI Crossbar设计电路验证方法和系统
Wang et al. Endpoint Function Verification Scheme in USB Communication
US6842855B2 (en) System and method for providing information to a computer system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11833740

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11833740

Country of ref document: EP

Kind code of ref document: A1