CN105550005B - Method for debugging and upgrading through USB port - Google Patents

Method for debugging and upgrading through USB port Download PDF

Info

Publication number
CN105550005B
CN105550005B CN201610054204.2A CN201610054204A CN105550005B CN 105550005 B CN105550005 B CN 105550005B CN 201610054204 A CN201610054204 A CN 201610054204A CN 105550005 B CN105550005 B CN 105550005B
Authority
CN
China
Prior art keywords
debugging
upgrading
usb
program
target equipment
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.)
Active
Application number
CN201610054204.2A
Other languages
Chinese (zh)
Other versions
CN105550005A (en
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.)
Nanjing Qinheng Microelectronics Co ltd
Original Assignee
Nanjing Qinheng Microelectronics 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 Nanjing Qinheng Microelectronics Co ltd filed Critical Nanjing Qinheng Microelectronics Co ltd
Priority to CN201610054204.2A priority Critical patent/CN105550005B/en
Publication of CN105550005A publication Critical patent/CN105550005A/en
Application granted granted Critical
Publication of CN105550005B publication Critical patent/CN105550005B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

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

Abstract

The invention discloses a method for debugging and upgrading through a USB port, which comprises the following steps: a user starts the debugging and upgrading platform, starts the USB-Host functional unit in the debugging and upgrading platform and runs an ISP debugging and upgrading program; connecting the target equipment with a debugging and upgrading platform through a USB connecting Device, running a boot debugging and upgrading program after the target equipment is powered on, starting a USB-Device communication function, and not starting internal pull-up of the target equipment; a USB-Host functional unit in the debugging and upgrading platform monitors the connection action of target equipment through a trigger signal provided by a pull-up resistor in a USB connection device, and informs an ISP debugging and upgrading program, and the ISP debugging and upgrading program sends a debugging and upgrading command packet to the target equipment; and the target equipment enters a debugging and upgrading mode after receiving the debugging and upgrading command packet. When the user needs to debug and upgrade, the method can conveniently finish the debugging and upgrading operation of the target equipment only provided with the USB interface of the embedded system.

Description

Method for debugging and upgrading through USB port
The technical field is as follows:
the invention relates to a method for debugging and upgrading through a USB port.
Background art:
with the rapid development of electronic information technology, embedded systems are applied everywhere, and updating and upgrading of the embedded systems are not frequent but essential. The boot debug upgrade program (BootLoader) in the embedded system is mainly used for realizing the functions of remote upgrade, update and the like of the embedded system, the boot debug upgrade program (BootLoader) is firstly operated after the embedded system is powered on, and whether the debugging upgrade is carried out or not is judged according to some specific triggering conditions. Generally, the triggering method of the embedded system debugging upgrade includes: firstly, through an additional physical detection mode, such as key pressing, cold jumping and the like; secondly, monitoring the self-defined data packet in a limited time through a certain interface (a USB interface, a serial port and the like).
For the first mode, a manufacturer may need to leave an embedded system debugging and upgrading interface for receiving a physical trigger signal on an external package of an embedded system product, but this may affect the overall beauty of the embedded system product and cause hardware cost waste; if the interface is not reserved on the external package of the embedded system product, the product needs to be disassembled to perform debugging and upgrading, which is very inconvenient for users to use.
For the second mode, if the target device with the USB interface is connected to the computer, the BootLoader (BootLoader) running first in the target device may simulate a USB device, that is, a USB device is popped up on the computer, and the USB device is not desirable for the user who does not need to perform the debugging and upgrading. For example: when the target Device is a USB disk, a user-defined USB Device or an Unknown USB Device (Unknown Device) is popped up from the computer, and then a USB disk Device appears, which affects the use of the user who does not need to perform debugging and upgrading.
In summary, it is an urgent need to provide a method for debugging and upgrading through a USB port.
The invention content is as follows:
the present invention aims to provide a method for debugging and upgrading through a USB port in order to solve the above problems. When a user needs to debug and upgrade, the USB connecting device in the method is used for connection, so that the debugging and upgrading operation can be conveniently completed on target equipment only provided with an embedded system USB interface, the integral attractiveness of the target equipment is kept, and the hardware cost is saved. Under most conditions, users do not need to debug and upgrade, and the USB device is connected by using a common USB wire, so that the phenomenon of two times of USB devices does not exist.
The invention is realized by the following technical scheme:
a method for debugging and upgrading through a USB port, the method comprising: a user starts the debugging and upgrading platform, starts the USB-Host functional unit in the debugging and upgrading platform, runs an ISP debugging and upgrading program, and the debugging and upgrading platform is in an automatic monitoring mode; connecting target equipment with a debugging and upgrading platform through a USB connecting Device, wherein the USB connecting Device comprises a pull-up resistor for providing a connecting action signal for the debugging and upgrading platform, running a boot debugging and upgrading program (BootLoader) after the target equipment is powered on, starting a USB-Device communication function, and not starting the internal pull-up of the target equipment; a USB-Host functional unit in the debugging and upgrading platform monitors the connection action of target equipment through a trigger signal provided by a pull-up resistor in a USB connection device, and informs an ISP debugging and upgrading program, and the ISP debugging and upgrading program sends a debugging and upgrading command packet to the target equipment; and the target equipment enters a debugging and upgrading mode after receiving the debugging and upgrading command packet.
According to the method for debugging and upgrading through the USB port, the USB connecting device adopts a USB connecting line or a USB connector, and the USB connecting line or the USB connector comprises a pull-up resistor for providing a connecting action signal for a debugging and upgrading platform.
The method for debugging and upgrading through the USB port comprises the steps that the debugging and upgrading platform comprises a USB-Host communication functional unit and an ISP debugging and upgrading program;
the USB-Host functional unit is used for monitoring the connection action of the USB equipment and communicating with the target equipment;
the ISP debugging and upgrading program is used for communicating with a boot debugging and upgrading program (BootLoader) of the target equipment and sending a debugging and upgrading command packet.
The target Device comprises a USB-Device functional unit, a boot debugging upgrade program (BootLoader) and a user program (Application code);
the USB-Device functional unit is used for communicating with the debugging and upgrading platform;
the boot debugging upgrade program (BootLoader) is used for guiding target equipment to perform debugging upgrade and is a first program which runs after being electrified;
the user program (Application code) is an object program to be run by the user. And when the boot debugging upgrading program is quitted, the user program is operated. If the user does not perform debugging and upgrading, the common USB line connection is adopted, and the target device does not receive the debugging and upgrading command packet within a certain time, the target device can quit the guided debugging and upgrading program overtime, and the user program is operated.
Has the advantages that:
according to the method for debugging and upgrading through the USB port, when a user needs to debug and upgrade, the USB connecting device in the method is used for connection, so that the debugging and upgrading operation can be conveniently completed on the target equipment only provided with the USB interface of the embedded system, the integral attractiveness of the target equipment is kept, and the hardware cost is saved. Under most conditions, users do not need to debug and upgrade, and the USB device is connected by using a common USB wire, so that the phenomenon of two times of USB devices does not exist.
The specific implementation mode is as follows:
the following describes in detail specific embodiments of the present invention. Advantages and features of the present invention will become apparent from the following description, taken in conjunction with the appended claims.
In this embodiment, a method for performing debugging and upgrading through a USB port includes the following steps:
and the user starts the debugging and upgrading platform, starts the USB-Host functional unit in the debugging and upgrading platform, runs the ISP debugging and upgrading program, and at the moment, the debugging and upgrading platform is in an automatic monitoring mode. The debugging and upgrading platform can be on a computer or a mobile phone; connecting target equipment with a debugging and upgrading platform through an external USB connecting Device, wherein the USB connecting Device comprises a pull-up resistor for providing a connecting action signal for the debugging and upgrading platform, running a boot debugging and upgrading program (boot loader) after the target equipment is powered on, starting a USB-Device communication function, and not starting the internal pull-up of the target equipment; a USB-Host functional unit in the debugging and upgrading platform monitors the connection action of target equipment through a trigger signal provided by a pull-up resistor in a USB connection device, and informs an ISP debugging and upgrading program, and the ISP debugging and upgrading program sends a debugging and upgrading command packet to the target equipment; and the target equipment enters a debugging and upgrading mode after receiving the debugging and upgrading command packet.
In this embodiment, a method for performing debugging and upgrading through a USB port is provided, where the USB connection device uses a USB connection line or a USB connector, and the USB connection line or the USB connector includes a pull-up resistor for providing a connection action signal to a debugging and upgrading platform. According to the USB protocol, the upstream port of the USB device end is provided with a pull-up resistor of 1.5kohm, and if the pull-up resistor is connected to D +, the upstream port is a high-speed or full-speed device, and if the pull-up resistor is connected to D +, the upstream port is a low-speed device. The USB-Host port determines the connection and removal of the device and the type of the device by detecting the levels of two data lines in the physical line.
In the embodiment, the debugging and upgrading platform comprises a USB-Host functional unit and an ISP debugging and upgrading program; the USB-Host functional unit is used for monitoring the connection action of the USB equipment, when no equipment is connected, the D + and D-lines of the USB-Host port are both in low level, and when the USB-Device equipment is connected, the D + and D-have a stage of changing into a high level state after a transition time. If the device is a high-speed or full-speed device, the D + is pulled high, and the D-is unchanged; the opposite is true for low speed devices. When the USB-Host detects the signal, the device connection and the type of the device can be judged, and then the device is communicated with the target device; when the device is removed, either D + or D-has a phase that goes to a low state over a transition time. The ISP debugging and upgrading program is used for communicating with a boot debugging and upgrading program (BootLoader) of the target equipment and sending a debugging and upgrading command packet.
In the method for performing debugging and upgrading through a USB port in this embodiment, the target Device includes a USB-Device functional unit, a BootLoader (BootLoader), and a user program (Application code); the USB-Device functional unit is used for communicating with the debugging and upgrading platform; the boot debug upgrade program (BootLoader) is used for booting the target device to perform debug upgrade, and is the first program which runs after being electrified. The boot debug upgrade program (BootLoader) is a first section of code executed by the embedded system after power-on, whether to enter a debug upgrade mode is judged according to specific conditions, and if the boot debug upgrade program enters the debug upgrade mode, data transmitted from the USB interface is received for updating a user program (Application code); and if the debugging upgrading mode is not entered, exiting the boot debugging upgrading program to run the user program (Application code). The user program is a target program to be run by a user. And when the boot debugging upgrading program is quitted, the user program is operated. If the user does not perform debugging and upgrading, the common USB line connection is adopted, and the target device does not receive the debugging and upgrading command packet within a certain time, the target device can quit the guided debugging and upgrading program overtime, and the user program is operated.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (1)

1. A method for debugging and upgrading through a USB port is characterized by comprising the following steps: a user starts the debugging and upgrading platform, starts the USB-Host functional unit in the debugging and upgrading platform, runs an ISP debugging and upgrading program, and the debugging and upgrading platform is in an automatic monitoring mode; connecting target equipment with a debugging and upgrading platform through a USB connecting Device, wherein the USB connecting Device comprises a pull-up resistor for providing a connecting action signal for the debugging and upgrading platform, a first program which runs after the target equipment is powered on is a boot debugging and upgrading program, a USB-Device communication function is started, and the internal pull-up of the target equipment is not started; a USB-Host functional unit in the debugging and upgrading platform monitors the connection action of target equipment through a trigger signal provided by a pull-up resistor in a USB connection device, and informs an ISP debugging and upgrading program, and the ISP debugging and upgrading program sends a debugging and upgrading command packet to the target equipment; the target equipment enters a debugging and upgrading mode after receiving the debugging and upgrading command packet; if the user does not carry out debugging and upgrading, the common USB line connection is adopted, and the target equipment does not receive a debugging and upgrading command packet within a certain time, the target equipment exits the guided debugging and upgrading program overtime and runs the user program;
the USB connecting device adopts a USB connecting line or a USB connector, and the USB connecting line or the USB connector comprises a pull-up resistor for providing a connecting action signal for the debugging and upgrading platform;
the debugging and upgrading platform comprises a USB-Host functional unit and an ISP debugging and upgrading program;
the USB-Host functional unit is used for monitoring the connection action of the USB equipment and communicating with the target equipment;
the ISP debugging and upgrading program is used for communicating with a boot upgrading program of the target equipment and sending a debugging and upgrading command packet;
the target equipment comprises a USB-Device functional unit, a boot debugging upgrading program and a user program, and the target equipment comprises a USB interface;
the USB-Device functional unit is used for communicating with the debugging and upgrading platform;
the boot debugging and upgrading program is used for booting target equipment to carry out debugging and upgrading and is the first program which runs after being electrified;
the user program is a target program to be run by a user, and the user program can be run after the user exits the boot debugging upgrading program.
CN201610054204.2A 2016-01-27 2016-01-27 Method for debugging and upgrading through USB port Active CN105550005B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610054204.2A CN105550005B (en) 2016-01-27 2016-01-27 Method for debugging and upgrading through USB port

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610054204.2A CN105550005B (en) 2016-01-27 2016-01-27 Method for debugging and upgrading through USB port

Publications (2)

Publication Number Publication Date
CN105550005A CN105550005A (en) 2016-05-04
CN105550005B true CN105550005B (en) 2022-05-03

Family

ID=55829203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610054204.2A Active CN105550005B (en) 2016-01-27 2016-01-27 Method for debugging and upgrading through USB port

Country Status (1)

Country Link
CN (1) CN105550005B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107885650A (en) * 2016-09-30 2018-04-06 联芯科技有限公司 A kind of program debugging method and system
CN106406967A (en) * 2016-11-15 2017-02-15 恒鸿达信息技术有限公司 STM32-based USB online upgrade method and system
CN106843037B (en) * 2016-12-30 2019-04-12 硅谷数模半导体(北京)有限公司 The upgrade method and system of single-chip microcontroller
CN111240965A (en) * 2020-01-03 2020-06-05 珠海亿智电子科技有限公司 ISP real-time debugging method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070006035A1 (en) * 2003-08-28 2007-01-04 Kazou Usui Microcomputer and method for developing system program
CN101963910A (en) * 2010-09-21 2011-02-02 深圳市元征软件开发有限公司 General USB (Universal Serial Bus) based equipment firmware updating method
CN102169442A (en) * 2011-03-24 2011-08-31 杭州华三通信技术有限公司 Method, equipment, device and system for performing system boot by using USB (universal serial bus) device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309711A (en) * 2013-06-18 2013-09-18 天津七一二通信广播有限公司 Bootstrap loader circuit based on USB interface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070006035A1 (en) * 2003-08-28 2007-01-04 Kazou Usui Microcomputer and method for developing system program
CN101963910A (en) * 2010-09-21 2011-02-02 深圳市元征软件开发有限公司 General USB (Universal Serial Bus) based equipment firmware updating method
CN102169442A (en) * 2011-03-24 2011-08-31 杭州华三通信技术有限公司 Method, equipment, device and system for performing system boot by using USB (universal serial bus) device

Also Published As

Publication number Publication date
CN105550005A (en) 2016-05-04

Similar Documents

Publication Publication Date Title
CN105550005B (en) Method for debugging and upgrading through USB port
US8650332B2 (en) Method for switching working mode, USB device, and host device
KR100748554B1 (en) Universal serial bus host, universal serial bus system and method of driving the same
WO2020134634A1 (en) Program debugging method, program debugging apparatus, terminal device, and storage medium
WO2007083179A3 (en) A method for booting a host device from an mmc/sd device, a host device bootable from an mmc/sd device and an mmc/sd device method a host device may be booted from
CN104572564A (en) Method for realizing communication of Android mobile equipment and USB OTG (On-The-Go) host computer
CN105302750A (en) Interface function configuration method and electronic equipment
CN112835839A (en) PCIe interface device enumeration method, PCIe interface device enumeration apparatus, PCIe interface device and PCIe interface storage medium
US9418033B2 (en) Using USB signaling to trigger a device to enter a mode of operation
WO2017197900A1 (en) Usb switching method, device, and system
CN106406967A (en) STM32-based USB online upgrade method and system
CN101923480B (en) Method and device for starting terminal equipment
CN109344104A (en) Electronic equipment and method for transmitting signals
CN111142900A (en) Program updating method and device and terminal equipment
CN106681714A (en) Method and device for setting program environments and electronic equipment
CN111813596A (en) Chip restarting method and device and computing equipment
US20090275318A1 (en) Method and apparatus for transferring data between mobile telephones and other digital devices
US20140115378A1 (en) System and method for restoring network configuration parameters
US9824046B2 (en) Using USB signaling to trigger a device to enter a mode of operation
CN111610995B (en) Device firmware upgrading method and device, electronic device and storage medium
CN102193609B (en) Setting method for power supply locking and electronic device thereof
TW201220074A (en) Baseboard management controller recovery system and using method of the same
CN112579131A (en) Application program management method and device for multi-system equipment and electronic equipment
CN107589820B (en) Mobile terminal, current setting method thereof, and computer-readable storage medium
CN105446903A (en) Information processing method and electronic device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: No. 18 Ningshuang Road, Yuhuatai District, Nanjing City, Jiangsu Province, 210012

Applicant after: Nanjing qinheng Microelectronics Co.,Ltd.

Address before: No. 18 Ningshuang Road, Yuhuatai District, Nanjing City, Jiangsu Province, 210012

Applicant before: NANJING YI HUO TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant