[go: up one dir, main page]

WO2019037188A1 - METHOD FOR MODE SWITCHING AN INTEGRATED DEVICE AND INTEGRATED DEVICE - Google Patents

METHOD FOR MODE SWITCHING AN INTEGRATED DEVICE AND INTEGRATED DEVICE Download PDF

Info

Publication number
WO2019037188A1
WO2019037188A1 PCT/CN2017/102761 CN2017102761W WO2019037188A1 WO 2019037188 A1 WO2019037188 A1 WO 2019037188A1 CN 2017102761 W CN2017102761 W CN 2017102761W WO 2019037188 A1 WO2019037188 A1 WO 2019037188A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
switch circuit
switching
mode
switch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2017/102761
Other languages
French (fr)
Chinese (zh)
Inventor
刘平卫
洪九金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Dynaudio Co Ltd
Original Assignee
Goertek Dynaudio Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Dynaudio Co Ltd filed Critical Goertek Dynaudio Co Ltd
Publication of WO2019037188A1 publication Critical patent/WO2019037188A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
    • G05B23/0213Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a mode switching method for an embedded device and an embedded device.
  • the embedded device has only a user mode after being assembled, and the debugging interface for the embedded system has been blocked. If there is a need for debugging of the embedded system, it is usually necessary to disassemble the embedded device. inconvenient. Therefore, it is necessary to provide a mode switching scheme for the embedded device, which is convenient for the development test and maintenance personnel to debug and test the embedded device that has been assembled by the whole machine.
  • the object of the present invention is to provide a mode switching scheme for an embedded device, which is convenient for developing test and maintenance personnel to perform debugging tests on an embedded device that has been assembled by the whole device.
  • a mode switching method of an embedded device comprising a first interface connected to an embedded processor of the device, a second interface exposed to the outside of the device, and a switch
  • the circuit, the first interface and the second interface are the same type of interface; the method includes the following steps:
  • the mode flag is set to an engineering mode flag in response to a command to switch to the engineering mode
  • the device In response to the mode flag being set to a user mode flag, the device is switched to a user mode and the switching circuit is switched to connect the first interface and the second interface.
  • the method further includes the following steps:
  • the boot flag When the device is started, the boot flag is initialized to a boot incomplete flag, and the mode flag is initialized to a user mode flag; wherein the device is configured to be disabled when the boot flag is a boot unfinished flag
  • the mode flag is set to an engineering mode flag
  • the boot flag is set to a boot completion flag.
  • the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces;
  • a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface;
  • the switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface connection, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;
  • the switching the switch circuit to connect the first interface and the second interface includes: switching a second end of the first switch circuit to be connected to a D+ pin of the first interface, The second end of the second switch circuit is switched to be connected to the D-pin of the first interface.
  • the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are audio input interfaces;
  • a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface;
  • the switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface is connected, and the second end of the second switch circuit is switched to Debugging input/output interface connection of the embedded processor;
  • Switching the switch circuit to connect the first interface and the second interface comprising: switching a second end of the first switch circuit to be connected to a left channel pin of the first interface And switching the second end of the second switch circuit to be connected to the right channel pin of the first interface.
  • the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or the device receives the switch through its own infrared receiver to a command of the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the command to switch to the user mode is a specific form of audio stream, the device passing its own The audio input interface receives the command to switch to the engineering mode and/or the command to switch to the user mode.
  • an embedded device comprising a first interface coupled to an embedded processor of the device, a second interface exposed to an exterior of the device, and a switching circuit,
  • the first interface and the second interface are interfaces of the same type;
  • the device further includes a mode flag setting module and a mode switching control module;
  • the mode flag bit setting module is configured to set a mode flag bit to an engineering mode flag in response to a command to switch to an engineering mode; and/or to set a mode flag bit to be in response to a command to switch to a user mode User mode flag;
  • the mode switching control module is configured to switch the device to an engineering mode and switch the switching circuit to connect the second interface and the embedded in response to the mode flag being set to an engineering mode flag a debug interface of the processor; and/or responsive to the mode flag being set to a user mode flag, switching the device to a user mode and switching the switch circuit to connect the first interface and Said second interface.
  • the device further includes a boot flag setting module
  • the boot flag setting module is configured to initialize a boot flag to a boot incomplete flag when the device is booted, and set the boot flag to a boot completion flag when the device is booted; wherein The device is configured to prohibit the mode flag from being set to an engineering mode flag when the boot flag is a boot incomplete flag;
  • the mode flag setting module is further configured to start a mode flag when the device is started Initialized to the user mode flag.
  • the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces;
  • a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface;
  • the mode switching control module switches the switch circuit to a debug interface that connects the second interface and the embedded processor, including: switching a second end of the first switch circuit to the embedded a debug output/input interface connection of the processor, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;
  • the mode switching control module switches the switch circuit to connect the first interface and the second interface, including: switching a second end of the first switch circuit to a D+ lead with the first interface
  • the pin is connected to switch the second end of the second switch circuit to be connected to the D-pin of the first interface.
  • the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are audio input interfaces;
  • a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface;
  • the mode switching control module switches the switch circuit to a debug interface that connects the second interface and the embedded processor, including: switching a second end of the first switch circuit to the embedded a debug output/input interface connection of the processor, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;
  • the mode switching control module switches the switch circuit to connect the first interface and the second interface, including: switching a second end of the first switch circuit to a left sound with the first interface
  • the track pin is connected to switch the second end of the second switch circuit to be connected to the right channel pin of the first interface.
  • the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or the device receives the switch through its own infrared receiver to The command of the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the command to switch to the user mode is a specific shape
  • An audio stream of the type the device receiving the command to switch to the engineering mode and/or the command to switch to the user mode through its own audio input interface.
  • an embedded device comprising a first interface coupled to an embedded processor of the device, a second interface exposed to an exterior of the device, and a switching circuit,
  • the first interface and the second interface are the same type of interface;
  • the device further includes a memory, a processor, and a computer program stored on the memory and executable on the processor; when the processor executes the program Implement the following steps:
  • the mode flag is set to an engineering mode flag in response to a command to switch to the engineering mode
  • the device In response to the mode flag being set to a user mode flag, the device is switched to a user mode and the switching circuit is switched to connect the first interface and the second interface.
  • Initializing the boot flag to the boot incomplete flag when the device is booting initializing the mode flag to the user mode flag; wherein the device is configured to be in a state where the boot flag is the boot incomplete flag, The mode flag is prohibited from being set to the engineering mode flag; and,
  • the boot flag is set to a boot completion flag.
  • the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces;
  • a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface;
  • the switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface connection, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;
  • the switching the switch circuit to connect the first interface and the second interface includes: switching a second end of the first switch circuit to be connected to a D+ pin of the first interface, The second end of the second switch circuit is switched to be connected to the D-pin of the first interface.
  • the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are audio input interfaces;
  • a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface;
  • the switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface connection, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;
  • Switching the switch circuit to connect the first interface and the second interface comprising: switching a second end of the first switch circuit to be connected to a left channel pin of the first interface And switching the second end of the second switch circuit to be connected to the right channel pin of the first interface.
  • the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or the device receives the switch through its own infrared receiver to a command of the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the command to switch to the user mode is a specific form of audio stream, the device passing its own The audio input interface receives the command to switch to the engineering mode and/or the command to switch to the user mode.
  • the mode switching scheme of the embedded device provided by the invention can be switched between the user mode and the engineering mode, so that the development test and maintenance personnel can debug and test the embedded device that has been assembled by the whole machine.
  • FIG. 1 is a block diagram of an embedded device according to a first embodiment of the present invention
  • FIG. 2 is a block diagram showing an embedded device according to a second embodiment of the present invention.
  • FIG. 3 is a schematic diagram showing the connection of a switch circuit of an embedded device according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram showing the connection of a switch circuit of an embedded device according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of switching an embedded device into an engineering mode according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of switching an embedded device to a user mode according to an embodiment of the present invention.
  • FIG. 7 is a block diagram showing a hardware configuration of an embedded device according to an embodiment of the present invention.
  • the embedded device 100 includes a first interface 1 connected to an embedded processor of the embedded device 100 and a second exposed to the outside of the embedded device 100 .
  • Two interface 2, and switch circuit 4, first interface 1 and second connection Port 2 is the same type of interface.
  • the embedded device 100 further includes a mode flag setting module 6 and a mode switching control module 5.
  • the mode flag setting module 6 is configured to set the mode flag to the engineering mode flag in response to the command to switch to the engineering mode.
  • the mode switching control module 5 is configured to switch the embedded device 100 to the engineering mode and switch the switching circuit 4 to the debug interface 3 connecting the second interface 2 and the embedded processor in response to the mode flag being set to the engineering mode flag. Therefore, the technician can access the debug interface 3 through the second interface 2, and perform debugging test on the embedded device 100 that has been assembled by the whole machine.
  • the mode flag setting module 6 is further configured to set the mode flag to the user mode flag in response to a command to switch to the user mode.
  • the mode switching control module 5 is further configured to switch the embedded device 100 to the user mode and switch the switch circuit 4 to connect the first interface 1 and the second interface 2 in response to the mode flag being set to the user mode flag, so as to be embedded
  • the device 100 switches from the engineering mode back to the user mode.
  • an embedded device provided by the second embodiment of the present invention is provided.
  • the embedded device 100 provided by the second embodiment further includes a boot flag setting module 7 .
  • the boot flag setting module 7 is configured to initialize the boot flag to the boot incomplete flag when the embedded device 100 is booted, and to set the boot flag to the boot completion flag when the embedded device 100 is booted.
  • the embedded device 100 is configured to disable the mode flag bit as an engineering mode flag in a state where the power-on flag is a power-on incomplete flag.
  • the mode flag setting module 6 is further configured to initialize the mode flag to the user mode flag when the embedded device 100 is started, that is, the embedded device 100 is set to the user mode each time the device is turned on.
  • the embedded device 100 is configured to disable the mode flag from being set to the engineering mode flag when the boot flag is the boot incomplete flag, the embedded device 100 can only switch to the engineering mode after the boot is completed, and the main purpose is to protect The initialization of each module during the boot process and the prevention of switching modes during the boot process.
  • the user mode is determined by the mode flag bit. Or the engineering mode, if it is in the engineering mode, open the debugging information and test functions. If it is in user mode, it only provides the function, and does not open the debugging information and test function.
  • FIG. 3 a schematic diagram of a connection of a switch circuit of an embedded device according to an embodiment of the present invention is illustrated.
  • the switch circuit includes a first switch circuit 31 and a second switch circuit 32, and the first interface and the second interface are USB interfaces.
  • the first end of the first switch circuit 31 is connected to the D+ pin of the second USB interface 21, and the first end of the second switch circuit 32 is connected to the D- pin of the second USB interface 21.
  • the mode switching control module switches the embedded device to the engineering mode and switches the second end of the first switching circuit 31 to the debug input interface RX with the embedded processor. Connected, the second end of the second switching circuit 32 is switched to be connected to the debug output interface TX of the embedded processor.
  • the second end of the first switch circuit 31 can also be switched to be connected to the debug output interface TX of the embedded processor, and the second end of the second switch circuit 32 can be switched to the debug input interface RX of the embedded processor. connection.
  • the technician can access the debug input interface RX and the debug output interface TX through the second USB interface 21 to debug the embedded device that has been assembled.
  • the mode switching control module switches the embedded device to the user mode and switches the second end of the first switching circuit 31 to the D+ pin of the first USB interface 11. Connected to switch the second end of the second switch 32 circuit to be connected to the D-pin of the first USB interface 11.
  • FIG. 4 a schematic diagram of a connection of a switch circuit of an embedded device according to an embodiment of the present invention is illustrated.
  • the switch circuit includes a first switch circuit 31 and a second switch circuit 32, and the first interface and the second interface are audio input interfaces.
  • the first end of the first switch circuit 31 is connected to the left channel pin of the second audio input interface 22, and the first end of the second switch circuit 31 is connected to the right channel pin of the second audio input interface 22.
  • the mode switching control module switches the embedded device to the engineering mode and switches the second end of the first switching circuit 31 to the debug input interface RX with the embedded processor. Connected, the second end of the second switching circuit 32 is switched to be connected to the debug output interface TX of the embedded processor.
  • the second end of the first switch circuit 31 can also be switched to be connected to the debug output interface TX of the embedded processor, and the second end of the second switch circuit 32 can be switched to the debug input interface RX of the embedded processor. connection.
  • the technician can access the debug input interface RX and the debug output interface TX through the second audio input interface 22, and perform debugging test on the embedded device 100 that has been assembled.
  • the mode switching control module switches the embedded device to the user mode and switches the second end of the first switching circuit 31 to the left sound with the first audio input interface 12.
  • the track pin is connected to switch the second end of the second switch circuit 32 to be connected to the right channel pin of the first audio input interface 12.
  • the embedded device can receive the mode switching command input by the user in the following three ways:
  • the first way the command to switch to engineering mode and / or the command to switch to user mode is input to the embedded device through the external keypad.
  • the keypad is connected to the embedded device, and a specific non-function key or a specific combination key is defined on the keypad as a mode switching command.
  • the embedded device When the embedded device is in the user mode, when the specific non-function key or the specific combination key is pressed, the embedded device switches to the engineering mode and the second interface is connected with the debugging interface, so that the technician can access the debugging through the second interface.
  • the interface performs debugging test on the embedded device that has been assembled by the whole machine; when the user presses a specific non-functional key or a specific combination key again, the embedded device switches to the user mode and the second interface is connected with the first interface, and the second interface is restored. Its original function.
  • the usual infrared remote control has a coding range of 0 to 255.
  • the remote control function itself does not use as many codes.
  • the technician can set a specific code as a switching command in the spare code.
  • the embedded device receives the infrared through its own infrared receiver. Mode switching command sent by the remote controller.
  • the command to switch to the engineering mode and/or the command to switch to the user mode is a specific form of audio stream
  • the embedded device receives the command to switch to the engineering mode through its own audio input interface and/or switches to the user mode. The command.
  • an embodiment of the present invention provides a mode switching method for an embedded device:
  • step 806 is executed, the embedded device 1 is switched to the engineering mode and the switching circuit is switched to the debug interface connecting the second interface and the embedded processor.
  • step 901 detects whether a command to switch to the user mode is received. If a command to switch to the user mode is received, step 902 is executed to set the mode flag bit ModelFlag to zero. In response to the mode flag bit ModelFlag being set to 0, step 903 is executed, the embedded device switches to the user mode and the switch circuit switches to connect the first interface and the second interface, and the second interface restores its original function.
  • An embodiment of the present invention provides a mode switching method of an embedded device, where the device includes a first interface connected to an embedded processor of the device, and a second interface exposed to the outside of the device, And a switch circuit, the first interface and the second interface being the same type of interface; the method comprising the steps of: setting a mode flag to an engineering mode flag in response to a command to switch to an engineering mode; The mode flag is set to an engineering mode flag, the device is switched to an engineering mode and the switching circuit is switched to a debug interface connecting the second interface and the embedded processor; and/or, responsive Setting the mode flag to the user mode flag in response to the command to switch to the user mode; switching the device to the user mode and switching the switch circuit to the connection mode in response to the mode flag being set to the user mode flag.
  • the first interface and the second interface are described.
  • the method further includes the steps of: initializing the boot flag bit to a power-on incomplete flag when the device is booting, and initializing the mode flag bit to a user mode flag; wherein the device is configured to be When the boot flag is the boot incomplete flag, the mode flag is prohibited from being set to the engineering mode flag; and when the device is booted, the boot flag is set to the boot completion flag.
  • the switch circuit includes a first switch circuit and a second switch circuit, the first interface and the second interface are USB interfaces; a first end of the first switch circuit and the a D+ pin of the second interface is connected, a first end of the second switch circuit is coupled to a D- pin of the second interface; the switching circuit is switched to connect the second interface and the
  • the debugging interface of the embedded processor includes: switching a second end of the first switch circuit to be connected to a debug output/input interface of the embedded processor, and switching a second end of the second switch circuit For connecting to a debug input/output interface of the embedded processor; switching the switch circuit to connect the first interface and the second interface, comprising: seconding the first switch circuit The terminal is switched to be connected to the D+ pin of the first interface, and the second end of the second switch circuit is switched to be connected to the D-pin of the first interface.
  • the switch circuit includes a first switch circuit and a second switch circuit, the first interface and the second interface are audio input interfaces; and the first end of the first switch circuit a left channel pin connection of the second interface, a first end of the second switch circuit is connected to a right channel pin of the second interface; the switching circuit is switched to connect the second
  • the interface and the debug interface of the embedded processor include: switching a second end of the first switch circuit to be connected to a debug output/input interface of the embedded processor, and the second open The second end of the circuit is switched to be connected to the debug input/output interface of the embedded processor;
  • the switching the switch circuit to connect the first interface and the second interface includes: The second end of the first switch circuit is switched to be connected to the left channel pin of the first interface, and the second end of the second switch circuit is switched to be connected to the right channel pin of the first interface .
  • the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device via an external keypad.
  • the device receives the command to switch to the engineering mode and/or the command to switch to the user mode through its own infrared receiver.
  • the command to switch to the engineering mode and/or the command to switch to the user mode is a specific form of audio stream, and the device receives the switch to the engineering mode through its own audio input interface.
  • Command and / or switch to user mode command is a specific form of audio stream
  • the mode switching method of the foregoing embedded device can be implemented by hardware, software, or a combination of software and hardware. Based on the same inventive concept, an embedded device according to an embodiment of the present invention will be described with reference to FIG. 7 to perform the aforementioned mode switching method.
  • the embedded device 300 includes an embedded processor 3010, a memory 3020, an interface device 3030, a communication device 3040, a display device 3050, an input device 3060, a speaker 3070, a microphone 3080, and the like.
  • the embedded device 300 also includes a first interface coupled to the embedded processor 3010, a second interface exposed to the exterior of the embedded device 300 device, and a switching circuit coupled to the embedded processor 3010, not shown in FIG.
  • the memory 3020 is configured to store instructions for controlling the processor 3010 to operate to perform the mode switching method according to any one of the preceding claims, comprising: setting a mode flag to an engineering in response to a command to switch to an engineering mode a mode flag; responsive to the mode flag being set to an engineering mode flag, switching the device to an engineering mode and switching the switching circuit to a debug interface connecting the second interface and the embedded processor; And/or, in response to the command to switch to the user mode, setting the mode flag to the user mode flag; in response to the mode flag being set to the user mode flag, switching the device to the user mode and The switch circuit is switched to connect the first interface and the second interface.
  • the interface device 3030 includes, for example, a USB interface, a headphone jack, and the like.
  • the communication device 3040 can, for example, perform wired or wireless communication.
  • the display device 3050 is, for example, a liquid crystal display, a touch display, or the like.
  • Input device 3060 can include, for example, a touch screen, a keyboard, and the like. The user can input/output voice information through the speaker 3070 and the microphone 3080.
  • the embedded device shown in Figure 7 is merely illustrative and is in no way intended to limit the invention, its application or use. Those skilled in the art will appreciate that although a plurality of devices are illustrated in Figure 7, the present invention may relate only to a portion of the devices therein. Those skilled in the art can design instructions in accordance with the disclosed embodiments of the present invention. The instructions for controlling the operation of the processor are well known in the art and will not be described in detail herein.
  • each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions.
  • the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or action. Or it can be implemented by a combination of dedicated hardware and computer instructions.
  • the computer program product provided by the embodiment of the present invention includes a computer readable storage medium storing the program code, and the program code includes instructions for executing the method described in the foregoing method embodiment.
  • the program code includes instructions for executing the method described in the foregoing method embodiment.
  • the specific implementation refer to the method embodiment. , will not repeat them here.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some communication interface, device or unit, and may be electrical, mechanical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A mode switching method of an embedded device (100) and the embedded device (100). The embedded device (100) comprises: a first interface (1) connected to an embedded processor; a second interface (2) exposed to the outside of the embedded device (100); a switching circuit (4), the first interface (1) and the second interface (2) being of the same type; a mode flag bit setting module (6) used for setting the mode flag bit to be an engineering mode flag/user mode flag in response to a command for switching to an engineering mode/switching to a user mode; and a mode switching control module (5) used for switching the embedded device (100) to the engineering mode and switching the switching circuit (4) to connect to the second interface (2) and a debugging interface (3) of the embedded processor in response to setting the mode flag bit as the engineering mode flag, and switching the embedded device (100) to the user mode and switching the switching circuit (4) to connect to the first interface (1) and the second interface (2) in response to setting the mode flag bit as the user mode flag.

Description

嵌入式设备的模式切换方法和嵌入式设备Mode switching method and embedded device of embedded device 技术领域Technical field

本发明涉及计算机技术领域,尤其涉及一种嵌入式设备的模式切换方法和一种嵌入式设备。The present invention relates to the field of computer technologies, and in particular, to a mode switching method for an embedded device and an embedded device.

背景技术Background technique

随着智能化时代的到来,嵌入式系统在各个领域得到了广泛应用。使用嵌入式系统的人员主要分为两类,一类是开发测试维护人员,一类是普通用户。前者需要进入到工程模式,该模式允许查看系统的调试信息并进行全面的功能配置测试。后者不需要对系统的开发调试功能,只需要进入用户模式即可。With the advent of the intelligent era, embedded systems have been widely used in various fields. The people who use the embedded system are mainly divided into two categories, one is to develop test and maintenance personnel, and the other is ordinary users. The former needs to enter the engineering mode, which allows you to view the system's debugging information and perform a comprehensive functional configuration test. The latter does not require the development and debugging of the system, only need to enter the user mode.

现有技术中,嵌入式设备整机组装好以后只具有用户模式,针对嵌入式系统的调试接口已经被封住,如果后续有对嵌入式系统的调试需求,通常需要拆开嵌入式设备,非常不方便。因此,有必要针对嵌入式设备提供一种模式切换方案,方便开发测试维护人员对已经整机组装好的嵌入式设备进行调试测试。In the prior art, the embedded device has only a user mode after being assembled, and the debugging interface for the embedded system has been blocked. If there is a need for debugging of the embedded system, it is usually necessary to disassemble the embedded device. inconvenient. Therefore, it is necessary to provide a mode switching scheme for the embedded device, which is convenient for the development test and maintenance personnel to debug and test the embedded device that has been assembled by the whole machine.

发明内容Summary of the invention

本发明的目的是针对嵌入式设备提供一种模式切换方案,方便开发测试维护人员对已经整机组装好的嵌入式设备进行调试测试。The object of the present invention is to provide a mode switching scheme for an embedded device, which is convenient for developing test and maintenance personnel to perform debugging tests on an embedded device that has been assembled by the whole device.

根据本发明的第一方面,提供了一种嵌入式设备的模式切换方法,所述设备包括与所述设备的嵌入式处理器连接的第一接口、暴露于设备外部的第二接口、以及开关电路,所述第一接口和所述第二接口是同种类型的接口;所述方法包括以下步骤:According to a first aspect of the present invention, there is provided a mode switching method of an embedded device, the device comprising a first interface connected to an embedded processor of the device, a second interface exposed to the outside of the device, and a switch The circuit, the first interface and the second interface are the same type of interface; the method includes the following steps:

响应于切换为工程模式的命令,将模式标志位设置为工程模式标志;The mode flag is set to an engineering mode flag in response to a command to switch to the engineering mode;

响应于所述模式标志位被设置为工程模式标志,将所述设备切换为工程模式并且将所述开关电路切换为连接所述第二接口和所述嵌入式处理器 的调试接口;Responsive to the mode flag being set to an engineering mode flag, switching the device to an engineering mode and switching the switching circuit to connect the second interface and the embedded processor Debug interface

和/或,and / or,

响应于切换为用户模式的命令,将模式标志位设置为用户模式标志;Setting the mode flag to the user mode flag in response to a command to switch to the user mode;

响应于所述模式标志位被设置为用户模式标志,将所述设备切换为用户模式并且将所述开关电路切换为连接所述第一接口和所述第二接口。In response to the mode flag being set to a user mode flag, the device is switched to a user mode and the switching circuit is switched to connect the first interface and the second interface.

可选地,所述方法还包括以下步骤:Optionally, the method further includes the following steps:

所述设备启动时将开机标志位初始化为开机未完成标志,将模式标志位初始化为用户模式标志;其中,所述设备被配置为在所述开机标志位为开机未完成标志的状态下,禁止所述模式标志位被设置为工程模式标志;以及,When the device is started, the boot flag is initialized to a boot incomplete flag, and the mode flag is initialized to a user mode flag; wherein the device is configured to be disabled when the boot flag is a boot unfinished flag The mode flag is set to an engineering mode flag; and,

所述设备启动完成时,将所述开机标志位设置为开机完成标志。When the device is booted, the boot flag is set to a boot completion flag.

可选地,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为USB接口;Optionally, the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces;

所述第一开关电路的第一端与所述第二接口的D+引脚连接,所述第二开关电路的第一端与所述第二接口的D-引脚连接;a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface;

所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;The switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface connection, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;

所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的D+引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的D-引脚连接。The switching the switch circuit to connect the first interface and the second interface includes: switching a second end of the first switch circuit to be connected to a D+ pin of the first interface, The second end of the second switch circuit is switched to be connected to the D-pin of the first interface.

可选地,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为音频输入接口;Optionally, the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are audio input interfaces;

所述第一开关电路的第一端与所述第二接口的左声道引脚连接,所述第二开关电路的第一端与所述第二接口的右声道引脚连接;a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface;

所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所 述嵌入式处理器的调试输入/输出接口连接;The switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface is connected, and the second end of the second switch circuit is switched to Debugging input/output interface connection of the embedded processor;

所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的左声道引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的右声道引脚连接。Switching the switch circuit to connect the first interface and the second interface, comprising: switching a second end of the first switch circuit to be connected to a left channel pin of the first interface And switching the second end of the second switch circuit to be connected to the right channel pin of the first interface.

可选地,所述切换为工程模式的命令和/或所述切换为用户模式的命令是通过外部按键板输入至所述设备;或者,所述设备通过自身的红外接收器接收所述切换为工程模式的命令和/或所述切换为用户模式的命令;或者,所述切换为工程模式的命令和/或所述切换为用户模式的命令是特定形式的音频流,所述设备通过自身的音频输入接口接收所述切换为工程模式的命令和/所述或切换为用户模式的命令。Optionally, the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or the device receives the switch through its own infrared receiver to a command of the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the command to switch to the user mode is a specific form of audio stream, the device passing its own The audio input interface receives the command to switch to the engineering mode and/or the command to switch to the user mode.

根据本发明的第二方面,提供了一种嵌入式设备,所述设备包括与所述设备的嵌入式处理器连接的第一接口、暴露于设备外部的第二接口、以及开关电路,所述第一接口和所述第二接口是同种类型的接口;所述设备还包括模式标志位设置模块和模式切换控制模块;According to a second aspect of the present invention, an embedded device is provided, the device comprising a first interface coupled to an embedded processor of the device, a second interface exposed to an exterior of the device, and a switching circuit, The first interface and the second interface are interfaces of the same type; the device further includes a mode flag setting module and a mode switching control module;

所述模式标志位设置模块,用于响应于切换为工程模式的命令,将模式标志位设置为工程模式标志;和/或,用于响应于切换为用户模式的命令,将模式标志位设置为用户模式标志;The mode flag bit setting module is configured to set a mode flag bit to an engineering mode flag in response to a command to switch to an engineering mode; and/or to set a mode flag bit to be in response to a command to switch to a user mode User mode flag;

所述模式切换控制模块,用于响应于所述模式标志位被设置为工程模式标志,将所述设备切换为工程模式并且将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口;和/或,用于响应于所述模式标志位被设置为用户模式标志,将所述设备切换为用户模式并且将所述开关电路切换为连接所述第一接口和所述第二接口。The mode switching control module is configured to switch the device to an engineering mode and switch the switching circuit to connect the second interface and the embedded in response to the mode flag being set to an engineering mode flag a debug interface of the processor; and/or responsive to the mode flag being set to a user mode flag, switching the device to a user mode and switching the switch circuit to connect the first interface and Said second interface.

可选地,所述设备还包括开机标志位设置模块;Optionally, the device further includes a boot flag setting module;

所述开机标志位设置模块,用于在所述设备启动时将开机标志位初始化为开机未完成标志,以及在所述设备启动完成时将所述开机标志位设置为开机完成标志;其中,所述设备被配置为在所述开机标志位为开机未完成标志的状态下,禁止所述模式标志位被设置为工程模式标志;The boot flag setting module is configured to initialize a boot flag to a boot incomplete flag when the device is booted, and set the boot flag to a boot completion flag when the device is booted; wherein The device is configured to prohibit the mode flag from being set to an engineering mode flag when the boot flag is a boot incomplete flag;

所述模式标志位设置模块,还用于在所述设备启动时将模式标志位初 始化为用户模式标志。The mode flag setting module is further configured to start a mode flag when the device is started Initialized to the user mode flag.

可选地,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为USB接口;Optionally, the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces;

所述第一开关电路的第一端与所述第二接口的D+引脚连接,所述第二开关电路的第一端与所述第二接口的D-引脚连接;a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface;

所述模式切换控制模块将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;The mode switching control module switches the switch circuit to a debug interface that connects the second interface and the embedded processor, including: switching a second end of the first switch circuit to the embedded a debug output/input interface connection of the processor, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;

所述模式切换控制模块将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的D+引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的D-引脚连接。The mode switching control module switches the switch circuit to connect the first interface and the second interface, including: switching a second end of the first switch circuit to a D+ lead with the first interface The pin is connected to switch the second end of the second switch circuit to be connected to the D-pin of the first interface.

可选地,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为音频输入接口;Optionally, the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are audio input interfaces;

所述第一开关电路的第一端与所述第二接口的左声道引脚连接,所述第二开关电路的第一端与所述第二接口的右声道引脚连接;a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface;

所述模式切换控制模块将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;The mode switching control module switches the switch circuit to a debug interface that connects the second interface and the embedded processor, including: switching a second end of the first switch circuit to the embedded a debug output/input interface connection of the processor, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;

所述模式切换控制模块将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的左声道引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的右声道引脚连接。The mode switching control module switches the switch circuit to connect the first interface and the second interface, including: switching a second end of the first switch circuit to a left sound with the first interface The track pin is connected to switch the second end of the second switch circuit to be connected to the right channel pin of the first interface.

可选地,所述切换为工程模式的命令和/或所述切换为用户模式的命令是通过外部按键板输入至所述设备;或者,所述设备通过自身的红外接收器接收所述切换为工程模式的命令和/或所述切换为用户模式的命令;或者,所述切换为工程模式的命令和/或所述切换为用户模式的命令是特定形 式的音频流,所述设备通过自身的音频输入接口接收所述切换为工程模式的命令和/所述或切换为用户模式的命令。Optionally, the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or the device receives the switch through its own infrared receiver to The command of the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the command to switch to the user mode is a specific shape An audio stream of the type, the device receiving the command to switch to the engineering mode and/or the command to switch to the user mode through its own audio input interface.

根据本发明的第三方面,提供了一种嵌入式设备,所述设备包括与所述设备的嵌入式处理器连接的第一接口、暴露于设备外部的第二接口、以及开关电路,所述第一接口和所述第二接口是同种类型的接口;所述设备还包括存储器、处理器和存储在存储器上并可在处理器上运行的计算机程序;所述处理器执行所述程序时实现以下步骤:According to a third aspect of the present invention, an embedded device is provided, the device comprising a first interface coupled to an embedded processor of the device, a second interface exposed to an exterior of the device, and a switching circuit, The first interface and the second interface are the same type of interface; the device further includes a memory, a processor, and a computer program stored on the memory and executable on the processor; when the processor executes the program Implement the following steps:

响应于切换为工程模式的命令,将模式标志位设置为工程模式标志;The mode flag is set to an engineering mode flag in response to a command to switch to the engineering mode;

响应于所述模式标志位被设置为工程模式标志,将所述设备切换为工程模式并且将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口;Responsive to the mode flag being set to an engineering mode flag, switching the device to an engineering mode and switching the switching circuit to a debug interface connecting the second interface and the embedded processor;

和/或,and / or,

响应于切换为用户模式的命令,将模式标志位设置为用户模式标志;Setting the mode flag to the user mode flag in response to a command to switch to the user mode;

响应于所述模式标志位被设置为用户模式标志,将所述设备切换为用户模式并且将所述开关电路切换为连接所述第一接口和所述第二接口。In response to the mode flag being set to a user mode flag, the device is switched to a user mode and the switching circuit is switched to connect the first interface and the second interface.

可选地,所述处理器执行所述程序时还实现以下步骤:Optionally, when the processor executes the program, the following steps are further implemented:

在所述设备启动时将开机标志位初始化为开机未完成标志,将模式标志位初始化为用户模式标志;其中,所述设备被配置为在所述开机标志位为开机未完成标志的状态下,禁止所述模式标志位被设置为工程模式标志;以及,Initializing the boot flag to the boot incomplete flag when the device is booting, initializing the mode flag to the user mode flag; wherein the device is configured to be in a state where the boot flag is the boot incomplete flag, The mode flag is prohibited from being set to the engineering mode flag; and,

在所述设备启动完成时,将所述开机标志位设置为开机完成标志。When the device startup is completed, the boot flag is set to a boot completion flag.

可选地,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为USB接口;Optionally, the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces;

所述第一开关电路的第一端与所述第二接口的D+引脚连接,所述第二开关电路的第一端与所述第二接口的D-引脚连接;a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface;

所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接; The switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface connection, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;

所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的D+引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的D-引脚连接。The switching the switch circuit to connect the first interface and the second interface includes: switching a second end of the first switch circuit to be connected to a D+ pin of the first interface, The second end of the second switch circuit is switched to be connected to the D-pin of the first interface.

可选地,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为音频输入接口;Optionally, the switch circuit includes a first switch circuit and a second switch circuit, and the first interface and the second interface are audio input interfaces;

所述第一开关电路的第一端与所述第二接口的左声道引脚连接,所述第二开关电路的第一端与所述第二接口的右声道引脚连接;a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface;

所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;The switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface connection, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor;

所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的左声道引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的右声道引脚连接。Switching the switch circuit to connect the first interface and the second interface, comprising: switching a second end of the first switch circuit to be connected to a left channel pin of the first interface And switching the second end of the second switch circuit to be connected to the right channel pin of the first interface.

可选地,所述切换为工程模式的命令和/或所述切换为用户模式的命令是通过外部按键板输入至所述设备;或者,所述设备通过自身的红外接收器接收所述切换为工程模式的命令和/或所述切换为用户模式的命令;或者,所述切换为工程模式的命令和/或所述切换为用户模式的命令是特定形式的音频流,所述设备通过自身的音频输入接口接收所述切换为工程模式的命令和/所述或切换为用户模式的命令。Optionally, the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or the device receives the switch through its own infrared receiver to a command of the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the command to switch to the user mode is a specific form of audio stream, the device passing its own The audio input interface receives the command to switch to the engineering mode and/or the command to switch to the user mode.

本发明提供的嵌入式设备的模式切换方案,可以在用户模式和工程模式之间进行切换,方便开发测试维护人员对已经整机组装好的嵌入式设备进行调试测试。The mode switching scheme of the embedded device provided by the invention can be switched between the user mode and the engineering mode, so that the development test and maintenance personnel can debug and test the embedded device that has been assembled by the whole machine.

附图说明DRAWINGS

为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍。应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定。对于本领域普通技术人员来讲,在不付出创 造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments will be briefly described below. It is understood that the following drawings are merely illustrative of certain embodiments of the invention and are not intended to For those of ordinary skill in the art, Other relevant drawings can also be obtained from these drawings on the premise of creative labor.

图1示出了本发明第一实施例提供的嵌入式设备的框图;1 is a block diagram of an embedded device according to a first embodiment of the present invention;

图2示出了本发明第二实施例提供的嵌入式设备的框图;2 is a block diagram showing an embedded device according to a second embodiment of the present invention;

图3示出了本发明实施例提供的嵌入式设备的开关电路的连接示意图;FIG. 3 is a schematic diagram showing the connection of a switch circuit of an embedded device according to an embodiment of the present invention; FIG.

图4示出了本发明实施例提供的嵌入式设备的开关电路的连接示意图;4 is a schematic diagram showing the connection of a switch circuit of an embedded device according to an embodiment of the present invention;

图5示出了本发明实施例提供的嵌入式设备切换为工程模式的流程示意图;FIG. 5 is a schematic flowchart of switching an embedded device into an engineering mode according to an embodiment of the present invention;

图6示出了本发明实施例提供的嵌入式设备切换为用户模式的流程示意图;FIG. 6 is a schematic flowchart of switching an embedded device to a user mode according to an embodiment of the present invention;

图7示出了本发明实施例提供的嵌入式设备的硬件配置的框图。FIG. 7 is a block diagram showing a hardware configuration of an embedded device according to an embodiment of the present invention.

具体实施方式Detailed ways

现在将参照附图来详细描述本发明的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本发明的范围。Various exemplary embodiments of the present invention will now be described in detail with reference to the drawings. It should be noted that the relative arrangement of the components and steps, numerical expressions and numerical values set forth in the embodiments are not intended to limit the scope of the invention unless otherwise specified.

以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本发明及其应用或使用的任何限制。The following description of the at least one exemplary embodiment is merely illustrative and is in no way

对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。Techniques, methods and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but the techniques, methods and apparatus should be considered as part of the specification, where appropriate.

在这里示出和讨论的所有例子中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它例子可以具有不同的值。In all of the examples shown and discussed herein, any specific values are to be construed as illustrative only and not as a limitation. Thus, other examples of the exemplary embodiments may have different values.

应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。It should be noted that similar reference numerals and letters indicate similar items in the following figures, and therefore, once an item is defined in one figure, it is not required to be further discussed in the subsequent figures.

<嵌入式设备><embedded device>

参考图1所示,说明本发明第一实施例提供的嵌入式设备:嵌入式设备100包括与嵌入式设备100的嵌入式处理器连接的第一接口1、暴露于嵌入式设备100外部的第二接口2、以及开关电路4,第一接口1和第二接 口2是同种类型的接口。嵌入式设备100还包括模式标志位设置模块6和模式切换控制模块5。Referring to FIG. 1 , an embedded device according to a first embodiment of the present invention is illustrated. The embedded device 100 includes a first interface 1 connected to an embedded processor of the embedded device 100 and a second exposed to the outside of the embedded device 100 . Two interface 2, and switch circuit 4, first interface 1 and second connection Port 2 is the same type of interface. The embedded device 100 further includes a mode flag setting module 6 and a mode switching control module 5.

模式标志位设置模块6,用于响应于切换为工程模式的命令,将模式标志位设置为工程模式标志。模式切换控制模块5,用于响应于模式标志位被设置为工程模式标志,将嵌入式设备100切换为工程模式并且将开关电路4切换为连接第二接口2和嵌入式处理器的调试接口3,使得技术人员可以通过第二接口2接入调试接口3,对已经整机组装好的嵌入式设备100进行调试测试。The mode flag setting module 6 is configured to set the mode flag to the engineering mode flag in response to the command to switch to the engineering mode. The mode switching control module 5 is configured to switch the embedded device 100 to the engineering mode and switch the switching circuit 4 to the debug interface 3 connecting the second interface 2 and the embedded processor in response to the mode flag being set to the engineering mode flag. Therefore, the technician can access the debug interface 3 through the second interface 2, and perform debugging test on the embedded device 100 that has been assembled by the whole machine.

模式标志位设置模块6,还用于响应于切换为用户模式的命令,将模式标志位设置为用户模式标志。模式切换控制模块5,还用于响应于模式标志位被设置为用户模式标志,将嵌入式设备100切换为用户模式并且将开关电路4切换为连接第一接口1和第二接口2,使得嵌入式设备100从工程模式切换回用户模式。The mode flag setting module 6 is further configured to set the mode flag to the user mode flag in response to a command to switch to the user mode. The mode switching control module 5 is further configured to switch the embedded device 100 to the user mode and switch the switch circuit 4 to connect the first interface 1 and the second interface 2 in response to the mode flag being set to the user mode flag, so as to be embedded The device 100 switches from the engineering mode back to the user mode.

参考图2所示,说明本发明第二实施例提供的嵌入式设备,和第一实施例提供的嵌入式设备相比,第二实施例提供的嵌入式设备100还包括开机标志位设置模块7。Referring to FIG. 2, an embedded device provided by the second embodiment of the present invention is provided. Compared with the embedded device provided by the first embodiment, the embedded device 100 provided by the second embodiment further includes a boot flag setting module 7 .

开机标志位设置模块7,用于在嵌入式设备100启动时将开机标志位初始化为开机未完成标志,以及在嵌入式设备100启动完成时将开机标志位设置为开机完成标志。嵌入式设备100被配置为在开机标志位为开机未完成标志的状态下,禁止模式标志位被设置为工程模式标志。The boot flag setting module 7 is configured to initialize the boot flag to the boot incomplete flag when the embedded device 100 is booted, and to set the boot flag to the boot completion flag when the embedded device 100 is booted. The embedded device 100 is configured to disable the mode flag bit as an engineering mode flag in a state where the power-on flag is a power-on incomplete flag.

模式标志位设置模块6,还用于在嵌入式设备100启动时将模式标志位初始化为用户模式标志,即,嵌入式设备100每次开机时都会被设置为用户模式。The mode flag setting module 6 is further configured to initialize the mode flag to the user mode flag when the embedded device 100 is started, that is, the embedded device 100 is set to the user mode each time the device is turned on.

由于嵌入式设备100被配置为在开机标志位为开机未完成标志的状态下禁止模式标志位被设置为工程模式标志,嵌入式设备100只有开机完成后才能够切换为工程模式,主要目的是保护开机过程中各模块的初始化,以及防止在开机过程中切换模式带来问题。Since the embedded device 100 is configured to disable the mode flag from being set to the engineering mode flag when the boot flag is the boot incomplete flag, the embedded device 100 can only switch to the engineering mode after the boot is completed, and the main purpose is to protect The initialization of each module during the boot process and the prevention of switching modes during the boot process.

在上述实施例提供的嵌入式设备中,通过模式标志位判断是用户模式 或是工程模式,如果是在工程模式下,则开放调试信息及测试功能。如果是在用户模式下,则只提供使用功能,不开放调试信息及测试功能。In the embedded device provided in the above embodiment, the user mode is determined by the mode flag bit. Or the engineering mode, if it is in the engineering mode, open the debugging information and test functions. If it is in user mode, it only provides the function, and does not open the debugging information and test function.

<开关电路><switch circuit>

参考图3所示,说明本发明的一个实施例提供的嵌入式设备的开关电路的连接示意图。Referring to FIG. 3, a schematic diagram of a connection of a switch circuit of an embedded device according to an embodiment of the present invention is illustrated.

开关电路包括第一开关电路31和第二开关电路32,第一接口和第二接口为USB接口。The switch circuit includes a first switch circuit 31 and a second switch circuit 32, and the first interface and the second interface are USB interfaces.

第一开关电路31的第一端与第二USB接口21的D+引脚连接,第二开关电路32的第一端与第二USB接口21的D-引脚连接。The first end of the first switch circuit 31 is connected to the D+ pin of the second USB interface 21, and the first end of the second switch circuit 32 is connected to the D- pin of the second USB interface 21.

响应于所述模式标志位被设置为工程模式标志,模式切换控制模块将嵌入式设备切换为工程模式,并且将第一开关电路31的第二端切换为与嵌入式处理器的调试输入接口RX连接,将第二开关电路32的第二端切换为与嵌入式处理器的调试输出接口TX连接。当然,也可以将第一开关电路31的第二端切换为与嵌入式处理器的调试输出接口TX连接,将第二开关电路32的第二端切换为与嵌入式处理器的调试输入接口RX连接。经过上述切换,使得技术人员可以通过第二USB接口21接入调试输入接口RX和调试输出接口TX,对已经整机组装好的嵌入式设备进行调试测试。In response to the mode flag being set to an engineering mode flag, the mode switching control module switches the embedded device to the engineering mode and switches the second end of the first switching circuit 31 to the debug input interface RX with the embedded processor. Connected, the second end of the second switching circuit 32 is switched to be connected to the debug output interface TX of the embedded processor. Of course, the second end of the first switch circuit 31 can also be switched to be connected to the debug output interface TX of the embedded processor, and the second end of the second switch circuit 32 can be switched to the debug input interface RX of the embedded processor. connection. After the above switching, the technician can access the debug input interface RX and the debug output interface TX through the second USB interface 21 to debug the embedded device that has been assembled.

响应于所述模式标志位被设置为用户模式标志,模式切换控制模块将嵌入式设备切换为用户模式,并且将第一开关电路31的第二端切换为与第一USB接口11的D+引脚连接,将第二开关32电路的第二端切换为与第一USB接口11的D-引脚连接。In response to the mode flag being set to the user mode flag, the mode switching control module switches the embedded device to the user mode and switches the second end of the first switching circuit 31 to the D+ pin of the first USB interface 11. Connected to switch the second end of the second switch 32 circuit to be connected to the D-pin of the first USB interface 11.

参考图4所示,说明本发明的一个实施例提供的嵌入式设备的开关电路的连接示意图。Referring to FIG. 4, a schematic diagram of a connection of a switch circuit of an embedded device according to an embodiment of the present invention is illustrated.

开关电路包括第一开关电路31和第二开关电路32,第一接口和第二接口为音频输入接口。The switch circuit includes a first switch circuit 31 and a second switch circuit 32, and the first interface and the second interface are audio input interfaces.

第一开关电路31的第一端与第二音频输入接口22的左声道引脚连接,第二开关电路31的第一端与第二音频输入接口22的右声道引脚连接。 The first end of the first switch circuit 31 is connected to the left channel pin of the second audio input interface 22, and the first end of the second switch circuit 31 is connected to the right channel pin of the second audio input interface 22.

响应于所述模式标志位被设置为工程模式标志,模式切换控制模块将嵌入式设备切换为工程模式,并且将第一开关电路31的第二端切换为与嵌入式处理器的调试输入接口RX连接,将第二开关电路32的第二端切换为与嵌入式处理器的调试输出接口TX连接。当然,也可以将第一开关电路31的第二端切换为与嵌入式处理器的调试输出接口TX连接,将第二开关电路32的第二端切换为与嵌入式处理器的调试输入接口RX连接。经过上述切换,使得技术人员可以通过第二音频输入接口22接入调试输入接口RX和调试输出接口TX,对已经整机组装好的嵌入式设备100进行调试测试。In response to the mode flag being set to an engineering mode flag, the mode switching control module switches the embedded device to the engineering mode and switches the second end of the first switching circuit 31 to the debug input interface RX with the embedded processor. Connected, the second end of the second switching circuit 32 is switched to be connected to the debug output interface TX of the embedded processor. Of course, the second end of the first switch circuit 31 can also be switched to be connected to the debug output interface TX of the embedded processor, and the second end of the second switch circuit 32 can be switched to the debug input interface RX of the embedded processor. connection. After the above switching, the technician can access the debug input interface RX and the debug output interface TX through the second audio input interface 22, and perform debugging test on the embedded device 100 that has been assembled.

响应于所述模式标志位被设置为用户模式标志,模式切换控制模块将嵌入式设备切换为用户模式,并且将第一开关电路31的第二端切换为与第一音频输入接口12的左声道引脚连接,将第二开关电路32的第二端切换为与第一音频输入接口12的右声道引脚连接。In response to the mode flag being set to the user mode flag, the mode switching control module switches the embedded device to the user mode and switches the second end of the first switching circuit 31 to the left sound with the first audio input interface 12. The track pin is connected to switch the second end of the second switch circuit 32 to be connected to the right channel pin of the first audio input interface 12.

<模式切换命令接收方式><Mode switching command receiving mode>

在上述实施例中,嵌入式设备可以通过以下三种方式接收用户输入的模式切换命令:In the above embodiment, the embedded device can receive the mode switching command input by the user in the following three ways:

第一种方式:切换为工程模式的命令和/或切换为用户模式的命令是通过外部按键板输入至嵌入式设备。按键板与嵌入式设备连接,在按键板定义特定非功能键或者特定组合键作为模式切换命令。在嵌入式设备处于用户模式的状态下,按下特定非功能键或特定组合键时,嵌入式设备切换为工程模式并且第二接口与调试接口连接,使得技术人员可以通过第二接口接入调试接口对已经整机组装好的嵌入式设备进行调试测试;当用户再次按下特定非功能键或特定组合键,嵌入式设备切换为用户模式并且第二接口与第一接口连接,第二接口恢复其原本的功能。The first way: the command to switch to engineering mode and / or the command to switch to user mode is input to the embedded device through the external keypad. The keypad is connected to the embedded device, and a specific non-function key or a specific combination key is defined on the keypad as a mode switching command. When the embedded device is in the user mode, when the specific non-function key or the specific combination key is pressed, the embedded device switches to the engineering mode and the second interface is connected with the debugging interface, so that the technician can access the debugging through the second interface. The interface performs debugging test on the embedded device that has been assembled by the whole machine; when the user presses a specific non-functional key or a specific combination key again, the embedded device switches to the user mode and the second interface is connected with the first interface, and the second interface is restored. Its original function.

第二种方式:嵌入式设备通过自身的红外接收器接收切换为工程模式的命令和/或切换为用户模式的命令。通常的红外遥控器编码范围为0~255,遥控功能本身使用的编码没有那么多,技术人员可以在空余的编码中设定特定的编码作为切换命令,嵌入式设备通过自身的红外接收器接收红外遥控器发送的模式切换命令。 The second way: the embedded device receives commands to switch to engineering mode and/or commands to switch to user mode through its own infrared receiver. The usual infrared remote control has a coding range of 0 to 255. The remote control function itself does not use as many codes. The technician can set a specific code as a switching command in the spare code. The embedded device receives the infrared through its own infrared receiver. Mode switching command sent by the remote controller.

第三种方式:切换为工程模式的命令和/或切换为用户模式的命令是特定形式的音频流,嵌入式设备通过自身的音频输入接口接收切换为工程模式的命令和/或切换为用户模式的命令。The third way: the command to switch to the engineering mode and/or the command to switch to the user mode is a specific form of audio stream, and the embedded device receives the command to switch to the engineering mode through its own audio input interface and/or switches to the user mode. The command.

<嵌入式设备的模式切换方法><Mode switching method of embedded device>

参见图5和图6所示,说明本发明实施例提供嵌入式设备的模式切换方法:Referring to FIG. 5 and FIG. 6 , an embodiment of the present invention provides a mode switching method for an embedded device:

嵌入式设备上电启动,执行步骤801,嵌入式系统初始化;将开机标志位SystemOkFlag初始化为0,SystemOkFlag=0表示开机未完成;将模式标志位ModelFlag初始化为0,ModelFlag=0表示用户模式。The embedded device is powered on, and step 801 is executed to initialize the embedded system; the boot flag bit SystemOkFlag is initialized to 0, SystemOkFlag=0 indicates that the boot is not completed; the mode flag bit ModelFlag is initialized to 0, and ModelFlag=0 indicates the user mode.

初始化完成以后,执行步骤802,将开机标志位SystemOkFlag设置为1,SystemOkFlag=1表示开机完成。After the initialization is completed, step 802 is executed to set the boot flag bit SystemOkFlag to 1, and SystemOkFlag=1 indicates that the boot process is completed.

步骤803,系统实时检测开机标志位SystemOkFlag,如果SystemOkFlag=0,则屏蔽切换为工程模式的命令。In step 803, the system detects the boot flag bit SystemOkFlag in real time, and if SystemOkFlag=0, masks the command to switch to the engineering mode.

步骤804,在SystemOkFlag=1的状态下,检测是否接收到切换为工程模式的命令。In step 804, in the state of SystemOkFlag=1, it is detected whether a command to switch to the engineering mode is received.

系统在开机标志位SystemOkFlag为1的状态下,如果接收到切换为工程模式的命令,则执行步骤805,将模式标志位ModelFlag设置为1,ModelFlag=1表示工程模式。If the system receives a command to switch to the engineering mode, the system executes step 805 to set the mode flag bit ModelFlag to 1, and ModelFlag=1 indicates the engineering mode.

响应于模式标志位ModelFlag被设置为1,执行步骤806,嵌入式设备1切换为工程模式并且开关电路切换为连接第二接口和嵌入式处理器的调试接口。In response to the mode flag bit ModelFlag being set to 1, step 806 is executed, the embedded device 1 is switched to the engineering mode and the switching circuit is switched to the debug interface connecting the second interface and the embedded processor.

在嵌入式设备处于工程模式的状态下,步骤901检测是否接收到切换为用户模式的命令。如果接收到切换为用户模式的命令,则执行步骤902,将模式标志位ModelFlag设置为0。响应于模式标志位ModelFlag被设置为0,执行步骤903,嵌入式设备切换为用户模式并且开关电路切换为连接第一接口和第二接口,第二接口恢复其原本的功能。In a state where the embedded device is in the engineering mode, step 901 detects whether a command to switch to the user mode is received. If a command to switch to the user mode is received, step 902 is executed to set the mode flag bit ModelFlag to zero. In response to the mode flag bit ModelFlag being set to 0, step 903 is executed, the embedded device switches to the user mode and the switch circuit switches to connect the first interface and the second interface, and the second interface restores its original function.

本发明实施例提供了一种嵌入式设备的模式切换方法,所述设备包括与所述设备的嵌入式处理器连接的第一接口、暴露于设备外部的第二接口、 以及开关电路,所述第一接口和所述第二接口是同种类型的接口;所述方法包括以下步骤:响应于切换为工程模式的命令,将模式标志位设置为工程模式标志;响应于所述模式标志位被设置为工程模式标志,将所述设备切换为工程模式并且将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口;和/或,响应于切换为用户模式的命令,将模式标志位设置为用户模式标志;响应于所述模式标志位被设置为用户模式标志,将所述设备切换为用户模式并且将所述开关电路切换为连接所述第一接口和所述第二接口。An embodiment of the present invention provides a mode switching method of an embedded device, where the device includes a first interface connected to an embedded processor of the device, and a second interface exposed to the outside of the device, And a switch circuit, the first interface and the second interface being the same type of interface; the method comprising the steps of: setting a mode flag to an engineering mode flag in response to a command to switch to an engineering mode; The mode flag is set to an engineering mode flag, the device is switched to an engineering mode and the switching circuit is switched to a debug interface connecting the second interface and the embedded processor; and/or, responsive Setting the mode flag to the user mode flag in response to the command to switch to the user mode; switching the device to the user mode and switching the switch circuit to the connection mode in response to the mode flag being set to the user mode flag The first interface and the second interface are described.

在一个具体的例子中,所述方法还包括以下步骤:所述设备启动时将开机标志位初始化为开机未完成标志,将模式标志位初始化为用户模式标志;其中,所述设备被配置为在所述开机标志位为开机未完成标志的状态下,禁止所述模式标志位被设置为工程模式标志;以及,所述设备启动完成时,将所述开机标志位设置为开机完成标志。In a specific example, the method further includes the steps of: initializing the boot flag bit to a power-on incomplete flag when the device is booting, and initializing the mode flag bit to a user mode flag; wherein the device is configured to be When the boot flag is the boot incomplete flag, the mode flag is prohibited from being set to the engineering mode flag; and when the device is booted, the boot flag is set to the boot completion flag.

在一个具体的例子中,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为USB接口;所述第一开关电路的第一端与所述第二接口的D+引脚连接,所述第二开关电路的第一端与所述第二接口的D-引脚连接;所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的D+引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的D-引脚连接。In a specific example, the switch circuit includes a first switch circuit and a second switch circuit, the first interface and the second interface are USB interfaces; a first end of the first switch circuit and the a D+ pin of the second interface is connected, a first end of the second switch circuit is coupled to a D- pin of the second interface; the switching circuit is switched to connect the second interface and the The debugging interface of the embedded processor includes: switching a second end of the first switch circuit to be connected to a debug output/input interface of the embedded processor, and switching a second end of the second switch circuit For connecting to a debug input/output interface of the embedded processor; switching the switch circuit to connect the first interface and the second interface, comprising: seconding the first switch circuit The terminal is switched to be connected to the D+ pin of the first interface, and the second end of the second switch circuit is switched to be connected to the D-pin of the first interface.

在一个具体的例子中,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为音频输入接口;所述第一开关电路的第一端与所述第二接口的左声道引脚连接,所述第二开关电路的第一端与所述第二接口的右声道引脚连接;所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开 关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的左声道引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的右声道引脚连接。In a specific example, the switch circuit includes a first switch circuit and a second switch circuit, the first interface and the second interface are audio input interfaces; and the first end of the first switch circuit a left channel pin connection of the second interface, a first end of the second switch circuit is connected to a right channel pin of the second interface; the switching circuit is switched to connect the second The interface and the debug interface of the embedded processor include: switching a second end of the first switch circuit to be connected to a debug output/input interface of the embedded processor, and the second open The second end of the circuit is switched to be connected to the debug input/output interface of the embedded processor; the switching the switch circuit to connect the first interface and the second interface includes: The second end of the first switch circuit is switched to be connected to the left channel pin of the first interface, and the second end of the second switch circuit is switched to be connected to the right channel pin of the first interface .

在一个具体的例子中,所述切换为工程模式的命令和/或所述切换为用户模式的命令是通过外部按键板输入至所述设备。In a specific example, the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device via an external keypad.

在一个具体的例子中,所述设备通过自身的红外接收器接收所述切换为工程模式的命令和/或所述切换为用户模式的命令。In a specific example, the device receives the command to switch to the engineering mode and/or the command to switch to the user mode through its own infrared receiver.

在一个具体的例子中,所述切换为工程模式的命令和/或所述切换为用户模式的命令是特定形式的音频流,所述设备通过自身的音频输入接口接收所述切换为工程模式的命令和/所述或切换为用户模式的命令。In a specific example, the command to switch to the engineering mode and/or the command to switch to the user mode is a specific form of audio stream, and the device receives the switch to the engineering mode through its own audio input interface. Command and / or switch to user mode command.

<嵌入式设备><embedded device>

对于本领域技术人员来说,可以通过硬件方式、软件方式或软硬件结合的方式实现前述嵌入式设备的模式切换方法。基于同一发明构思,参考图7介绍本发明实施例的嵌入式设备,以执行前述模式切换方法。For those skilled in the art, the mode switching method of the foregoing embedded device can be implemented by hardware, software, or a combination of software and hardware. Based on the same inventive concept, an embedded device according to an embodiment of the present invention will be described with reference to FIG. 7 to perform the aforementioned mode switching method.

图7是显示可用于实现本发明的实施例的嵌入式设备的硬件配置的例子的框图。嵌入式设备300包括嵌入式处理器3010、存储器3020、接口装置3030、通信装置3040、显示装置3050、输入装置3060、扬声器3070、麦克风3080,等等。嵌入式设备300还包括与嵌入式处理器3010连接的第一接口、暴露于嵌入式设备300设备外部的第二接口、以及与嵌入式处理器3010连接的开关电路,图7中没有示出。7 is a block diagram showing an example of a hardware configuration of an embedded device that can be used to implement an embodiment of the present invention. The embedded device 300 includes an embedded processor 3010, a memory 3020, an interface device 3030, a communication device 3040, a display device 3050, an input device 3060, a speaker 3070, a microphone 3080, and the like. The embedded device 300 also includes a first interface coupled to the embedded processor 3010, a second interface exposed to the exterior of the embedded device 300 device, and a switching circuit coupled to the embedded processor 3010, not shown in FIG.

存储器3020用于存储指令,所述指令用于控制处理器3010进行操作以执行根据前述任一项所述的模式切换方法,包括:响应于切换为工程模式的命令,将模式标志位设置为工程模式标志;响应于所述模式标志位被设置为工程模式标志,将所述设备切换为工程模式并且将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口;和/或,响应于切换为用户模式的命令,将模式标志位设置为用户模式标志;响应于所述模式标志位被设置为用户模式标志,将所述设备切换为用户模式并且将所述 开关电路切换为连接所述第一接口和所述第二接口。The memory 3020 is configured to store instructions for controlling the processor 3010 to operate to perform the mode switching method according to any one of the preceding claims, comprising: setting a mode flag to an engineering in response to a command to switch to an engineering mode a mode flag; responsive to the mode flag being set to an engineering mode flag, switching the device to an engineering mode and switching the switching circuit to a debug interface connecting the second interface and the embedded processor; And/or, in response to the command to switch to the user mode, setting the mode flag to the user mode flag; in response to the mode flag being set to the user mode flag, switching the device to the user mode and The switch circuit is switched to connect the first interface and the second interface.

接口装置3030例如包括USB接口、耳机接口等。通信装置3040例如能够进行有线或无线通信。显示装置3050例如是液晶显示屏、触摸显示屏等。输入装置3060例如可以包括触摸屏、键盘等。用户可以通过扬声器3070和麦克风3080输入/输出语音信息。The interface device 3030 includes, for example, a USB interface, a headphone jack, and the like. The communication device 3040 can, for example, perform wired or wireless communication. The display device 3050 is, for example, a liquid crystal display, a touch display, or the like. Input device 3060 can include, for example, a touch screen, a keyboard, and the like. The user can input/output voice information through the speaker 3070 and the microphone 3080.

图7所示的嵌入式设备仅是解释性的,并且决不是为了要限制本发明、其应用或用途。本领域技术人员应当理解,尽管在图7中示出了多个装置,但是,本发明可以仅涉及其中的部分装置。本领域技术人员可以根据本发明所公开方案设计指令,指令如何控制处理器进行操作是本领域公知技术,故在此不再详细描述。The embedded device shown in Figure 7 is merely illustrative and is in no way intended to limit the invention, its application or use. Those skilled in the art will appreciate that although a plurality of devices are illustrated in Figure 7, the present invention may relate only to a portion of the devices therein. Those skilled in the art can design instructions in accordance with the disclosed embodiments of the present invention. The instructions for controlling the operation of the processor are well known in the art and will not be described in detail herein.

需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。但本领域技术人员应当清楚的是,上述各实施例可以根据需要单独使用或者相互结合使用。另外,对于装置实施例而言,由于其是与方法实施例相对应,所以描述得比较简单,相关之处参见方法实施例的对应部分的说明即可。以上所描述的系统实施例仅仅是示意性的,其中作为分离部件说明的模块可以是或者也可是不是物理上分开的。It should be noted that each embodiment in the specification is described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the embodiments are referred to each other. can. However, it should be apparent to those skilled in the art that the above embodiments may be used alone or in combination with each other as needed. In addition, for the device embodiment, since it corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the corresponding part of the method embodiment. The system embodiments described above are merely illustrative, and the modules illustrated as separate components may or may not be physically separate.

另外,附图中的流程图和框图显示了根据本发明的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。 In addition, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions. It should also be noted that in some alternative implementations, the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified function or action. Or it can be implemented by a combination of dedicated hardware and computer instructions.

本发明实施例所提供的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行前面方法实施例中所述的方法,具体实现可参见方法实施例,在此不再赘述。The computer program product provided by the embodiment of the present invention includes a computer readable storage medium storing the program code, and the program code includes instructions for executing the method described in the foregoing method embodiment. For the specific implementation, refer to the method embodiment. , will not repeat them here.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some communication interface, device or unit, and may be electrical, mechanical or otherwise.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。 The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including The instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.

以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention. It should be noted that similar reference numerals and letters indicate similar items in the following figures. Therefore, once an item is defined in one figure, it is not necessary to further define and explain it in the subsequent figures.

虽然已经通过例子对本发明的一些特定实施例进行了详细说明,但是本领域的技术人员应该理解,以上例子仅是为了进行说明,而不是为了限制本发明的范围。本领域的技术人员应该理解,可在不脱离本发明的范围的情况下,对以上实施例进行修改。本发明的范围由所附权利要求来限定。 While the invention has been described in detail with reference to the preferred embodiments of the present invention, it is understood that It will be appreciated by those skilled in the art that the above embodiments may be modified without departing from the scope of the invention. The scope of the invention is defined by the appended claims.

Claims (15)

一种嵌入式设备的模式切换方法,其特征在于,所述设备包括与所述设备的嵌入式处理器连接的第一接口、暴露于设备外部的第二接口、以及开关电路,所述第一接口和所述第二接口是同种类型的接口;所述方法包括以下步骤:A mode switching method for an embedded device, characterized in that the device comprises a first interface connected to an embedded processor of the device, a second interface exposed to the outside of the device, and a switch circuit, the first The interface and the second interface are the same type of interface; the method includes the following steps: 响应于切换为工程模式的命令,将模式标志位设置为工程模式标志;The mode flag is set to an engineering mode flag in response to a command to switch to the engineering mode; 响应于所述模式标志位被设置为工程模式标志,将所述设备切换为工程模式并且将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口;Responsive to the mode flag being set to an engineering mode flag, switching the device to an engineering mode and switching the switching circuit to a debug interface connecting the second interface and the embedded processor; 和/或,and / or, 响应于切换为用户模式的命令,将模式标志位设置为用户模式标志;Setting the mode flag to the user mode flag in response to a command to switch to the user mode; 响应于所述模式标志位被设置为用户模式标志,将所述设备切换为用户模式并且将所述开关电路切换为连接所述第一接口和所述第二接口。In response to the mode flag being set to a user mode flag, the device is switched to a user mode and the switching circuit is switched to connect the first interface and the second interface. 根据权利要求1所述的方法,其特征在于,所述方法还包括以下步骤:The method of claim 1 wherein the method further comprises the steps of: 所述设备启动时将开机标志位初始化为开机未完成标志,将模式标志位初始化为用户模式标志;其中,所述设备被配置为在所述开机标志位为开机未完成标志的状态下,禁止所述模式标志位被设置为工程模式标志;以及,When the device is started, the boot flag is initialized to a boot incomplete flag, and the mode flag is initialized to a user mode flag; wherein the device is configured to be disabled when the boot flag is a boot unfinished flag The mode flag is set to an engineering mode flag; and, 所述设备启动完成时,将所述开机标志位设置为开机完成标志。When the device is booted, the boot flag is set to a boot completion flag. 根据权利要求1或2所述的方法,其特征在于,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为USB接口;The method according to claim 1 or 2, wherein the switch circuit comprises a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces; 所述第一开关电路的第一端与所述第二接口的D+引脚连接,所述第二开关电路的第一端与所述第二接口的D-引脚连接;a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface; 所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所 述嵌入式处理器的调试输入/输出接口连接;The switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface is connected, and the second end of the second switch circuit is switched to Debugging input/output interface connection of the embedded processor; 所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的D+引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的D-引脚连接。The switching the switch circuit to connect the first interface and the second interface includes: switching a second end of the first switch circuit to be connected to a D+ pin of the first interface, The second end of the second switch circuit is switched to be connected to the D-pin of the first interface. 根据权利要求1或2所述的方法,其特征在于,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为音频输入接口;The method according to claim 1 or 2, wherein the switch circuit comprises a first switch circuit and a second switch circuit, and the first interface and the second interface are audio input interfaces; 所述第一开关电路的第一端与所述第二接口的左声道引脚连接,所述第二开关电路的第一端与所述第二接口的右声道引脚连接;a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface; 所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;The switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface connection, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor; 所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的左声道引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的右声道引脚连接。Switching the switch circuit to connect the first interface and the second interface, comprising: switching a second end of the first switch circuit to be connected to a left channel pin of the first interface And switching the second end of the second switch circuit to be connected to the right channel pin of the first interface. 根据权利要求1-4任一项所述的方法,其特征在于,所述切换为工程模式的命令和/或所述切换为用户模式的命令是通过外部按键板输入至所述设备;或者,所述设备通过自身的红外接收器接收所述切换为工程模式的命令和/或所述切换为用户模式的命令;或者,所述切换为工程模式的命令和/或所述切换为用户模式的命令是特定形式的音频流,所述设备通过自身的音频输入接口接收所述切换为工程模式的命令和/所述或切换为用户模式的命令。The method according to any one of claims 1 to 4, wherein the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or Receiving, by the infrared receiver of the device, the command to switch to the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the switching to the user mode The command is a specific form of audio stream, and the device receives the command to switch to the engineering mode and/or the command to switch to the user mode through its own audio input interface. 一种嵌入式设备,其特征在于,所述设备包括与所述设备的嵌入式处理器连接的第一接口、暴露于设备外部的第二接口、以及开关电路,所述第一接口和所述第二接口是同种类型的接口;所述设备还包括模式标志位设置模块和模式切换控制模块;An embedded device, characterized in that the device comprises a first interface connected to an embedded processor of the device, a second interface exposed to the outside of the device, and a switching circuit, the first interface and the The second interface is an interface of the same type; the device further includes a mode flag setting module and a mode switching control module; 所述模式标志位设置模块,用于响应于切换为工程模式的命令,将模 式标志位设置为工程模式标志;和/或,用于响应于切换为用户模式的命令,将模式标志位设置为用户模式标志;The mode flag setting module is configured to respond to a command to switch to an engineering mode The flag bit is set to an engineering mode flag; and/or, for setting a mode flag bit to a user mode flag in response to a command to switch to the user mode; 所述模式切换控制模块,用于响应于所述模式标志位被设置为工程模式标志,将所述设备切换为工程模式并且将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口;和/或,用于响应于所述模式标志位被设置为用户模式标志,将所述设备切换为用户模式并且将所述开关电路切换为连接所述第一接口和所述第二接口。The mode switching control module is configured to switch the device to an engineering mode and switch the switching circuit to connect the second interface and the embedded in response to the mode flag being set to an engineering mode flag a debug interface of the processor; and/or responsive to the mode flag being set to a user mode flag, switching the device to a user mode and switching the switch circuit to connect the first interface and Said second interface. 根据权利要求6所述的设备,其特征在于,所述设备还包括开机标志位设置模块;The device according to claim 6, wherein the device further comprises a boot flag setting module; 所述开机标志位设置模块,用于在所述设备启动时将开机标志位初始化为开机未完成标志,以及在所述设备启动完成时将所述开机标志位设置为开机完成标志;其中,所述设备被配置为在所述开机标志位为开机未完成标志的状态下,禁止所述模式标志位被设置为工程模式标志;The boot flag setting module is configured to initialize a boot flag to a boot incomplete flag when the device is booted, and set the boot flag to a boot completion flag when the device is booted; wherein The device is configured to prohibit the mode flag from being set to an engineering mode flag when the boot flag is a boot incomplete flag; 所述模式标志位设置模块,还用于在所述设备启动时将模式标志位初始化为用户模式标志。The mode flag setting module is further configured to initialize a mode flag bit to a user mode flag when the device is started. 根据权利要求6或7所述的设备,其特征在于,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为USB接口;The device according to claim 6 or 7, wherein the switch circuit comprises a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces; 所述第一开关电路的第一端与所述第二接口的D+引脚连接,所述第二开关电路的第一端与所述第二接口的D-引脚连接;a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface; 所述模式切换控制模块将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;The mode switching control module switches the switch circuit to a debug interface that connects the second interface and the embedded processor, including: switching a second end of the first switch circuit to the embedded a debug output/input interface connection of the processor, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor; 所述模式切换控制模块将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的D+引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的D-引脚连接。The mode switching control module switches the switch circuit to connect the first interface and the second interface, including: switching a second end of the first switch circuit to a D+ lead with the first interface The pin is connected to switch the second end of the second switch circuit to be connected to the D-pin of the first interface. 根据权利要求6或7所述的设备,其特征在于,所述开关电路包 括第一开关电路和第二开关电路,所述第一接口和所述第二接口为音频输入接口;The device according to claim 6 or 7, wherein said switch circuit package The first switch circuit and the second switch circuit, the first interface and the second interface are audio input interfaces; 所述第一开关电路的第一端与所述第二接口的左声道引脚连接,所述第二开关电路的第一端与所述第二接口的右声道引脚连接;a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface; 所述模式切换控制模块将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;The mode switching control module switches the switch circuit to a debug interface that connects the second interface and the embedded processor, including: switching a second end of the first switch circuit to the embedded a debug output/input interface connection of the processor, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor; 所述模式切换控制模块将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的左声道引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的右声道引脚连接。The mode switching control module switches the switch circuit to connect the first interface and the second interface, including: switching a second end of the first switch circuit to a left sound with the first interface The track pin is connected to switch the second end of the second switch circuit to be connected to the right channel pin of the first interface. 根据权利要求6-10任一项所述的设备,其特征在于,所述切换为工程模式的命令和/或所述切换为用户模式的命令是通过外部按键板输入至所述设备;或者,所述设备通过自身的红外接收器接收所述切换为工程模式的命令和/或所述切换为用户模式的命令;或者,所述切换为工程模式的命令和/或所述切换为用户模式的命令是特定形式的音频流,所述设备通过自身的音频输入接口接收所述切换为工程模式的命令和/所述或切换为用户模式的命令。The device according to any one of claims 6 to 10, wherein the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or Receiving, by the infrared receiver of the device, the command to switch to the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the switching to the user mode The command is a specific form of audio stream, and the device receives the command to switch to the engineering mode and/or the command to switch to the user mode through its own audio input interface. 一种嵌入式设备,其特征在于,所述设备包括与所述设备的嵌入式处理器连接的第一接口、暴露于设备外部的第二接口、以及开关电路,所述第一接口和所述第二接口是同种类型的接口;所述设备还包括存储器、处理器和存储在存储器上并可在处理器上运行的计算机程序;所述处理器执行所述程序时实现以下步骤:An embedded device, characterized in that the device comprises a first interface connected to an embedded processor of the device, a second interface exposed to the outside of the device, and a switching circuit, the first interface and the The second interface is an interface of the same type; the device further includes a memory, a processor, and a computer program stored on the memory and executable on the processor; the processor executing the program implements the following steps: 响应于切换为工程模式的命令,将模式标志位设置为工程模式标志;The mode flag is set to an engineering mode flag in response to a command to switch to the engineering mode; 响应于所述模式标志位被设置为工程模式标志,将所述设备切换为工程模式并且将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口;Responsive to the mode flag being set to an engineering mode flag, switching the device to an engineering mode and switching the switching circuit to a debug interface connecting the second interface and the embedded processor; 和/或, and / or, 响应于切换为用户模式的命令,将模式标志位设置为用户模式标志;Setting the mode flag to the user mode flag in response to a command to switch to the user mode; 响应于所述模式标志位被设置为用户模式标志,将所述设备切换为用户模式并且将所述开关电路切换为连接所述第一接口和所述第二接口。In response to the mode flag being set to a user mode flag, the device is switched to a user mode and the switching circuit is switched to connect the first interface and the second interface. 根据权利要求11所述的设备,其特征在于,所述处理器执行所述程序时还实现以下步骤:The device according to claim 11, wherein said processor further implements the following steps when said program is executed: 在所述设备启动时将开机标志位初始化为开机未完成标志,将模式标志位初始化为用户模式标志;其中,所述设备被配置为在所述开机标志位为开机未完成标志的状态下,禁止所述模式标志位被设置为工程模式标志;以及,Initializing the boot flag to the boot incomplete flag when the device is booting, initializing the mode flag to the user mode flag; wherein the device is configured to be in a state where the boot flag is the boot incomplete flag, The mode flag is prohibited from being set to the engineering mode flag; and, 在所述设备启动完成时,将所述开机标志位设置为开机完成标志。When the device startup is completed, the boot flag is set to a boot completion flag. 根据权利要求11或12所述的设备,其特征在于,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为USB接口;The device according to claim 11 or 12, wherein the switch circuit comprises a first switch circuit and a second switch circuit, and the first interface and the second interface are USB interfaces; 所述第一开关电路的第一端与所述第二接口的D+引脚连接,所述第二开关电路的第一端与所述第二接口的D-引脚连接;a first end of the first switch circuit is connected to a D+ pin of the second interface, and a first end of the second switch circuit is connected to a D- pin of the second interface; 所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;The switching the switching circuit to the debug interface connecting the second interface and the embedded processor comprises: switching a second end of the first switch circuit to be debugged with the embedded processor An output/input interface connection, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor; 所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的D+引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的D-引脚连接。The switching the switch circuit to connect the first interface and the second interface includes: switching a second end of the first switch circuit to be connected to a D+ pin of the first interface, The second end of the second switch circuit is switched to be connected to the D-pin of the first interface. 根据权利要求11或12所述的设备,其特征在于,所述开关电路包括第一开关电路和第二开关电路,所述第一接口和所述第二接口为音频输入接口;The device according to claim 11 or 12, wherein the switch circuit comprises a first switch circuit and a second switch circuit, and the first interface and the second interface are audio input interfaces; 所述第一开关电路的第一端与所述第二接口的左声道引脚连接,所述第二开关电路的第一端与所述第二接口的右声道引脚连接;a first end of the first switch circuit is connected to a left channel pin of the second interface, and a first end of the second switch circuit is connected to a right channel pin of the second interface; 所述将所述开关电路切换为连接所述第二接口和所述嵌入式处理器的调试接口,包括:将所述第一开关电路的第二端切换为与所述嵌入式处 理器的调试输出/输入接口连接,将所述第二开关电路的第二端切换为与所述嵌入式处理器的调试输入/输出接口连接;Switching the switch circuit to a debug interface connecting the second interface and the embedded processor, comprising: switching a second end of the first switch circuit to the embedded portion a debug output/input interface connection of the processor, switching a second end of the second switch circuit to be connected to a debug input/output interface of the embedded processor; 所述将所述开关电路切换为连接所述第一接口和所述第二接口,包括:将所述第一开关电路的第二端切换为与所述第一接口的左声道引脚连接,将所述第二开关电路的第二端切换为与所述第一接口的右声道引脚连接。Switching the switch circuit to connect the first interface and the second interface, comprising: switching a second end of the first switch circuit to be connected to a left channel pin of the first interface And switching the second end of the second switch circuit to be connected to the right channel pin of the first interface. 根据权利要求11-14任一项所述的设备,其特征在于,所述切换为工程模式的命令和/或所述切换为用户模式的命令是通过外部按键板输入至所述设备;或者,所述设备通过自身的红外接收器接收所述切换为工程模式的命令和/或所述切换为用户模式的命令;或者,所述切换为工程模式的命令和/或所述切换为用户模式的命令是特定形式的音频流,所述设备通过自身的音频输入接口接收所述切换为工程模式的命令和/所述或切换为用户模式的命令。 The device according to any one of claims 11 to 14, wherein the command to switch to the engineering mode and/or the command to switch to the user mode is input to the device through an external keypad; or Receiving, by the infrared receiver of the device, the command to switch to the engineering mode and/or the command to switch to the user mode; or the command to switch to the engineering mode and/or the switching to the user mode The command is a specific form of audio stream, and the device receives the command to switch to the engineering mode and/or the command to switch to the user mode through its own audio input interface.
PCT/CN2017/102761 2017-08-25 2017-09-21 METHOD FOR MODE SWITCHING AN INTEGRATED DEVICE AND INTEGRATED DEVICE Ceased WO2019037188A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710742556.1 2017-08-25
CN201710742556.1A CN107656513A (en) 2017-08-25 2017-08-25 The mode switching method and embedded device of embedded device

Publications (1)

Publication Number Publication Date
WO2019037188A1 true WO2019037188A1 (en) 2019-02-28

Family

ID=61128704

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/102761 Ceased WO2019037188A1 (en) 2017-08-25 2017-09-21 METHOD FOR MODE SWITCHING AN INTEGRATED DEVICE AND INTEGRATED DEVICE

Country Status (2)

Country Link
CN (1) CN107656513A (en)
WO (1) WO2019037188A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12291449B2 (en) 2020-05-27 2025-05-06 Sinosteel Nanjing Advanced Materials Research Institute Co., Ltd. Black phosphorus nanosheet, preparation method therefor, and application thereof

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI716767B (en) 2018-11-20 2021-01-21 和碩聯合科技股份有限公司 Data updating system, embedded electronic device and data updating method
CN112131160B (en) * 2020-09-27 2023-06-23 京东科技信息技术有限公司 Working mode switching circuit, working mode switching method and robot

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904829A (en) * 2005-07-29 2007-01-31 联想(北京)有限公司 Method and system for implementing multi-mode controlling mode switching
CN1979686A (en) * 2005-12-06 2007-06-13 上海华虹Nec电子有限公司 Safety detecting method for system integrated chip with built-in non-volatile memory
CN201611481U (en) * 2010-01-06 2010-10-20 浙江德景电子科技有限公司 Embedded device
CN102708001A (en) * 2012-04-26 2012-10-03 深圳市九思泰达技术有限公司 Linux embedded equipment and switching method between user mode and engineering mode

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7849466B2 (en) * 2005-07-12 2010-12-07 Qualcomm Incorporated Controlling execution mode of program threads by applying a mask to a control register in a multi-threaded processor
US20070214389A1 (en) * 2006-03-08 2007-09-13 Severson Matthew L JTAG power collapse debug
US8533530B2 (en) * 2006-11-15 2013-09-10 Qualcomm Incorporated Method and system for trusted/untrusted digital signal processor debugging operations
CN101893685B (en) * 2009-05-23 2013-12-25 深圳富泰宏精密工业有限公司 Debugging device
CN101577986B (en) * 2009-06-02 2011-05-25 中兴通讯股份有限公司 Mobile communication terminal
CN102158575A (en) * 2011-02-21 2011-08-17 深圳桑菲消费通信有限公司 Method for expanding USB (Universal Serial Bus) interface of mobile terminal into earphone interface
CN104244160A (en) * 2013-06-21 2014-12-24 鸿富锦精密工业(深圳)有限公司 Electronic device capable of being debugged through earphone port
CN104484592B (en) * 2014-12-31 2017-12-26 广州视源电子科技股份有限公司 Method and system for starting factory mode of mobile equipment
US9996449B2 (en) * 2015-03-27 2018-06-12 Intel Corporation Instruction and logic for a convertible innovation and debug engine
CN104991846B (en) * 2015-07-01 2018-03-02 上海斐讯数据通信技术有限公司 The switching system and method for a kind of working mode of mobile terminal
CN105141863A (en) * 2015-07-06 2015-12-09 Tcl海外电子(惠州)有限公司 Television production debugging method and television production debugging device
CN105898475A (en) * 2015-12-21 2016-08-24 乐视致新电子科技(天津)有限公司 Method for improving compatibility between intelligent TV and embedded multimedia card and intelligent TV
CN106227630B (en) * 2016-07-28 2020-06-19 上海庆科信息技术有限公司 Detection system for embedded wireless module
CN106101937B (en) * 2016-08-04 2019-09-17 广州视源电子科技股份有限公司 Speaker audio playback method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904829A (en) * 2005-07-29 2007-01-31 联想(北京)有限公司 Method and system for implementing multi-mode controlling mode switching
CN1979686A (en) * 2005-12-06 2007-06-13 上海华虹Nec电子有限公司 Safety detecting method for system integrated chip with built-in non-volatile memory
CN201611481U (en) * 2010-01-06 2010-10-20 浙江德景电子科技有限公司 Embedded device
CN102708001A (en) * 2012-04-26 2012-10-03 深圳市九思泰达技术有限公司 Linux embedded equipment and switching method between user mode and engineering mode

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12291449B2 (en) 2020-05-27 2025-05-06 Sinosteel Nanjing Advanced Materials Research Institute Co., Ltd. Black phosphorus nanosheet, preparation method therefor, and application thereof

Also Published As

Publication number Publication date
CN107656513A (en) 2018-02-02

Similar Documents

Publication Publication Date Title
CN104809010B (en) A kind of brush machine method and intelligent terminal
US9557791B2 (en) Computer device and method for converting working mode of universal serial bus connector of the computer device
CN106462188A (en) Power Management Contracts for Accessory Equipment
CN107924288A (en) Electronic equipment and its method for carrying out perform function using speech recognition
CN106959796A (en) Mobile terminal screen display method and device
CN104765466B (en) Key control method and device for mobile terminal
CN112114761A (en) Wireless screen projection control method and device, terminal equipment and readable storage medium
CN103793177A (en) Interface processing method of touch screen device and touch screen device
CN106126377B (en) System startup method and device
KR20150100476A (en) Secruity method for preventing theft and electronic device thereof
CN103761163A (en) Data loss preventing method and data loss preventing device
CN103715577B (en) A kind of USB Hub and the method carrying out Bluetooth pairing thereof
WO2019037188A1 (en) METHOD FOR MODE SWITCHING AN INTEGRATED DEVICE AND INTEGRATED DEVICE
CN106959754A (en) Method for controlling mobile terminal and mobile terminal
CN106095065A (en) A kind of mode switching method and device
CN114205364A (en) Data backup method and device
US20090210690A1 (en) Method of updating basic input output system and module and computer system implementing the same
CN106021027A (en) Terminal data processing method and system
WO2014067419A1 (en) Control method and input device of touchscreen terminal
CN101515236B (en) Basic input and output system recovery method and update module and computer system
US20170277917A1 (en) Method for operating soft keyboard, terminal and computer readable storage medium
CN101192111A (en) Mouse with screen saver control
CN107643900B (en) Display and upgrading method
CN113316057A (en) Earphone, method and device for reducing power consumption and electronic equipment
CN104954939B (en) Earphone power amplifier and control method thereof

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: 17922252

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: 17922252

Country of ref document: EP

Kind code of ref document: A1