[go: up one dir, main page]

WO2021155551A1 - Firmware download method for chip, and chip - Google Patents

Firmware download method for chip, and chip Download PDF

Info

Publication number
WO2021155551A1
WO2021155551A1 PCT/CN2020/074461 CN2020074461W WO2021155551A1 WO 2021155551 A1 WO2021155551 A1 WO 2021155551A1 CN 2020074461 W CN2020074461 W CN 2020074461W WO 2021155551 A1 WO2021155551 A1 WO 2021155551A1
Authority
WO
WIPO (PCT)
Prior art keywords
chip
communication device
emulator
download mode
download
Prior art date
Application number
PCT/CN2020/074461
Other languages
French (fr)
Chinese (zh)
Inventor
袁明武
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2020/074461 priority Critical patent/WO2021155551A1/en
Priority to CN202080001498.7A priority patent/CN111758088B/en
Publication of WO2021155551A1 publication Critical patent/WO2021155551A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means
    • 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/10Program control for peripheral devices
    • G06F13/105Program control for peripheral devices where the programme performs an input/output emulation function
    • G06F13/107Terminal emulation

Definitions

  • This application relates to the field of chips, and in particular to methods and chips for downloading firmware from chips.
  • This application provides a method and a chip for downloading firmware from a chip, which can save the number of IO interfaces in the chip and avoid waste.
  • a method for downloading firmware from a chip includes two IO interfaces configured to support a serial port download mode and an emulator download mode.
  • the method includes: determining whether the chip is Connect to the communication device through an emulator, and the emulator is used in the emulator download mode; according to whether the chip is connected to the communication device through the emulator, it is determined to adopt the serial port download mode or the emulation In the device download mode, the firmware of the application program is downloaded from the communication device.
  • two IO ports are set on the chip.
  • the SWD download mode and the ISP download mode can reuse the two IO ports, or in other words, the chip design adopts the SWD download mode.
  • the two IO ports SWCLK and SWDIO can be multiplexed into the RX and TX interfaces in the ISP download mode, so that when the chip is downloading firmware, it can automatically select the serial port download mode or the emulator download mode, that is, the chip only passes through two
  • a single IO port can support two download modes: serial port download mode and emulator download mode.
  • the determining to adopt the serial port download mode or the emulator download mode according to whether the chip is connected to the communication device through the emulator, Downloading the firmware of the application program from the communication device includes: if the chip is connected to the communication device through the emulator, determining to adopt the emulator download mode, and downloading the firmware from the communication device.
  • the downloading of the firmware from the communication device in the emulator download mode includes: detecting the status of the application program Startup information; if the detected startup information is wrong, download the firmware from the communication device through the emulator.
  • the method further includes: if the chip is connected to the communication device through the emulator, connecting all the chips to the communication device The two IO interfaces are respectively set as IO interfaces corresponding to the download mode of the emulator.
  • the determination to use the serial port download mode or the serial port download mode is performed according to whether the chip is connected to the communication device through the emulator or not.
  • the emulator download mode, downloading the firmware of the application program from the communication device includes: if the chip is not connected to the communication device through the emulator, determining to use the serial port download mode, and downloading from the communication device The firmware.
  • the downloading the firmware from the communication device in the serial port download mode includes: if the communication device is received The sent target command uses the serial port download mode according to the target command to download the firmware from the communication device, where the target command is used to indicate the serial port download mode.
  • the downloading the firmware from the communication device in the serial port download mode includes: if the communication is not received The target command sent by the device detects the startup information of the application program, where the target command is used to indicate the serial port download mode; if the detected startup information is wrong, the serial port download mode is used to download from the communication The device downloads the firmware.
  • the method further includes: if the chip is not connected to the communication device through the emulator, starting a timer; Before the timer expires, it is determined whether the target command is received.
  • the method before the downloading the firmware from the communication device in the serial port download mode, the method further includes: The two IO interfaces of the chip are respectively set as IO interfaces corresponding to the serial port download mode.
  • the method is applied after the chip is reset.
  • the chip includes a reset pin, and if the reset pin receives the receiving stream in the serial port board controlled by the communication device Control the low level output by the RTS pin, the chip is reset; and/or, if the reset pin receives the reset signal output by the reset pin of the emulator controlled by the communication device, the chip is reset .
  • the serial port download mode is an online system programming ISP download mode
  • the emulator download mode is a serial debugging SWD download mode
  • the IO interface corresponding to the ISP download mode includes a receiving RX interface and a transmitting TX interface.
  • the IO interface corresponding to the SWD download mode includes a serial data input and output SWDIO interface and a serial clock SWCLK interface.
  • a chip for executing the above-mentioned first aspect or the method in any possible implementation manner of the first aspect.
  • the chip includes a unit for executing the foregoing first aspect or any possible implementation of the first aspect.
  • a chip including: a storage unit and a processor, the storage unit is used to store instructions, the processor is used to execute the instructions stored in the memory, and when the processor executes the instructions stored in the memory, The execution causes the processor to execute the method in the first aspect or any possible implementation of the first aspect.
  • a computer-readable medium for storing a computer program, and the computer program includes instructions for executing the first aspect or any possible implementation of the first aspect.
  • a computer program product including instructions is provided.
  • the computer runs the instructions of the computer program product, the computer executes the chip in the first aspect or any possible implementation of the first aspect. Method of downloading firmware.
  • the computer program product may run on the chip of the second aspect described above.
  • Fig. 1 is a schematic flowchart of a method for downloading firmware from a chip according to an embodiment of the present application.
  • Fig. 2 is a schematic block diagram of a chip according to an embodiment of the present application.
  • Fig. 3 is another schematic block diagram of a chip according to an embodiment of the present application.
  • Fig. 4 is another schematic flowchart of a method for downloading firmware from a chip according to an embodiment of the present application.
  • Fig. 5 is a schematic diagram of the connection relationship between a chip and a communication device according to an embodiment of the present application.
  • Fig. 6 is a partial flowchart of a method for downloading firmware from a chip according to an embodiment of the present application.
  • Fig. 7 is another partial flowchart of a method for downloading firmware from a chip according to an embodiment of the present application.
  • Fig. 8 is a schematic flowchart of a communication device downloading firmware for a chip according to an embodiment of the present application.
  • Fig. 9 is another schematic block diagram of a chip according to an embodiment of the present application.
  • FIG. 1 shows a schematic flowchart of a method 100 for downloading firmware from a chip proposed in an embodiment of the present application.
  • the method 100 may be applied to a chip, for example, the chip may be a chip 200 as shown in FIG. 2.
  • the chip 200 includes two IO interfaces, namely the first interface 210 and the second interface 220 as shown in FIG.
  • the IO interface is configured to support serial port download mode and emulator download mode.
  • the chip 200 may be an MCU chip, or may be other types of chips.
  • the chip can be used in various devices, such as earphones, mobile phones, smart door locks and other terminal devices. This embodiment does not do this. limit.
  • the method 100 includes: S110, determining whether the chip is connected to the communication device through an emulator, and the emulator is used in the emulator download mode; S120, according to whether the chip is connected to the communication device through the emulator Connect, determine to use the serial port download mode or the emulator download mode, and download the firmware of the application program from the communication device.
  • the serial port download mode in the embodiment of the present application may refer to any serial port download mode.
  • this application mainly takes the serial port download mode as the ISP download mode as an example for description, but the embodiments of the present application are not limited to this.
  • the ISP download mode needs to be implemented by software.
  • the chip can integrate the corresponding ISP download program and its supporting tool.
  • the IO interface corresponding to this ISP download mode includes RX interface and TX interface.
  • the emulator download mode in the embodiment of the present application may refer to any emulator download mode.
  • this application is mainly described by taking the emulator as the Jlink emulator and the emulator download mode as the SWD download mode as an example, but the embodiment of the present application is not limited to this.
  • the SWD download mode uses a standard download protocol, which generally does not require software implementation. As long as the chip supports the SWD download mode, the Jlink download tool can be used to download normally.
  • the IO interface corresponding to the SWD download mode includes the SWDIO interface and the SWCLK interface.
  • two IO ports are set on the chip.
  • the SWD download mode and the ISP download mode can reuse the two IO ports, or in other words, the chip design adopts the SWD download mode.
  • the two IO ports of SWCLK and SWDIO can be multiplexed into two interfaces using RX and TX in ISP download mode. It can also be said that the two interfaces of RX and TX in ISP download mode in the chip can be multiplexed into SWD download mode.
  • SWCLK and SWDIO are two IOs, so that the chip can support two download modes: serial port download mode and emulator download mode through only two IO ports.
  • FIG. 4 shows a schematic flowchart of a method 300 for downloading firmware by another chip according to an embodiment of the present application.
  • the method 300 is a possible implementation of the method 100.
  • the method 300 shown in FIG. 4 will be combined with the method 300 below. 100 for detailed description.
  • the method 100 of the embodiment of the present application can be applied when downloading firmware for a chip. For example, if there is no firmware corresponding to a certain application in the chip, or the chip fails to start a certain application, the chip may need to download the firmware. Then, the method 100 of the embodiment of the present application can be executed. In addition, the method 100 of the embodiment of the present application may occur after the chip is reset, that is, after the chip is reset, enter a boot program to start downloading firmware, that is, start to execute the method 100.
  • the method 300 may include: S301, the startup procedure starts, that is, the chip enters the startup procedure for downloading firmware. For example, you can enter the startup program after the chip is reset.
  • the chip when the chip needs to download the firmware of one or more application programs from the communication device, or in other words, when the communication device needs to download the firmware of one or more application programs to the chip, the chip resets, for example, through The communication device control chip is reset.
  • the chip 200 shown in FIG. 2 may further include a reset pin 230 as shown in FIG. 3, and the reset pin 230 is used to reset the chip 200.
  • the communication device in the embodiments of the present application may refer to a personal computer or a personal computer (PC), or may also refer to other devices capable of downloading firmware for a chip.
  • PC personal computer
  • the communication device can control the chip to reset in a variety of ways.
  • the communication device can output a low level by controlling the Request To Send (RTS) pin in the serial board (serial board) to make the chip
  • RTS Request To Send
  • FIG. 5 shows a schematic diagram of the connection between the MCU and the PC in an embodiment of the present application. As shown in FIG. The boards are connected.
  • the PC may also include an ISP tool, which is used in the ISP download mode of the MCU, and the PC can be connected to the serial port board through a USB interface.
  • the serial board may include an RTS interface, and the reset pin of the MCU is connected to the RTS interface of the serial board.
  • the reset pin of the MCU detects the RTS interface output of the serial board Low level, so that the MCU resets and enters the boot program to start downloading the firmware, that is, the method 100 is executed.
  • the communication device can reset the chip by controlling the reset signal output by the reset pin of the emulator.
  • the chip in the embodiment of the present application is an MCU
  • the communication device is a PC
  • the PC and the MCU are connected through an emulator.
  • the emulator includes a reset pin, and the reset pin of the emulator is connected to the reset pin of the MCU.
  • the reset pin of the MCU can receive the reset signal, so that the MCU is reset, so that it enters the boot program to start downloading the firmware, that is, the method 100 is executed. .
  • the boot program entered by the chip in the embodiment of the present application may be a cold boot program.
  • the method 100 can also be applied to the cold boot program.
  • the method 300 may further include: S302, whether it is a cold boot, that is, determining whether the program started by the chip is cold boot, if not, continue to execute S303, if yes, continue to execute S304.
  • S303 perform a hot boot, that is, when the boot program started by the chip is not cold boot, for example, warm boot is started, then the warm boot program is executed, and no firmware download will be performed.
  • steps S302 and S303 may not be executed, and S301 may directly perform S304.
  • S301 may directly perform S304.
  • firmware download can be performed.
  • the way of executing firmware download in the cold boot program saves power consumption.
  • the method 100 of the embodiment of the present application may not be applied after the chip is reset, that is, the chip may also start to execute the method 100 under other circumstances to start downloading firmware.
  • the chip may also start to execute the method 100 under other circumstances to start downloading firmware.
  • the ISP download mode is used to download the firmware between the communication device and the chip
  • method 100 is usually executed after the chip is reset to start downloading the firmware
  • the SWD download mode is used to download the firmware between the communication device and the chip, in addition to the chip reset Afterwards, the method 100 is executed, and the method 100 may be executed in any case when the chip is not reset to download the firmware.
  • the method 300 may include: S304, whether an emulator is connected, for example, the emulator may be Jlink, that is, it is determined whether the chip is connected to the communication device through the Jlink emulator , So as to determine whether to use the serial port download mode or the emulator download mode to download the firmware of the application program from the communication device according to whether the chip is connected to the communication device through the Jlink emulator.
  • the emulator may be Jlink, that is, it is determined whether the chip is connected to the communication device through the Jlink emulator , So as to determine whether to use the serial port download mode or the emulator download mode to download the firmware of the application program from the communication device according to whether the chip is connected to the communication device through the Jlink emulator.
  • the chip is connected to the communication device through the emulator, you can continue to determine whether to use the emulator download mode for firmware download, for example, you can continue to execute S305 to download the firmware from the communication device; if the chip does not By connecting the emulator to the communication device, it can continue to determine whether to use another download mode to download the estimate, for example, continue to execute S308.
  • the startup information of the application can be detected first.
  • the method 300 includes: S305, detecting boot info. If the detected startup information is correct, continue to execute S306; if it is wrong, continue to execute S307.
  • the method 300 includes: S306, starting the application. That is, the firmware of the application program has been downloaded in the chip, so the chip can start the corresponding application program without downloading the firmware again, and repeated downloading of the firmware can also be avoided.
  • the emulator download mode can be used to download the firmware from the communication device.
  • the method 300 includes: S307, adopting the SWD download mode. It is connected with the communication device through an emulator, so the emulator download mode can be used for firmware download.
  • step S304 if the chip has been connected to the communication device through the emulator, there may be other processing methods besides performing the above steps S305-S307.
  • the application program can be directly started. If the application can be started successfully, it means that the firmware of the application has been downloaded in the chip, so the chip can start the corresponding application without downloading the firmware. However, if the application cannot be started successfully, or the startup fails, then the firmware download can be performed, and since the chip and the communication device are connected through an emulator, the emulator download mode can be used to download the firmware.
  • the emulator download mode is directly used to download the firmware.
  • the two IO interfaces of the chip can be set to the IO interfaces corresponding to the emulator download mode, for example, as shown in the figure
  • the first interface 210 and the second interface 220 of the chip 200 shown in 2 are set to the SWDIO interface and the SWCLK interface corresponding to the SWD download mode.
  • setting the two IO interfaces of the chip to the SWDIO interface and the SWCLK interface corresponding to the SWD download mode includes: setting relevant parameters of the interface and so on.
  • the emulator download mode can be executed directly through these two IO interfaces; but if the current two IO interfaces of the chip are For the IO interface corresponding to the serial download mode, you need to switch these two interfaces to the IO interface corresponding to the emulator download mode, and then execute the emulator download mode through these two IO interfaces.
  • the emulator download mode may not be used between the chip and the communication device, then other download modes can be used for estimated downloading, for example, the serial port mode can also be used for downloading.
  • Firmware download when the chip is not connected to the communication device through the emulator, it can be directly determined to use the serial port download mode for firmware download; or, it can also be determined whether to use the serial port according to whether a special command sent by the communication device is received.
  • the firmware download is performed in the download mode, where the special command is referred to as a target command in the embodiment of the present application, and the target command is used to indicate the serial port download mode.
  • the target command may be used to indicate the ISP download mode.
  • the serial port download mode is adopted to download the firmware from the communication device according to the target command; on the contrary, if the target command sent by the communication device is not received, the test can be passed.
  • the startup information of the application determines whether to use the serial port download mode to download the firmware from the communication device.
  • the method 300 includes: S308, start the timer, that is, start the timer when the chip and the communication device are not connected through the emulator; S309, whether the target command is received, that is, determine whether the Before the timer expires, the target command is received. If it is received, the execution of S310 is continued, and if it is not received, the execution of S311 is continued.
  • the duration of the timer can be set according to actual applications, and can be set to any value. Specifically, if the communication device and the chip need to download the firmware through the ISP download mode, as shown in Figure 5, when the communication device outputs a low level through the RTS interface of the serial board, it will also send the target command to the MUC chip For example, the communication device can continuously send the target command in a certain period to instruct the MCU to use the ISP download mode to download the firmware, then the duration of the timer should be greater than or equal to the period value.
  • the communication device can set the sending cycle of the target command to 10ms, and correspondingly, the duration of the timer is greater than the 10ms, for example, it can be set to 200ms, but the embodiment of the present application is not limited to this.
  • the method 300 includes: S310, using the ISP download mode, that is, if the target command is received before the timer expires, the chip determines that the serial port download mode can be used to download the firmware from the communication device.
  • the method 300 includes: S311, detecting boot information (boot info). If the detected startup information is correct, continue to execute S312; if it is wrong, continue to execute S313.
  • the method 300 includes: S312, starting the application, that is, the firmware of the application has been downloaded in the chip, so the The chip can start the corresponding application without downloading the firmware again, which can avoid repeated downloads of the firmware.
  • the serial download mode can be used to download the firmware from the communication device.
  • the method 300 includes: S313, using the ISP download mode, even if it is not received The target command can still use the ISP download mode to download the firmware.
  • the firmware download may not be performed when the startup information is detected incorrectly. At this time, the firmware download can be considered as a failure. To end the firmware download process.
  • step S309 if the chip does not receive the target command before the timer expires, in addition to performing the above steps S311-S313, there may be other processing methods.
  • the application can be directly started if the target command is not received. If the application can be started successfully, it means that the firmware of the application has been downloaded in the chip, so the chip can start the corresponding application without downloading the firmware. However, if you cannot start the application successfully, or fail to start, you can use the ISP download mode to perform the firmware download. At this time, the timer does not receive the target command, but you can still use the ISP download mode to download the firmware.
  • the two IO interfaces of the chip can be set to the IO interfaces corresponding to the serial download mode, for example, as shown in Figure 2.
  • the first interface 210 and the second interface 220 of the chip 200 shown are set to the TX interface and the RX interface corresponding to the ISP download mode.
  • setting the two IO interfaces of the chip to the TX interface and the RX interface corresponding to the ISP download mode may include: if the current first interface 210 and the second interface 220 are the SWDIO interface and the SWCLK interface corresponding to the SWD download mode, then it is required Switch the SWDIO interface and SWCLK interface corresponding to the SWD download mode to the TX interface and RX interface corresponding to the ISP download mode.
  • This switch can include: switch to the TX interface and RX interface related parameters in the ISP download mode, etc.
  • first interface 210 and second interface 220 are the TX interface and RX interface corresponding to the ISP download mode, then there is no need to switch, and the TX interface and RX interface corresponding to the ISP download mode are directly used to execute the ISP download mode Firmware download.
  • the method 100 may further include: in the case where it is determined not to use the ISP download mode, or after the firmware is downloaded in the ISP download mode, switching the two IO interfaces of the chip to the corresponding SWD download mode SWDIO interface and SWCLK interface.
  • two IO ports are set on the chip.
  • the SWD download mode and the ISP download mode can reuse the two IO ports, or in other words, the chip design adopts the SWD download mode.
  • the two IO ports SWCLK and SWDIO can be multiplexed into the RX and TX interfaces in the ISP download mode, so that when the chip is downloading firmware, it can automatically select the serial port download mode or the emulator download mode, that is, the chip only passes through two
  • a single IO port can support two download modes: serial port download mode and emulator download mode.
  • the method for downloading firmware from a chip according to an embodiment of the present application is described in detail above with reference to FIGS. 1 to 7 from the perspective of a chip.
  • the method for downloading firmware from a chip according to an embodiment of the present application will be described below in conjunction with FIG. 8 from the perspective of a communication device. method.
  • FIG. 8 shows a schematic flowchart of a method 400 for a communication device to download firmware for a chip according to an embodiment of the present application.
  • the communication device uses the ISP download mode as the chip to download firmware as an example for description, but the embodiment of the present application is not limited to this.
  • the communication device in the method 400 may include an ISP tool.
  • the communication device may be a PC as shown in FIG. 5, and the included ISP tool may be used to download firmware with the chip through an ISP.
  • the method 400 includes: S401, determining to use ISP to download the firmware, that is, the ISP tool in the communication device determines that the firmware download is to be performed, downloads the firmware of a certain application program for the chip, and continues to execute S402.
  • the method 400 includes: S402, RTS outputs a low level, that is, a communication device controls the RTS interface of a serial board connected to it to output a low level.
  • the communication device is a PC, and the PC can communicate with The serial port board is connected and controls the RTS interface of the serial port board to output low level.
  • the reset pin connected to the RTS interface of the serial board in the chip detects a low level, it will trigger the chip to reset, that is, the chip will start the boot program.
  • the chip can be used to execute the above method 100 or the above method 300 .
  • the method 400 includes: S403, sending a target command indicating the ISP download mode, that is, after the control chip resets, the communication device can send the target command to the chip, and the target command is used to indicate the ISP download mode for After the chip receives the target command, it selects the ISP download mode to download the firmware.
  • the communication device may send the target command multiple times.
  • the communication device may send the target command cyclically in a certain period, where the period may be set according to the actual application, for example, it may be set to 10ms, but this application The embodiment is not limited to this.
  • the method 400 includes: S404, whether a response to the target command is received, and the communication device waits for the chip to send a response to the target command after sending the target command one or more times, for example, waiting for the chip to send a response to the target command. Command to determine whether the response is received. If the communication device receives the response, it continues to execute S406, and if it does not receive the response, it corresponds to S405.
  • a timer can be set to determine whether a response to the target command is received before the timer expires.
  • the timer can be started when the target command is sent, or the timer can be started after sending the target command one or more times, or the timer can be started at a suitable time according to actual applications. If the response has not been received before the timer expires, it is determined that the response has not been received, and continues to execute S405; if the response is received before the timer expires, the timer can be stopped and continue to execute S406.
  • the duration of the timer can be set to any value according to actual applications, and the embodiment of the present application is not limited to this.
  • the method 400 includes: S405, the download fails. If the communication device does not receive a response to the target command sent by the chip, it is determined that the firmware download fails this time.
  • the method 400 includes: S406, sending firmware. If the communication device receives a response to the target command, the ISP download mode needs to be used to download the firmware between the chip and the communication device, and the communication device needs to send the firmware to the chip. Complete the firmware download, which corresponds to S407.
  • the method 400 includes: S407, the download is successful, that is, the communication device successfully downloads the firmware for the chip, and the current firmware download is completed.
  • the method 400 uses the communication device to select the ISP download mode as the chip to download the firmware.
  • the communication device selects the SWD download mode as the chip to download the firmware
  • a similar method can also be used.
  • firmware is downloaded between the communication device and the chip through SWD
  • the communication device and the chip are connected through an emulator, and the communication device can control the chip reset through the reset pin of the emulator. The chip resets and enters the boot program.
  • the chip is connected to the communication device through the emulator, according to the above method 100 and method 300, it can be known that the chip will automatically select the SWD download mode to download the firmware.
  • the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not correspond to the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • the chip 500 includes: a processing unit 510 and two IO interfaces 520, wherein the two IO interfaces 520 are configured to support a serial port download mode and an emulator download mode; the processing The unit 510 is used to determine whether the chip 500 is connected to the communication device through an emulator, and the emulator is used in the simulator download mode; according to whether the chip 500 is connected to the communication device through the emulator , Determining to use the serial port download mode or the emulator download mode to download the firmware of the application program from the communication device.
  • processing unit 510 may also be referred to as a processor.
  • the processing unit 510 is configured to: if the chip 500 is connected to the communication device through the emulator, determine to adopt the emulator download mode, and download all data from the communication device.
  • the firmware is configured to: if the chip 500 is connected to the communication device through the emulator, determine to adopt the emulator download mode, and download all data from the communication device. The firmware.
  • the processing unit 510 is configured to: detect startup information of the application program; if the detected startup information is wrong, download the firmware from the communication device through the emulator .
  • the processing unit 510 is configured to: if the chip 500 is connected to the communication device through the emulator, configure the two IO interfaces 520 of the chip 500 to be The IO interface corresponding to the download mode of the emulator is described.
  • the processing unit 510 is configured to: if the chip 500 is not connected to the communication device through the emulator, determine to use the serial port download mode, and download all data from the communication device.
  • the firmware is configured to: if the chip 500 is not connected to the communication device through the emulator, determine to use the serial port download mode, and download all data from the communication device. The firmware.
  • the processing unit 510 is configured to: if a target command sent by the communication device is received, use the serial port download mode according to the target command to download the communication device from the communication device. Firmware, wherein the target command is used to indicate the serial port download mode.
  • the processing unit 510 is configured to: if the target command sent by the communication device is not received, detect the startup information of the application program, where the target command is used to instruct the Serial port download mode; if the detected startup information is wrong, the serial port download mode is used to download the firmware from the communication device.
  • the processing unit 510 is further configured to: if the chip 500 is not connected to the communication device through the emulator, start a timer; before the timer expires, determine whether The target command is received.
  • the processing unit 510 before the processing unit 510 uses the serial port download mode to download the firmware from the communication device, the processing unit 510 is configured to: Each IO interface 520 is configured as an IO interface corresponding to the serial download mode.
  • the processing unit 510 downloads the firmware after the chip 500 is reset.
  • the chip 500 further includes a reset pin 530, if the reset pin 530 receives a low level output by the receiving flow control RTS pin in the communication device control serial port board , The chip 500 is reset; and/or, if the reset pin 530 receives a reset signal output by the reset pin of the emulator controlled by the communication device, the chip 500 is reset.
  • the serial port download mode is an online system programming ISP download mode
  • the emulator download mode is a serial debugging SWD download mode
  • the IO interface corresponding to the ISP download mode includes a receiving RX interface and a transmitting TX interface.
  • the IO interface corresponding to the SWD download mode includes a serial data input and output SWDIO interface and a serial clock SWCLK interface.
  • the chip 500 may correspond to the method 100 and the method 300 in the embodiment of the present application.
  • the chip 500 may be the chip 200 as shown in FIG.
  • the foregoing and other operations and/or functions are used to implement the corresponding processes of the chips in the respective methods in FIG. 1 to FIG. 8. For brevity, they will not be repeated here.
  • the chip of the embodiment of the application is provided with two IO ports.
  • the SWD download mode and the ISP download mode can multiplex the two IO ports, or in other words, two IOs of SWCLK and SWDIO in the SWD download mode are implemented in the chip design.
  • the port can be multiplexed into the RX and TX interfaces in the ISP download mode, so that when the chip is downloading firmware, it can automatically select the serial port download mode or the emulator download mode, that is, the chip can support only through two IO ports
  • the chip in the embodiment of the present application may also include a memory.
  • the processing unit can call and run a computer program from the memory to implement the method in the embodiment of the present application.
  • the memory can be a separate device independent of the processing unit, or can be integrated in the processing unit.
  • the processing unit or processor in the embodiment of the present application may be an integrated circuit chip with signal processing capability.
  • the steps of the foregoing method embodiments can be completed by hardware integrated logic circuits in the processor or instructions in the form of software.
  • the above-mentioned processor may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other Programming logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC application specific integrated circuit
  • FPGA Field Programmable Gate Array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache.
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • Enhanced SDRAM, ESDRAM Enhanced Synchronous Dynamic Random Access Memory
  • Synchronous Link Dynamic Random Access Memory Synchronous Link Dynamic Random Access Memory
  • DR RAM Direct Rambus RAM
  • the memory in the embodiment of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is to say, the memory in the embodiments of the present application is intended to include, but is not limited to, these and any other suitable types of memory.
  • the embodiments of the present application also provide a computer-readable storage medium for storing computer programs.
  • the computer-readable storage medium can be applied to the chip in the embodiment of the present application, and the computer program causes the computer to execute the corresponding process implemented by the chip in each method of the embodiment of the present application.
  • the computer program causes the computer to execute the corresponding process implemented by the chip in each method of the embodiment of the present application.
  • the computer program causes the computer to execute the corresponding process implemented by the chip in each method of the embodiment of the present application.
  • the embodiments of the present application also provide a computer program product, including computer program instructions.
  • the computer program product can be applied to the chip in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding process implemented by the chip in each method of the embodiment of the present application.
  • the computer program instructions cause the computer to execute the corresponding process implemented by the chip in each method of the embodiment of the present application.
  • details are not repeated here. .
  • the embodiment of the present application also provides a computer program.
  • the computer program can be applied to the chip in the embodiment of the present application.
  • the computer program runs on the computer, the computer can execute the corresponding process implemented by the chip in each method of the embodiment of the present application. For the sake of brevity, This will not be repeated here.
  • the disclosed system, device, and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • 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, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

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

Abstract

A firmware download method for a chip, and a chip. The chip (200, 500) comprises two IO interfaces (210, 220, 520), wherein the two IO interfaces (210, 220, 520) are configured to support a serial port download mode and an emulator download mode. The method comprises: determining whether a chip is connected to a communication device via an emulator, wherein the emulator is used for an emulator download mode (S110); and according to whether the chip is connected to the communication device via the emulator, determining whether to use a serial port download mode or the emulator download mode, and downloading firmware of an application program from the communication device (S120). By means of the firmware download method for a chip and the chip, the number of IO interfaces in the chip can be saved on, and waste is prevented.

Description

芯片下载固件的方法和芯片Method for downloading firmware from chip and chip 技术领域Technical field
本申请涉及芯片领域,尤其涉及芯片下载固件的方法和芯片。This application relates to the field of chips, and in particular to methods and chips for downloading firmware from chips.
背景技术Background technique
当前微控制单元(Microcontroller Unit,MCU)通过有线下载固件的方式基本有两种,一种是通过串口下载,例如在线系统编程(in-system programming,ISP)下载;另一种是通过仿真器下载,仿真器下载常用的接口包括串行调试(Serial Wire Debug,SWD)接口。这两种方式都需要MCU预留出2个输入/输出(In/Out,IO)口。At present, there are basically two ways of downloading firmware for Microcontroller Unit (MCU) through wired. One is downloading through serial port, such as online system programming (in-system programming, ISP) download; the other is downloading through emulator , Commonly used interfaces for emulator download include Serial Wire Debug (SWD) interface. Both of these two methods require the MCU to reserve 2 input/output (In/Out, IO) ports.
也就是说,如果开发者在自己产品想要支持上述两种烧录方式,就必须牺牲5个IO口,其中,2个IO口为SWD下载模式的串行时钟(Serial Wire clock,SWCLK)接口和串行数据IO(Serial Wire data IO,SWDIO)接口;还有2个IO口为ISP模式的接收(receive,RX)接口和发送(transport,TX)接口,另外还有一个IO接口用于不同下载模式之间的选择。在IO资源非常宝贵的MCU平台上,这种方式对IO资源是非常浪费的。In other words, if developers want to support the above two programming methods in their products, they must sacrifice 5 IO ports, of which 2 IO ports are serial clock (Serial Wire clock, SWCLK) interfaces in SWD download mode And serial data IO (Serial Wire data IO, SWDIO) interface; there are two IO ports for ISP mode receiving (receive, RX) interface and transmission (transport, TX) interface, there is also an IO interface for different Choose between download modes. On the MCU platform where IO resources are very precious, this method is very wasteful of IO resources.
发明内容Summary of the invention
本申请提供了一种芯片下载固件的方法和芯片,能够节省芯片中IO接口的数量,避免浪费。This application provides a method and a chip for downloading firmware from a chip, which can save the number of IO interfaces in the chip and avoid waste.
第一方面,提供了一种芯片下载固件的方法,所述芯片包括两个IO接口,所述两个IO接口配置为支持串口下载模式以及仿真器下载模式,该方法包括:确定所述芯片是否通过仿真器与所述通信设备连接,所述仿真器用于所述仿真器下载模式;根据所述芯片是否通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式或者所述仿真器下载模式,从所述通信设备下载应用程序的固件。In the first aspect, a method for downloading firmware from a chip is provided. The chip includes two IO interfaces configured to support a serial port download mode and an emulator download mode. The method includes: determining whether the chip is Connect to the communication device through an emulator, and the emulator is used in the emulator download mode; according to whether the chip is connected to the communication device through the emulator, it is determined to adopt the serial port download mode or the emulation In the device download mode, the firmware of the application program is downloaded from the communication device.
因此,本申请实施例的芯片下载固件的方法,在芯片上设置两个IO口,SWD下载模式和ISP下载模式可以复用这两个IO口,或者说,芯片设计中实现采用SWD下载模式的SWCLK与SWDIO两个IO口能够复用成采用ISP下载模式中的RX和TX两个接口,以使得芯片在进行固件下载时,可以自 动选择串口下载模式或者仿真器下载模式,即芯片仅通过两个IO口就可以支持串口下载模式和仿真器下载模式两种下载模式。Therefore, in the method for downloading firmware of the chip in the embodiment of the application, two IO ports are set on the chip. The SWD download mode and the ISP download mode can reuse the two IO ports, or in other words, the chip design adopts the SWD download mode. The two IO ports SWCLK and SWDIO can be multiplexed into the RX and TX interfaces in the ISP download mode, so that when the chip is downloading firmware, it can automatically select the serial port download mode or the emulator download mode, that is, the chip only passes through two A single IO port can support two download modes: serial port download mode and emulator download mode.
结合第一方面,在第一方面的一种实现方式中,所述根据所述芯片是否通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式或者所述仿真器下载模式,从所述通信设备下载应用程序的固件,包括:若所述芯片通过所述仿真器与所述通信设备连接,确定采用所述仿真器下载模式,从所述通信设备下载所述固件。With reference to the first aspect, in an implementation manner of the first aspect, the determining to adopt the serial port download mode or the emulator download mode according to whether the chip is connected to the communication device through the emulator, Downloading the firmware of the application program from the communication device includes: if the chip is connected to the communication device through the emulator, determining to adopt the emulator download mode, and downloading the firmware from the communication device.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述采用所述仿真器下载模式,从所述通信设备下载所述固件,包括:检测所述应用程序的启动信息;若检测的所述启动信息错误,通过所述仿真器,从所述通信设备下载所述固件。With reference to the first aspect and the foregoing implementation manners of the first aspect, in another implementation manner of the first aspect, the downloading of the firmware from the communication device in the emulator download mode includes: detecting the status of the application program Startup information; if the detected startup information is wrong, download the firmware from the communication device through the emulator.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述方法还包括:若所述芯片通过所述仿真器与所述通信设备连接,将所述芯片的所述两个IO接口分别设置为所述仿真器下载模式对应的IO接口。In combination with the first aspect and the foregoing implementation manners of the first aspect, in another implementation manner of the first aspect, the method further includes: if the chip is connected to the communication device through the emulator, connecting all the chips to the communication device The two IO interfaces are respectively set as IO interfaces corresponding to the download mode of the emulator.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述根据所述芯片是否通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式或者所述仿真器下载模式,从所述通信设备下载应用程序的固件,包括:若所述芯片未通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式,从所述通信设备下载所述固件。Combining the first aspect and the foregoing implementation manners thereof, in another implementation manner of the first aspect, the determination to use the serial port download mode or the serial port download mode is performed according to whether the chip is connected to the communication device through the emulator or not. The emulator download mode, downloading the firmware of the application program from the communication device, includes: if the chip is not connected to the communication device through the emulator, determining to use the serial port download mode, and downloading from the communication device The firmware.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述采用所述串口下载模式,从所述通信设备下载所述固件,包括:若接收到所述通信设备发送的目标命令,根据所述目标命令,采用所述串口下载模式,从所述通信设备下载所述固件,其中,所述目标命令用于指示所述串口下载模式。In combination with the first aspect and the foregoing implementation manners of the first aspect, in another implementation manner of the first aspect, the downloading the firmware from the communication device in the serial port download mode includes: if the communication device is received The sent target command uses the serial port download mode according to the target command to download the firmware from the communication device, where the target command is used to indicate the serial port download mode.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述采用所述串口下载模式,从所述通信设备下载所述固件,包括:若未接收到所述通信设备发送的目标命令,检测所述应用程序的启动信息,其中,所述目标命令用于指示所述串口下载模式;若检测的所述启动信息错误,采用所述串口下载模式,从所述通信设备下载所述固件。In combination with the first aspect and the foregoing implementation manners of the first aspect, in another implementation manner of the first aspect, the downloading the firmware from the communication device in the serial port download mode includes: if the communication is not received The target command sent by the device detects the startup information of the application program, where the target command is used to indicate the serial port download mode; if the detected startup information is wrong, the serial port download mode is used to download from the communication The device downloads the firmware.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述方法还包括:若所述芯片未通过所述仿真器与所述通信设备连接,启动定 时器;在所述定时器超时之前,确定是否接收到所述目标命令。With reference to the first aspect and the foregoing implementation manners thereof, in another implementation manner of the first aspect, the method further includes: if the chip is not connected to the communication device through the emulator, starting a timer; Before the timer expires, it is determined whether the target command is received.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,在所述采用所述串口下载模式,从所述通信设备下载所述固件之前,所述方法还包括:将所述芯片的所述两个IO接口分别设置为所述串口下载模式对应的IO接口。With reference to the first aspect and the foregoing implementation manners, in another implementation manner of the first aspect, before the downloading the firmware from the communication device in the serial port download mode, the method further includes: The two IO interfaces of the chip are respectively set as IO interfaces corresponding to the serial port download mode.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述方法应用于所述芯片发生复位后。In combination with the first aspect and the foregoing implementation manners, in another implementation manner of the first aspect, the method is applied after the chip is reset.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述芯片包括复位引脚,若所述复位引脚接收到由所述通信设备控制串口板中的接收流控RTS引脚输出的低电平,所述芯片复位;和/或,若所述复位引脚接收到由所述通信设备控制所述仿真器的复位引脚输出的复位信号,所述芯片复位。Combining the first aspect and the foregoing implementation manners thereof, in another implementation manner of the first aspect, the chip includes a reset pin, and if the reset pin receives the receiving stream in the serial port board controlled by the communication device Control the low level output by the RTS pin, the chip is reset; and/or, if the reset pin receives the reset signal output by the reset pin of the emulator controlled by the communication device, the chip is reset .
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述串口下载模式为在线系统编程ISP下载模式,所述仿真器下载模式为串行调试SWD下载模式。In combination with the first aspect and the foregoing implementation manners, in another implementation manner of the first aspect, the serial port download mode is an online system programming ISP download mode, and the emulator download mode is a serial debugging SWD download mode.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述ISP下载模式对应的IO接口包括接收RX接口和发送TX接口。In combination with the first aspect and the foregoing implementation manners thereof, in another implementation manner of the first aspect, the IO interface corresponding to the ISP download mode includes a receiving RX interface and a transmitting TX interface.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述SWD下载模式对应的IO接口包括串行数据输入输出SWDIO接口和串行时钟SWCLK接口。In combination with the first aspect and the foregoing implementation manners of the first aspect, in another implementation manner of the first aspect, the IO interface corresponding to the SWD download mode includes a serial data input and output SWDIO interface and a serial clock SWCLK interface.
第二方面,提供了一种芯片,用于执行上述第一方面或第一方面的任意可能的实现方式中的方法。具体地,该芯片包括用于执行上述第一方面或第一方面的任意可能的实现方式中的方法的单元。In a second aspect, a chip is provided for executing the above-mentioned first aspect or the method in any possible implementation manner of the first aspect. Specifically, the chip includes a unit for executing the foregoing first aspect or any possible implementation of the first aspect.
第三方面,提供了一种芯片,包括:存储单元和处理器,该存储单元用于存储指令,该处理器用于执行该存储器存储的指令,并且当该处理器执行该存储器存储的指令时,该执行使得该处理器执行第一方面或第一方面的任意可能的实现方式中的方法。In a third aspect, a chip is provided, including: a storage unit and a processor, the storage unit is used to store instructions, the processor is used to execute the instructions stored in the memory, and when the processor executes the instructions stored in the memory, The execution causes the processor to execute the method in the first aspect or any possible implementation of the first aspect.
第四方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。In a fourth aspect, a computer-readable medium is provided for storing a computer program, and the computer program includes instructions for executing the first aspect or any possible implementation of the first aspect.
第五方面,提供了一种包括指令的计算机程序产品,当计算机运行所述 计算机程序产品的所述指时,所述计算机执行上述第一方面或第一方面的任意可能的实现方式中的芯片下载固件的方法。具体地,该计算机程序产品可以运行于上述第二方面的芯片上。In a fifth aspect, a computer program product including instructions is provided. When the computer runs the instructions of the computer program product, the computer executes the chip in the first aspect or any possible implementation of the first aspect. Method of downloading firmware. Specifically, the computer program product may run on the chip of the second aspect described above.
附图说明Description of the drawings
图1是根据本申请实施例的芯片下载固件的方法的示意性流程图。Fig. 1 is a schematic flowchart of a method for downloading firmware from a chip according to an embodiment of the present application.
图2是根据本申请实施例的芯片的示意性框图。Fig. 2 is a schematic block diagram of a chip according to an embodiment of the present application.
图3是根据本申请实施例的芯片的另一示意性框图。Fig. 3 is another schematic block diagram of a chip according to an embodiment of the present application.
图4是根据本申请实施例的芯片下载固件的方法的另一示意性流程图。Fig. 4 is another schematic flowchart of a method for downloading firmware from a chip according to an embodiment of the present application.
图5是根据本申请实施例的芯片与通信设备之间的连接关系的示意图。Fig. 5 is a schematic diagram of the connection relationship between a chip and a communication device according to an embodiment of the present application.
图6是根据本申请实施例的芯片下载固件的方法的局部流程图。Fig. 6 is a partial flowchart of a method for downloading firmware from a chip according to an embodiment of the present application.
图7是根据本申请实施例的芯片下载固件的方法的另一局部流程图。Fig. 7 is another partial flowchart of a method for downloading firmware from a chip according to an embodiment of the present application.
图8是根据本申请实施例的通信设备为芯片下载固件的示意性流程图。Fig. 8 is a schematic flowchart of a communication device downloading firmware for a chip according to an embodiment of the present application.
图9是根据本申请实施例的芯片的另一示意性框图。Fig. 9 is another schematic block diagram of a chip according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
图1示出了本申请实施例提出的一种芯片下载固件的方法100的示意性流程图。该方法100可以应用于芯片中,例如,该芯片可以为如图2所示的芯片200。具体地,该芯片200包括有两个IO接口,即如图2所示的第一接口210和第二接口220,该芯片200支持串口下载模式以及仿真器下载模式,或者说芯片200的两个IO接口被配置为能够支持串口下载模式以及仿真器下载模式。例如,该芯片200可以为MCU芯片,或者,也可以为其他类型的芯片,该芯片可以用于各种设备中,例如耳机、手机、智能门锁等各种终端设备,本实施例对此不作限制。FIG. 1 shows a schematic flowchart of a method 100 for downloading firmware from a chip proposed in an embodiment of the present application. The method 100 may be applied to a chip, for example, the chip may be a chip 200 as shown in FIG. 2. Specifically, the chip 200 includes two IO interfaces, namely the first interface 210 and the second interface 220 as shown in FIG. The IO interface is configured to support serial port download mode and emulator download mode. For example, the chip 200 may be an MCU chip, or may be other types of chips. The chip can be used in various devices, such as earphones, mobile phones, smart door locks and other terminal devices. This embodiment does not do this. limit.
如图1所示,该方法100包括:S110,确定该芯片是否通过仿真器与该通信设备连接,该仿真器用于该仿真器下载模式;S120,根据该芯片是否通过该仿真器与该通信设备连接,确定采用该串口下载模式或者该仿真器下载模式,从该通信设备下载应用程序的固件。As shown in FIG. 1, the method 100 includes: S110, determining whether the chip is connected to the communication device through an emulator, and the emulator is used in the emulator download mode; S120, according to whether the chip is connected to the communication device through the emulator Connect, determine to use the serial port download mode or the emulator download mode, and download the firmware of the application program from the communication device.
应理解,本申请实施例中的串口下载模式可以指任意一种串口下载模式。例如,本申请主要以该串口下载模式为ISP下载模式为例进行描述,但 本申请实施例并不限于此。另外,ISP下载模式需要软件实现,例如,芯片如果支持ISP下载模式,该芯片中可以集成有对应的ISP下载程序,以及与之配套的工具端。该ISP下载模式对应的IO接口包括RX接口和TX接口。It should be understood that the serial port download mode in the embodiment of the present application may refer to any serial port download mode. For example, this application mainly takes the serial port download mode as the ISP download mode as an example for description, but the embodiments of the present application are not limited to this. In addition, the ISP download mode needs to be implemented by software. For example, if the chip supports the ISP download mode, the chip can integrate the corresponding ISP download program and its supporting tool. The IO interface corresponding to this ISP download mode includes RX interface and TX interface.
本申请实施例中的仿真器下载模式可以指任意一种仿真器下载模式。例如,本申请主要以仿真器为Jlink仿真器,仿真器下载模式为SWD下载模式为例进行描述,但本申请实施例并不限于此。另外,SWD下载模式采用一种标准的下载协议,一般不需要软件实现,只要芯片支持SWD下载模式,使用Jlink下载工具就能正常下载。该SWD下载模式对应的IO接口包括SWDIO接口和SWCLK接口。The emulator download mode in the embodiment of the present application may refer to any emulator download mode. For example, this application is mainly described by taking the emulator as the Jlink emulator and the emulator download mode as the SWD download mode as an example, but the embodiment of the present application is not limited to this. In addition, the SWD download mode uses a standard download protocol, which generally does not require software implementation. As long as the chip supports the SWD download mode, the Jlink download tool can be used to download normally. The IO interface corresponding to the SWD download mode includes the SWDIO interface and the SWCLK interface.
因此,本申请实施例的芯片下载固件的方法,在芯片上设置两个IO口,SWD下载模式和ISP下载模式可以复用这两个IO口,或者说,芯片设计中实现采用SWD下载模式的SWCLK与SWDIO两个IO口能够复用成采用ISP下载模式中的RX和TX两个接口,也可以说芯片中采用ISP下载模式中的RX和TX两个接口能够复用成采用SWD下载模式的SWCLK与SWDIO两个IO,以使得芯片仅通过两个IO口就可以支持串口下载模式和仿真器下载模式两种下载模式。Therefore, in the method for downloading firmware of the chip in the embodiment of the application, two IO ports are set on the chip. The SWD download mode and the ISP download mode can reuse the two IO ports, or in other words, the chip design adopts the SWD download mode. The two IO ports of SWCLK and SWDIO can be multiplexed into two interfaces using RX and TX in ISP download mode. It can also be said that the two interfaces of RX and TX in ISP download mode in the chip can be multiplexed into SWD download mode. SWCLK and SWDIO are two IOs, so that the chip can support two download modes: serial port download mode and emulator download mode through only two IO ports.
图4示出了本申请实施例的另一芯片下载固件的方法300的示意性流程图,该方法300为方法100的一种可能的实现方式,下面将结合图4所示的方法300对方法100进行详细描述。FIG. 4 shows a schematic flowchart of a method 300 for downloading firmware by another chip according to an embodiment of the present application. The method 300 is a possible implementation of the method 100. The method 300 shown in FIG. 4 will be combined with the method 300 below. 100 for detailed description.
应理解,本申请实施例的方法100可以应用于为芯片进行固件下载时,例如,若芯片中没有某个应用程序对应的固件,或者芯片启动某个应用程序失败,芯片可能需要下载该固件,则可以执行本申请实施例的方法100。另外,本申请实施例的方法100可以发生在芯片发生复位之后,即芯片复位后,进入启动(boot)程序,以开始下载固件,即开始执行方法100。例如,如图4所示,该方法300可以包括:S301,启动程序开始,即芯片进入下载固件的启动程序。例如,可以在芯片发生复位后,进入该启动程序。It should be understood that the method 100 of the embodiment of the present application can be applied when downloading firmware for a chip. For example, if there is no firmware corresponding to a certain application in the chip, or the chip fails to start a certain application, the chip may need to download the firmware. Then, the method 100 of the embodiment of the present application can be executed. In addition, the method 100 of the embodiment of the present application may occur after the chip is reset, that is, after the chip is reset, enter a boot program to start downloading firmware, that is, start to execute the method 100. For example, as shown in FIG. 4, the method 300 may include: S301, the startup procedure starts, that is, the chip enters the startup procedure for downloading firmware. For example, you can enter the startup program after the chip is reset.
具体地,在芯片需要从通信设备下载一个或者多个应用程序的固件的情况下,或者说,通信设备需要向芯片下载一个或者多个应用程序的固件的情况下,芯片发生复位,例如可以通过通信设备控制芯片发生复位。具体地,例如,如图3所示,图2所示的该芯片200还可以包括如图3所示的复位引脚230,该复位引脚230用于使得芯片200发生复位。Specifically, when the chip needs to download the firmware of one or more application programs from the communication device, or in other words, when the communication device needs to download the firmware of one or more application programs to the chip, the chip resets, for example, through The communication device control chip is reset. Specifically, for example, as shown in FIG. 3, the chip 200 shown in FIG. 2 may further include a reset pin 230 as shown in FIG. 3, and the reset pin 230 is used to reset the chip 200.
应理解,本申请实施例中的通信设备可以指个人计算机或者个人电脑(Personal Computer,PC),或者也可以指其他能够为芯片下载固件的设备。其中,个人电脑种类有很多,比如传统的台式电脑、笔记本电脑、平板电脑、一体机电脑、超级本、掌上电脑、嵌入式计算机等。It should be understood that the communication device in the embodiments of the present application may refer to a personal computer or a personal computer (PC), or may also refer to other devices capable of downloading firmware for a chip. Among them, there are many types of personal computers, such as traditional desktop computers, notebook computers, tablet computers, all-in-one computers, ultrabooks, handheld computers, and embedded computers.
可选地,通信设备可以通过多种方式控制芯片发生复位。例如,假设通信设备与芯片之间采用ISP下载模式下载固件,那么通信设备可以通过控制串口板(serial board)中的请求发送(Request To Send,RTS)引脚输出低电平,以使得该芯片中的复位引脚触发芯片复位。具体地,图5示出了本申请实施例中MCU与PC连接的示意图,如图5所示,这里假设本申请实施例的芯片为MCU,通信设备为PC,该MCU与PC之间通过串口板相连。PC中还可以包括ISP工具,该ISP工具用于MCU的ISP下载模式中,该PC可以通过USB接口与串口板相连。该串口板可以包括RTS接口,MCU的复位引脚与该串口板RTS接口相连,当PC通过USB接口控制串口板的RTS接口输出低电平时,MCU的复位引脚检测到串口板的RTS接口输出低电平,以使得MCU发生复位,从而进入启动(boot)程序,以开始下载固件,即开始执行方法100。Optionally, the communication device can control the chip to reset in a variety of ways. For example, assuming that the ISP download mode is used to download the firmware between the communication device and the chip, the communication device can output a low level by controlling the Request To Send (RTS) pin in the serial board (serial board) to make the chip The reset pin in triggers the chip reset. Specifically, FIG. 5 shows a schematic diagram of the connection between the MCU and the PC in an embodiment of the present application. As shown in FIG. The boards are connected. The PC may also include an ISP tool, which is used in the ISP download mode of the MCU, and the PC can be connected to the serial port board through a USB interface. The serial board may include an RTS interface, and the reset pin of the MCU is connected to the RTS interface of the serial board. When the PC controls the RTS interface of the serial board to output low level through the USB interface, the reset pin of the MCU detects the RTS interface output of the serial board Low level, so that the MCU resets and enters the boot program to start downloading the firmware, that is, the method 100 is executed.
再例如,假设通信设备与芯片之间采用SWD下载模式下载固件,那么通信设备可以通过控制仿真器的复位引脚输出的复位信号,以使得该芯片复位。具体地,同样假设本申请实施例的芯片为MCU,通信设备为PC,PC与MCU之间通过仿真器相连。仿真器包括复位引脚,并且该仿真器的复位引脚与MCU的复位引脚相连。当PC控制仿真器的复位引脚输出复位信号时,MCU的复位引脚可以接收到该复位信号,以使得MCU发生复位,从而进入启动(boot)程序,以开始下载固件,即开始执行方法100。For another example, assuming that the SWD download mode is used to download firmware between the communication device and the chip, the communication device can reset the chip by controlling the reset signal output by the reset pin of the emulator. Specifically, it is also assumed that the chip in the embodiment of the present application is an MCU, the communication device is a PC, and the PC and the MCU are connected through an emulator. The emulator includes a reset pin, and the reset pin of the emulator is connected to the reset pin of the MCU. When the PC controls the reset pin of the emulator to output a reset signal, the reset pin of the MCU can receive the reset signal, so that the MCU is reset, so that it enters the boot program to start downloading the firmware, that is, the method 100 is executed. .
可选地,本申请实施例中的芯片进入的启动程序可以为冷启动(cold boot)程序。具体地,由于通常在cold boot程序中才会进行固件下载,而热启动(warm boot)程序不会进行固件下载,所以方法100也可以应用于cold boot程序中。例如,如图4所示,该方法300还可以包括:S302,是否是冷启动,即确定芯片启动的程序是否为cold boot,若不是,则继续执行S303,若是,则继续执行S304。其中,如图4所示,S303,执行热启动,即在芯片启动的boot程序不是cold boot的情况下,例如,启动了warm boot,那么执行warm boot程序,也就不会进行固件下载。但本申请实施例并不限于此, 例如,也可以不执行步骤S302和S303,由S301直接进行S304,此时无论是cold boot程序还是warm boot程序,都可以进行固件下载。但是在cold boot程序中执行固件下载的方式,更节省功耗。Optionally, the boot program entered by the chip in the embodiment of the present application may be a cold boot program. Specifically, since the firmware download is usually performed in the cold boot program, and the firmware download is not performed in the warm boot program, the method 100 can also be applied to the cold boot program. For example, as shown in FIG. 4, the method 300 may further include: S302, whether it is a cold boot, that is, determining whether the program started by the chip is cold boot, if not, continue to execute S303, if yes, continue to execute S304. Among them, as shown in Figure 4, S303, perform a hot boot, that is, when the boot program started by the chip is not cold boot, for example, warm boot is started, then the warm boot program is executed, and no firmware download will be performed. However, the embodiment of the present application is not limited to this. For example, steps S302 and S303 may not be executed, and S301 may directly perform S304. At this time, whether it is a cold boot program or a warm boot program, firmware download can be performed. However, the way of executing firmware download in the cold boot program saves power consumption.
可选地,本申请实施例的方法100也可以不是应用于芯片发生复位之后,即芯片也可以在其它情况下开始执行方法100,以开始下载固件。例如,若通信设备与芯片之间采用ISP下载模式下载固件,通常在芯片复位之后执行方法100,以开始下载固件;若通信设备与芯片之间采用SWD下载模式下载固件,那么除了可以在芯片复位之后执行方法100,还可以在芯片没有发生复位的任何情况下,执行方法100,以进行固件下载。Optionally, the method 100 of the embodiment of the present application may not be applied after the chip is reset, that is, the chip may also start to execute the method 100 under other circumstances to start downloading firmware. For example, if the ISP download mode is used to download the firmware between the communication device and the chip, method 100 is usually executed after the chip is reset to start downloading the firmware; if the SWD download mode is used to download the firmware between the communication device and the chip, in addition to the chip reset Afterwards, the method 100 is executed, and the method 100 may be executed in any case when the chip is not reset to download the firmware.
对应于方法100中的S110,如图4所示,该方法300可以包括:S304,是否连接仿真器,例如,该仿真器可以为Jlink,即确定该芯片是否通过Jlink仿真器与该通信设备连接,以便于根据该芯片是否通过该Jlink仿真器与该通信设备连接,确定采用该串口下载模式或者该仿真器下载模式,从该通信设备下载应用程序的固件。Corresponding to S110 in the method 100, as shown in FIG. 4, the method 300 may include: S304, whether an emulator is connected, for example, the emulator may be Jlink, that is, it is determined whether the chip is connected to the communication device through the Jlink emulator , So as to determine whether to use the serial port download mode or the emulator download mode to download the firmware of the application program from the communication device according to whether the chip is connected to the communication device through the Jlink emulator.
可选地,若芯片通过该仿真器与该通信设备连接,则可以继续确定是否采用该仿真器下载模式进行固件下载,例如,可以继续执行S305,以从该通信设备下载该固件;若芯片没有通过该仿真器与该通信设备连接,则可以继续确定是否采用其它下载模式下载估计,例如可以继续执行S308。Optionally, if the chip is connected to the communication device through the emulator, you can continue to determine whether to use the emulator download mode for firmware download, for example, you can continue to execute S305 to download the firmware from the communication device; if the chip does not By connecting the emulator to the communication device, it can continue to determine whether to use another download mode to download the estimate, for example, continue to execute S308.
具体地,若该芯片通过该仿真器与该通信设备连接,可以先检测该应用程序的启动信息,例如,如图4所示,该方法300包括:S305,检测启动信息(boot info)。若检测的启动信息正确,继续执行S306;若错误,继续执行S307。Specifically, if the chip is connected to the communication device through the emulator, the startup information of the application can be detected first. For example, as shown in FIG. 4, the method 300 includes: S305, detecting boot info. If the detected startup information is correct, continue to execute S306; if it is wrong, continue to execute S307.
可选地,若检测的该启动信息正确,启动对应的应用程序,例如,如图4所示,该方法300包括:S306,启动应用程序。即芯片中已经下载有应用程序的固件,所以该芯片可以启动对应的应用程序,而无需再下载该固件,也可以避免固件的重复下载。Optionally, if the detected startup information is correct, the corresponding application is started. For example, as shown in FIG. 4, the method 300 includes: S306, starting the application. That is, the firmware of the application program has been downloaded in the chip, so the chip can start the corresponding application program without downloading the firmware again, and repeated downloading of the firmware can also be avoided.
相反的,若检测的该启动信息错误,那么可以采用该仿真器下载模式,从该通信设备下载该固件,例如,如图4所示,该方法300包括:S307,采用SWD下载模式,由于芯片与通信设备之间通过仿真器连接,所以可以采用仿真器下载模式进行固件下载。On the contrary, if the detected startup information is wrong, the emulator download mode can be used to download the firmware from the communication device. For example, as shown in FIG. 4, the method 300 includes: S307, adopting the SWD download mode. It is connected with the communication device through an emulator, so the emulator download mode can be used for firmware download.
可选地,在步骤S304之后,若该芯片已经通过该仿真器与该通信设备 连接,那么除了执行上述步骤S305-S307以外,还可以有其他处理方式。例如,如图6所示,对于步骤S304,在确定芯片已经通过该仿真器与该通信设备连接的情况下,可以直接启动应用程序。如果能够成功启动应用程序,则说明芯片中已经下载有应用程序的固件,所以该芯片可以启动对应的应用程序,而无需再下载该固件。但是,如果不能成功启动应用程序,或者说启动失败,那么可以执行固件下载,并且由于芯片与通信设备之间通过仿真器连接,所以可以采用仿真器下载模式进行固件下载。再例如,还可以在执行S304之后,若该芯片已经通过该仿真器与该通信设备连接,则直接采用仿真器下载模式进行固件下载。Optionally, after step S304, if the chip has been connected to the communication device through the emulator, there may be other processing methods besides performing the above steps S305-S307. For example, as shown in FIG. 6, for step S304, when it is determined that the chip has been connected to the communication device through the emulator, the application program can be directly started. If the application can be started successfully, it means that the firmware of the application has been downloaded in the chip, so the chip can start the corresponding application without downloading the firmware. However, if the application cannot be started successfully, or the startup fails, then the firmware download can be performed, and since the chip and the communication device are connected through an emulator, the emulator download mode can be used to download the firmware. For another example, after S304 is executed, if the chip has been connected to the communication device through the emulator, the emulator download mode is directly used to download the firmware.
应理解,无论上述哪一种情况,如果芯片确定采用仿真器下载模式进行固件下载,可以将该芯片的该两个IO接口分别设置为该仿真器下载模式对应的IO接口,例如,将如图2所示的芯片200的第一接口210和第二接口220设置为SWD下载模式对应的SWDIO接口和SWCLK接口。具体地,设置芯片的两个IO接口为SWD下载模式对应的SWDIO接口和SWCLK接口包括:设置接口的相关参数等。例如,如果当前该芯片的两个IO接口已经设置为该仿真器下载模式对应的IO接口,那么可以直接通过这两个IO接口执行仿真器下载模式;但如果当前该芯片的两个IO接口为串口下载模式对应的IO接口,那么需要将这两个接口切换为仿真器下载模式对应的IO接口,再通过这两个IO接口执行仿真器下载模式。It should be understood that, in either case, if the chip determines to use the emulator download mode for firmware download, the two IO interfaces of the chip can be set to the IO interfaces corresponding to the emulator download mode, for example, as shown in the figure The first interface 210 and the second interface 220 of the chip 200 shown in 2 are set to the SWDIO interface and the SWCLK interface corresponding to the SWD download mode. Specifically, setting the two IO interfaces of the chip to the SWDIO interface and the SWCLK interface corresponding to the SWD download mode includes: setting relevant parameters of the interface and so on. For example, if the current two IO interfaces of the chip have been set to the IO interface corresponding to the emulator download mode, then the emulator download mode can be executed directly through these two IO interfaces; but if the current two IO interfaces of the chip are For the IO interface corresponding to the serial download mode, you need to switch these two interfaces to the IO interface corresponding to the emulator download mode, and then execute the emulator download mode through these two IO interfaces.
可选地,若芯片没有通过该仿真器与该通信设备连接,即芯片与通信设备之间可以不使用仿真器下载模式,那么可以采用其它下载模式进行估计下载,例如,还可以使用串口模式进行固件下载。具体地,可以在芯片没有通过该仿真器与该通信设备连接的情况下,直接确定采用串口下载模式进行固件下载;或者,还可以根据是否接收到通信设备发送的特殊的命令,确定是否采用串口下载模式进行固件下载,其中,本申请实施例中将该特殊的命令称为目标命令,该目标命令用于指示串口下载模式,例如,该目标命令可以用于指示ISP下载模式。Optionally, if the chip is not connected to the communication device through the emulator, that is, the emulator download mode may not be used between the chip and the communication device, then other download modes can be used for estimated downloading, for example, the serial port mode can also be used for downloading. Firmware download. Specifically, when the chip is not connected to the communication device through the emulator, it can be directly determined to use the serial port download mode for firmware download; or, it can also be determined whether to use the serial port according to whether a special command sent by the communication device is received. The firmware download is performed in the download mode, where the special command is referred to as a target command in the embodiment of the present application, and the target command is used to indicate the serial port download mode. For example, the target command may be used to indicate the ISP download mode.
具体地,若接收到通信设备发送的目标命令,则根据该目标命令,采用串口下载模式,从该通信设备下载固件;相反的,若没有接收到该通信设备发送的目标命令,则可以通过检测应用程序的启动信息确定是否采用串口下载模式,从通信设备下载固件。Specifically, if the target command sent by the communication device is received, the serial port download mode is adopted to download the firmware from the communication device according to the target command; on the contrary, if the target command sent by the communication device is not received, the test can be passed The startup information of the application determines whether to use the serial port download mode to download the firmware from the communication device.
可选地,可以根据设置的预设时长,确定是否接收到该目标命令。例如,如图4所示,该方法300包括:S308,开启定时器,即在芯片与通信设备没有通过仿真器相连的情况下,开启定时器;S309,是否接收到目标命令,即确定是否在定时器超时之前,接收到了目标命令,如果接收到,则继续执行S310,如果没有接收到,则继续执行S311。Optionally, it may be determined whether the target command is received according to the preset time period set. For example, as shown in FIG. 4, the method 300 includes: S308, start the timer, that is, start the timer when the chip and the communication device are not connected through the emulator; S309, whether the target command is received, that is, determine whether the Before the timer expires, the target command is received. If it is received, the execution of S310 is continued, and if it is not received, the execution of S311 is continued.
应理解,定时器的时长可以根据实际应用进行设置,可以设置为任意一个值。具体地,若通信设备与芯片之间需要通过ISP下载模式进行固件下载,那么如图5所示,通信设备通过串口板的RTS接口输出低电平的情况下,还会向MUC芯片发送目标命令,例如,通信设备可以以一定周期持续发送目标命令,以指示MCU采用ISP下载模式进行固件下载,那么该定时器的时长应大于或者等于该周期值。例如,通信设备可以设置目标命令的发送周期为10ms,那么对应的,定时器的时长大于该10ms,例如,可以设置为200ms,但本申请实施例并不限于此。It should be understood that the duration of the timer can be set according to actual applications, and can be set to any value. Specifically, if the communication device and the chip need to download the firmware through the ISP download mode, as shown in Figure 5, when the communication device outputs a low level through the RTS interface of the serial board, it will also send the target command to the MUC chip For example, the communication device can continuously send the target command in a certain period to instruct the MCU to use the ISP download mode to download the firmware, then the duration of the timer should be greater than or equal to the period value. For example, the communication device can set the sending cycle of the target command to 10ms, and correspondingly, the duration of the timer is greater than the 10ms, for example, it can be set to 200ms, but the embodiment of the present application is not limited to this.
如图4所示,该方法300包括:S310,采用ISP下载模式,即如果在定时器超时之前,接收到目标命令,那么芯片确定可以采用串口下载模式,从通信设备下载固件。As shown in FIG. 4, the method 300 includes: S310, using the ISP download mode, that is, if the target command is received before the timer expires, the chip determines that the serial port download mode can be used to download the firmware from the communication device.
相反地,如图4所示,该方法300包括:S311,检测启动信息(boot info)。若检测的启动信息正确,继续执行S312;若错误,继续执行S313。On the contrary, as shown in FIG. 4, the method 300 includes: S311, detecting boot information (boot info). If the detected startup information is correct, continue to execute S312; if it is wrong, continue to execute S313.
可选地,若检测的该启动信息正确,启动对应的应用程序,例如,如图4所示,该方法300包括:S312,启动应用程序,即芯片中已经下载有应用程序的固件,所以该芯片可以启动对应的应用程序,而无需再下载该固件,这样可以避免固件的重复下载。Optionally, if the detected startup information is correct, the corresponding application is started. For example, as shown in FIG. 4, the method 300 includes: S312, starting the application, that is, the firmware of the application has been downloaded in the chip, so the The chip can start the corresponding application without downloading the firmware again, which can avoid repeated downloads of the firmware.
相反的,若检测的该启动信息错误,那么可以采用串口下载模式,从该通信设备下载该固件,例如,如图4所示,该方法300包括:S313,采用ISP下载模式,即使没有收到目标命令,仍然可以采用ISP的下载模式,进行固件下载。On the contrary, if the detected boot information is wrong, then the serial download mode can be used to download the firmware from the communication device. For example, as shown in Figure 4, the method 300 includes: S313, using the ISP download mode, even if it is not received The target command can still use the ISP download mode to download the firmware.
可选地,在S311之后,检测启动信息错误的情况下,除了执行如S313描述的采用ISP下载模式进行固件下载以外,也可以有其他处理方式。例如,考虑到此时并没有接收到目标命令,可能是无法采用ISP下载模式进行固件下载的情况,那么在检测启动信息错误的情况下,也可能无法执行固件下载,此时可以认为固件下载失败,即结束该固件下载过程。Optionally, after S311, in the case of detecting an error in the startup information, in addition to performing the firmware download in the ISP download mode as described in S313, there may also be other processing methods. For example, considering that the target command is not received at this time, it may be the case that the ISP download mode cannot be used to download the firmware, then the firmware download may not be performed when the startup information is detected incorrectly. At this time, the firmware download can be considered as a failure. To end the firmware download process.
可选地,在步骤S309之后,若该芯片没有在定时器超时之前接收到目标命令,那么除了执行上述步骤S311-S313以外,还可以有其他处理方式。例如,如图7所示,对于步骤S309,在定时器超时之前,没有接收到目标命令的情况下,可以直接启动应用程序。如果能够成功启动应用程序,则说明芯片中已经下载有应用程序的固件,所以该芯片可以启动对应的应用程序,而无需再下载该固件。但是,如果不能成功启动应用程序,或者说启动失败,那么可以采用ISP下载模式执行固件下载,此时,计时没有收到目标命令,但仍然可以采用ISP的下载模式,进行固件下载。Optionally, after step S309, if the chip does not receive the target command before the timer expires, in addition to performing the above steps S311-S313, there may be other processing methods. For example, as shown in FIG. 7, for step S309, before the timer expires, the application can be directly started if the target command is not received. If the application can be started successfully, it means that the firmware of the application has been downloaded in the chip, so the chip can start the corresponding application without downloading the firmware. However, if you cannot start the application successfully, or fail to start, you can use the ISP download mode to perform the firmware download. At this time, the timer does not receive the target command, but you can still use the ISP download mode to download the firmware.
应理解,无论上述哪一种情况,如果芯片确定采用串口下载模式进行固件下载,可以将该芯片的该两个IO接口分别设置为该串口下载模式对应的IO接口,例如,可以将如图2所示的芯片200的第一接口210和第二接口220设置为ISP下载模式对应的TX接口和RX接口。具体地,设置芯片的两个IO接口为ISP下载模式对应的TX接口和RX接口可以包括:若当前的第一接口210和第二接口220为SWD下载模式对应的SWDIO接口和SWCLK接口,那么需要将原本设置为SWD下载模式对应的SWDIO接口和SWCLK接口,切换为ISP下载模式对应的TX接口和RX接口,这种切换可以包括:切换至ISP下载模式下的TX接口和RX接口的相关参数等;相反的,若当前的第一接口210和第二接口220为ISP下载模式对应的TX接口和RX接口,那么无需切换,直接采用该ISP下载模式对应的TX接口和RX接口执行ISP下载模式下的固件下载。It should be understood that, in either of the above cases, if the chip determines to use the serial download mode for firmware download, the two IO interfaces of the chip can be set to the IO interfaces corresponding to the serial download mode, for example, as shown in Figure 2. The first interface 210 and the second interface 220 of the chip 200 shown are set to the TX interface and the RX interface corresponding to the ISP download mode. Specifically, setting the two IO interfaces of the chip to the TX interface and the RX interface corresponding to the ISP download mode may include: if the current first interface 210 and the second interface 220 are the SWDIO interface and the SWCLK interface corresponding to the SWD download mode, then it is required Switch the SWDIO interface and SWCLK interface corresponding to the SWD download mode to the TX interface and RX interface corresponding to the ISP download mode. This switch can include: switch to the TX interface and RX interface related parameters in the ISP download mode, etc. ; On the contrary, if the current first interface 210 and second interface 220 are the TX interface and RX interface corresponding to the ISP download mode, then there is no need to switch, and the TX interface and RX interface corresponding to the ISP download mode are directly used to execute the ISP download mode Firmware download.
可选地,该方法100还可以包括:在确定不采用ISP下载模式的情况下,或者在采用ISP下载模式下载固件完成之后,还可以将该芯片的两个IO接口切换为SWD下载模式对应的SWDIO接口和SWCLK接口。Optionally, the method 100 may further include: in the case where it is determined not to use the ISP download mode, or after the firmware is downloaded in the ISP download mode, switching the two IO interfaces of the chip to the corresponding SWD download mode SWDIO interface and SWCLK interface.
因此,本申请实施例的芯片下载固件的方法,在芯片上设置两个IO口,SWD下载模式和ISP下载模式可以复用这两个IO口,或者说,芯片设计中实现采用SWD下载模式的SWCLK与SWDIO两个IO口能够复用成采用ISP下载模式中的RX和TX两个接口,以使得芯片在进行固件下载时,可以自动选择串口下载模式或者仿真器下载模式,即芯片仅通过两个IO口就可以支持串口下载模式和仿真器下载模式两种下载模式。Therefore, in the method for downloading firmware of the chip in the embodiment of the application, two IO ports are set on the chip. The SWD download mode and the ISP download mode can reuse the two IO ports, or in other words, the chip design adopts the SWD download mode. The two IO ports SWCLK and SWDIO can be multiplexed into the RX and TX interfaces in the ISP download mode, so that when the chip is downloading firmware, it can automatically select the serial port download mode or the emulator download mode, that is, the chip only passes through two A single IO port can support two download modes: serial port download mode and emulator download mode.
上文中结合图1至图7,从芯片的角度详细描述了根据本申请实施例的芯片下载固件的方法,下面将结合图8,从通信设备的角度描述根据本申请 实施例的芯片下载固件的方法。The method for downloading firmware from a chip according to an embodiment of the present application is described in detail above with reference to FIGS. 1 to 7 from the perspective of a chip. The method for downloading firmware from a chip according to an embodiment of the present application will be described below in conjunction with FIG. 8 from the perspective of a communication device. method.
图8示出了本申请实施例的通信设备为芯片下载固件的方法400的示意性流程图。如图8所示,这里以通信设备采用ISP下载模式为芯片下载固件为例进行描述,但本申请实施例并不限于此。FIG. 8 shows a schematic flowchart of a method 400 for a communication device to download firmware for a chip according to an embodiment of the present application. As shown in FIG. 8, the communication device uses the ISP download mode as the chip to download firmware as an example for description, but the embodiment of the present application is not limited to this.
应理解,该方法400中的通信设备可以包括ISP工具,例如,该通信设备可以为如图5所示的PC,其包括的ISP工具可以用于与芯片之间通过ISP的方式下载固件。It should be understood that the communication device in the method 400 may include an ISP tool. For example, the communication device may be a PC as shown in FIG. 5, and the included ISP tool may be used to download firmware with the chip through an ISP.
如图8所示,该方法400包括:S401,确定采用ISP下载固件,即通信设备中的ISP工具确定要进行固件下载,为芯片下载某个应用程序的固件,并继续执行S402。As shown in FIG. 8, the method 400 includes: S401, determining to use ISP to download the firmware, that is, the ISP tool in the communication device determines that the firmware download is to be performed, downloads the firmware of a certain application program for the chip, and continues to execute S402.
如图8所示,该方法400包括:S402,RTS输出低电平,即通信设备控制与之连接的串口板的RTS接口输出低电平,例如,通信设备为PC,该PC可以通过USB与串口板相连,并控制串口板RTS接口输出低电平。这样,芯片中与串口板RTS接口相连的复位引脚检测低电平的情况下,会触发芯片发生复位,即芯片会开始boot程序,例如,该芯片可以用于执行上述方法100或上述方法300。As shown in FIG. 8, the method 400 includes: S402, RTS outputs a low level, that is, a communication device controls the RTS interface of a serial board connected to it to output a low level. For example, the communication device is a PC, and the PC can communicate with The serial port board is connected and controls the RTS interface of the serial port board to output low level. In this way, when the reset pin connected to the RTS interface of the serial board in the chip detects a low level, it will trigger the chip to reset, that is, the chip will start the boot program. For example, the chip can be used to execute the above method 100 or the above method 300 .
如图8所示,该方法400包括:S403,发送指示ISP下载模式的目标命令,即通信设备在控制芯片发生复位后,可以向芯片发送目标命令,该目标命令用于指示ISP下载模式,以便于芯片接收到该目标命令后,选择ISP下载模式进行固件下载。As shown in FIG. 8, the method 400 includes: S403, sending a target command indicating the ISP download mode, that is, after the control chip resets, the communication device can send the target command to the chip, and the target command is used to indicate the ISP download mode for After the chip receives the target command, it selects the ISP download mode to download the firmware.
可选地,通信设备可以多次发送该目标命令,例如,该通信设备可以以一定周期,循环发送该目标命令,其中,该周期可以根据实际应用设置,例如,可以设置为10ms,但本申请实施例并不限于此。Optionally, the communication device may send the target command multiple times. For example, the communication device may send the target command cyclically in a certain period, where the period may be set according to the actual application, for example, it may be set to 10ms, but this application The embodiment is not limited to this.
如图8所示,该方法400包括:S404,是否收到目标命令的响应,通信设备在发送一次或者多次目标命令后,等待芯片发送目标命令的响应,例如等待芯片发送响应于目标命令的命令,以确定是否接收到该响应。如果通信设备接收到该响应,则继续执行S406,若未接收到响应,则对应于S405。As shown in FIG. 8, the method 400 includes: S404, whether a response to the target command is received, and the communication device waits for the chip to send a response to the target command after sending the target command one or more times, for example, waiting for the chip to send a response to the target command. Command to determine whether the response is received. If the communication device receives the response, it continues to execute S406, and if it does not receive the response, it corresponds to S405.
可选地,可以通过设置定时器,确定在定时器超时之前,是否接收到目标命令的响应。例如,可以在发送目标命令时开启定时器,或者,也可以在发送一次或者多次目标命令之后,开启定时器,或者也可以根据实际应用,选择合适时间开启定时器。如果定时器超时之前一直没有接收到响应,则确 定没有接收到响应,并继续执行S405;若定时器超时之前收到响应,则可以停止定时器并继续执行S406。其中,定时器的时长可以根据实际应用,设置为任意一个数值,本申请实施例并不限于此。Optionally, a timer can be set to determine whether a response to the target command is received before the timer expires. For example, the timer can be started when the target command is sent, or the timer can be started after sending the target command one or more times, or the timer can be started at a suitable time according to actual applications. If the response has not been received before the timer expires, it is determined that the response has not been received, and continues to execute S405; if the response is received before the timer expires, the timer can be stopped and continue to execute S406. The duration of the timer can be set to any value according to actual applications, and the embodiment of the present application is not limited to this.
如图8所示,该方法400包括:S405,下载失败,如果通信设备没有接收到芯片发送的目标命令的响应,则确定本次固件下载失败。As shown in FIG. 8, the method 400 includes: S405, the download fails. If the communication device does not receive a response to the target command sent by the chip, it is determined that the firmware download fails this time.
如图8所示,该方法400包括:S406,发送固件,如果通信设备接收到目标命令的响应,则芯片与通信设备之间需要采用ISP下载模式下载固件,通信设备需要向芯片发送该固件,完成固件下载,即对应S407。As shown in FIG. 8, the method 400 includes: S406, sending firmware. If the communication device receives a response to the target command, the ISP download mode needs to be used to download the firmware between the chip and the communication device, and the communication device needs to send the firmware to the chip. Complete the firmware download, which corresponds to S407.
如图8所示,该方法400包括:S407,下载成功,即通信设备为芯片成功下载固件,完成本次的固件下载。As shown in FIG. 8, the method 400 includes: S407, the download is successful, that is, the communication device successfully downloads the firmware for the chip, and the current firmware download is completed.
应理解,该方法400以通信设备选择ISP下载模式为芯片下载固件,类似的,如果通信设备选择SWD下载模式为芯片下载固件,也可以采用与之类似的方式,为了简洁,在此不再赘述。例如,通信设备与芯片之间通过SWD的方式下载固件,则通信设备与芯片之间通过仿真器相连,通信设备可以通过仿真器的复位引脚控制芯片复位。芯片复位进入boot程序,在芯片通过仿真器与通信设备相连的情况下,根据上述方法100和方法300可知,芯片会自动选择SWD下载模式下载固件。It should be understood that the method 400 uses the communication device to select the ISP download mode as the chip to download the firmware. Similarly, if the communication device selects the SWD download mode as the chip to download the firmware, a similar method can also be used. . For example, if firmware is downloaded between the communication device and the chip through SWD, the communication device and the chip are connected through an emulator, and the communication device can control the chip reset through the reset pin of the emulator. The chip resets and enters the boot program. When the chip is connected to the communication device through the emulator, according to the above method 100 and method 300, it can be known that the chip will automatically select the SWD download mode to download the firmware.
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that in the various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not correspond to the embodiments of the present application. The implementation process constitutes any limitation.
上文中结合图1至图8,详细描述了根据本申请实施例的芯片下载固件的方法,下面将结合图9,描述根据本申请实施例的芯片。The method for downloading firmware of the chip according to the embodiment of the present application is described in detail above with reference to Figs. 1 to 8, and the chip according to the embodiment of the present application will be described below with reference to Fig. 9.
如图9所示,根据本申请实施例的芯片500包括:处理单元510和两个IO接口520,其中,所述两个IO接口520配置为支持串口下载模式以及仿真器下载模式;所述处理单元510用于:确定所述芯片500是否通过仿真器与所述通信设备连接,所述仿真器用于所述仿真器下载模式;根据所述芯片500是否通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式或者所述仿真器下载模式,从所述通信设备下载应用程序的固件。As shown in FIG. 9, the chip 500 according to the embodiment of the present application includes: a processing unit 510 and two IO interfaces 520, wherein the two IO interfaces 520 are configured to support a serial port download mode and an emulator download mode; the processing The unit 510 is used to determine whether the chip 500 is connected to the communication device through an emulator, and the emulator is used in the simulator download mode; according to whether the chip 500 is connected to the communication device through the emulator , Determining to use the serial port download mode or the emulator download mode to download the firmware of the application program from the communication device.
可选地,该处理单元510也可以称为处理器。Optionally, the processing unit 510 may also be referred to as a processor.
可选地,作为一个实施例,所述处理单元510用于:若所述芯片500通过所述仿真器与所述通信设备连接,确定采用所述仿真器下载模式,从所述 通信设备下载所述固件。Optionally, as an embodiment, the processing unit 510 is configured to: if the chip 500 is connected to the communication device through the emulator, determine to adopt the emulator download mode, and download all data from the communication device. The firmware.
可选地,作为一个实施例,所述处理单元510用于:检测所述应用程序的启动信息;若检测的所述启动信息错误,通过所述仿真器,从所述通信设备下载所述固件。Optionally, as an embodiment, the processing unit 510 is configured to: detect startup information of the application program; if the detected startup information is wrong, download the firmware from the communication device through the emulator .
可选地,作为一个实施例,所述处理单元510用于:若所述芯片500通过所述仿真器与所述通信设备连接,将所述芯片500的所述两个IO接口520配置为所述仿真器下载模式对应的IO接口。Optionally, as an embodiment, the processing unit 510 is configured to: if the chip 500 is connected to the communication device through the emulator, configure the two IO interfaces 520 of the chip 500 to be The IO interface corresponding to the download mode of the emulator is described.
可选地,作为一个实施例,所述处理单元510用于:若所述芯片500未通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式,从所述通信设备下载所述固件。Optionally, as an embodiment, the processing unit 510 is configured to: if the chip 500 is not connected to the communication device through the emulator, determine to use the serial port download mode, and download all data from the communication device. The firmware.
可选地,作为一个实施例,所述处理单元510用于:若接收到所述通信设备发送的目标命令,根据所述目标命令,采用所述串口下载模式,从所述通信设备下载所述固件,其中,所述目标命令用于指示所述串口下载模式。Optionally, as an embodiment, the processing unit 510 is configured to: if a target command sent by the communication device is received, use the serial port download mode according to the target command to download the communication device from the communication device. Firmware, wherein the target command is used to indicate the serial port download mode.
可选地,作为一个实施例,所述处理单元510用于:若未接收到所述通信设备发送的目标命令,检测所述应用程序的启动信息,其中,所述目标命令用于指示所述串口下载模式;若检测的所述启动信息错误,采用所述串口下载模式,从所述通信设备下载所述固件。Optionally, as an embodiment, the processing unit 510 is configured to: if the target command sent by the communication device is not received, detect the startup information of the application program, where the target command is used to instruct the Serial port download mode; if the detected startup information is wrong, the serial port download mode is used to download the firmware from the communication device.
可选地,作为一个实施例,所述处理单元510还用于:若所述芯片500未通过所述仿真器与所述通信设备连接,启动定时器;在所述定时器超时之前,确定是否接收到所述目标命令。Optionally, as an embodiment, the processing unit 510 is further configured to: if the chip 500 is not connected to the communication device through the emulator, start a timer; before the timer expires, determine whether The target command is received.
可选地,作为一个实施例,在所述处理单元510采用所述串口下载模式,从所述通信设备下载所述固件之前,所述处理单元510用于:将所述芯片500的所述两个IO接口520配置为所述串口下载模式对应的IO接口。Optionally, as an embodiment, before the processing unit 510 uses the serial port download mode to download the firmware from the communication device, the processing unit 510 is configured to: Each IO interface 520 is configured as an IO interface corresponding to the serial download mode.
可选地,作为一个实施例,所述处理单元510下载所述固件在所述芯片500发生复位后。Optionally, as an embodiment, the processing unit 510 downloads the firmware after the chip 500 is reset.
可选地,作为一个实施例,所述芯片500还包括复位引脚530,若所述复位引脚530接收到由所述通信设备控制串口板中的接收流控RTS引脚输出的低电平,所述芯片500复位;和/或,若所述复位引脚530接收到由所述通信设备控制所述仿真器的复位引脚输出的复位信号,所述芯片500复位。Optionally, as an embodiment, the chip 500 further includes a reset pin 530, if the reset pin 530 receives a low level output by the receiving flow control RTS pin in the communication device control serial port board , The chip 500 is reset; and/or, if the reset pin 530 receives a reset signal output by the reset pin of the emulator controlled by the communication device, the chip 500 is reset.
可选地,作为一个实施例,所述串口下载模式为在线系统编程ISP下载模式,所述仿真器下载模式为串行调试SWD下载模式。Optionally, as an embodiment, the serial port download mode is an online system programming ISP download mode, and the emulator download mode is a serial debugging SWD download mode.
可选地,作为一个实施例,所述ISP下载模式对应的IO接口包括接收RX接口和发送TX接口。Optionally, as an embodiment, the IO interface corresponding to the ISP download mode includes a receiving RX interface and a transmitting TX interface.
可选地,作为一个实施例,所述SWD下载模式对应的IO接口包括串行数据输入输出SWDIO接口和串行时钟SWCLK接口。Optionally, as an embodiment, the IO interface corresponding to the SWD download mode includes a serial data input and output SWDIO interface and a serial clock SWCLK interface.
应理解,根据本申请实施例的芯片500可对应于执行本申请实施例中的方法100和方法300,例如,该芯片500可以为如图2所示的芯片200,并且芯片500中的各个单元的上述和其它操作和/或功能分别为了实现图1至图8中的各个方法中芯片的相应流程,为了简洁,在此不再赘述。It should be understood that the chip 500 according to the embodiment of the present application may correspond to the method 100 and the method 300 in the embodiment of the present application. For example, the chip 500 may be the chip 200 as shown in FIG. The foregoing and other operations and/or functions are used to implement the corresponding processes of the chips in the respective methods in FIG. 1 to FIG. 8. For brevity, they will not be repeated here.
因此,本申请实施例的芯片,设置有两个IO口,SWD下载模式和ISP下载模式可以复用这两个IO口,或者说,芯片设计中实现采用SWD下载模式的SWCLK与SWDIO两个IO口能够复用成采用ISP下载模式中的RX和TX两个接口,以使得芯片在进行固件下载时,可以自动选择串口下载模式或者仿真器下载模式,即芯片仅通过两个IO口就可以支持串口下载模式和仿真器下载模式两种下载模式。Therefore, the chip of the embodiment of the application is provided with two IO ports. The SWD download mode and the ISP download mode can multiplex the two IO ports, or in other words, two IOs of SWCLK and SWDIO in the SWD download mode are implemented in the chip design. The port can be multiplexed into the RX and TX interfaces in the ISP download mode, so that when the chip is downloading firmware, it can automatically select the serial port download mode or the emulator download mode, that is, the chip can support only through two IO ports There are two download modes: serial port download mode and emulator download mode.
可选地,本申请实施例中的芯片还可以包括存储器。其中,处理单元可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。其中,存储器可以是独立于处理单元的一个单独的器件,也可以集成在处理单元中。Optionally, the chip in the embodiment of the present application may also include a memory. Wherein, the processing unit can call and run a computer program from the memory to implement the method in the embodiment of the present application. Among them, the memory can be a separate device independent of the processing unit, or can be integrated in the processing unit.
应理解,本申请实施例的处理单元或者说处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件 完成上述方法的步骤。It should be understood that the processing unit or processor in the embodiment of the present application may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method embodiments can be completed by hardware integrated logic circuits in the processor or instructions in the form of software. The above-mentioned processor may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other Programming logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. The volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), Synchronous Link Dynamic Random Access Memory (Synchlink DRAM, SLDRAM) ) And Direct Rambus RAM (DR RAM). It should be noted that the memories of the systems and methods described herein are intended to include, but are not limited to, these and any other suitable types of memories.
应理解,上述存储器为示例性但不是限制性说明,例如,本申请实施例中的存储器还可以是静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)以及直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)等等。也就是说,本申请实施例中的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be understood that the foregoing memory is exemplary but not restrictive. For example, the memory in the embodiment of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is to say, the memory in the embodiments of the present application is intended to include, but is not limited to, these and any other suitable types of memory.
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序。The embodiments of the present application also provide a computer-readable storage medium for storing computer programs.
可选的,该计算机可读存储介质可应用于本申请实施例中的芯片,并且该计算机程序使得计算机执行本申请实施例的各个方法中由芯片实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the chip in the embodiment of the present application, and the computer program causes the computer to execute the corresponding process implemented by the chip in each method of the embodiment of the present application. For the sake of brevity, it will not be omitted here. Go into details.
本申请实施例还提供了一种计算机程序产品,包括计算机程序指令。The embodiments of the present application also provide a computer program product, including computer program instructions.
可选的,该计算机程序产品可应用于本申请实施例中的芯片,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由芯片实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the chip in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding process implemented by the chip in each method of the embodiment of the present application. For brevity, details are not repeated here. .
本申请实施例还提供了一种计算机程序。The embodiment of the present application also provides a computer program.
可选的,该计算机程序可应用于本申请实施例中的芯片,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由芯片实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program can be applied to the chip in the embodiment of the present application. When the computer program runs on the computer, the computer can execute the corresponding process implemented by the chip in each method of the embodiment of the present application. For the sake of brevity, This will not be repeated here.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in the embodiments disclosed in this document can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of the description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiment, which is not repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。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, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请 的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Should be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (28)

  1. 一种芯片下载固件的方法,其特征在于,所述芯片包括两个IO接口,所述两个IO接口配置为支持串口下载模式以及仿真器下载模式,所述方法包括:A method for downloading firmware from a chip, characterized in that the chip includes two IO interfaces, the two IO interfaces are configured to support a serial port download mode and an emulator download mode, and the method includes:
    确定所述芯片是否通过仿真器与所述通信设备连接,所述仿真器用于所述仿真器下载模式;Determining whether the chip is connected to the communication device through an emulator, the emulator being used in the emulator download mode;
    根据所述芯片是否通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式或者所述仿真器下载模式,从所述通信设备下载应用程序的固件。According to whether the chip is connected to the communication device through the emulator, it is determined to adopt the serial port download mode or the emulator download mode to download the firmware of the application program from the communication device.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述芯片是否通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式或者所述仿真器下载模式,从所述通信设备下载应用程序的固件,包括:The method according to claim 1, wherein the determining to adopt the serial port download mode or the emulator download mode according to whether the chip is connected to the communication device through the emulator, from the The communication device downloads the firmware of the application, including:
    若所述芯片通过所述仿真器与所述通信设备连接,确定采用所述仿真器下载模式,从所述通信设备下载所述固件。If the chip is connected to the communication device through the emulator, it is determined to adopt the emulator download mode to download the firmware from the communication device.
  3. 根据权利要求2所述的方法,其特征在于,所述采用所述仿真器下载模式,从所述通信设备下载所述固件,包括:The method according to claim 2, wherein the downloading the firmware from the communication device in the emulator download mode comprises:
    检测所述应用程序的启动信息;Detecting the startup information of the application program;
    若检测的所述启动信息错误,通过所述仿真器,从所述通信设备下载所述固件。If the detected startup information is wrong, download the firmware from the communication device through the emulator.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    若所述芯片通过所述仿真器与所述通信设备连接,将所述芯片的所述两个IO接口分别设置为所述仿真器下载模式对应的IO接口。If the chip is connected to the communication device through the emulator, the two IO interfaces of the chip are respectively set to the IO interfaces corresponding to the download mode of the emulator.
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述芯片是否通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式或者所述仿真器下载模式,从所述通信设备下载应用程序的固件,包括:The method according to claim 1, wherein the determining to adopt the serial port download mode or the emulator download mode according to whether the chip is connected to the communication device through the emulator, from the The communication device downloads the firmware of the application, including:
    若所述芯片未通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式,从所述通信设备下载所述固件。If the chip is not connected to the communication device through the emulator, it is determined to adopt the serial port download mode to download the firmware from the communication device.
  6. 根据权利要求5所述的方法,其特征在于,所述采用所述串口下载模式,从所述通信设备下载所述固件,包括:The method according to claim 5, wherein the downloading the firmware from the communication device in the serial port download mode comprises:
    若接收到所述通信设备发送的目标命令,根据所述目标命令,采用所述串口下载模式,从所述通信设备下载所述固件,其中,所述目标命令用于指 示所述串口下载模式。If a target command sent by the communication device is received, according to the target command, the serial port download mode is adopted to download the firmware from the communication device, wherein the target command is used to indicate the serial port download mode.
  7. 根据权利要求5所述的方法,其特征在于,所述采用所述串口下载模式,从所述通信设备下载所述固件,包括:The method according to claim 5, wherein the downloading the firmware from the communication device in the serial port download mode comprises:
    若未接收到所述通信设备发送的目标命令,检测所述应用程序的启动信息,其中,所述目标命令用于指示所述串口下载模式;If the target command sent by the communication device is not received, detecting the startup information of the application program, where the target command is used to indicate the serial port download mode;
    若检测的所述启动信息错误,采用所述串口下载模式,从所述通信设备下载所述固件。If the detected startup information is wrong, the serial port download mode is adopted to download the firmware from the communication device.
  8. 根据权利要求6或7所述的方法,其特征在于,所述方法还包括:The method according to claim 6 or 7, wherein the method further comprises:
    若所述芯片未通过所述仿真器与所述通信设备连接,启动定时器;If the chip is not connected to the communication device through the emulator, start a timer;
    在所述定时器超时之前,确定是否接收到所述目标命令。Before the timer expires, it is determined whether the target command is received.
  9. 根据权利要求5至8中任一项所述的方法,其特征在于,在所述采用所述串口下载模式,从所述通信设备下载所述固件之前,所述方法还包括:The method according to any one of claims 5 to 8, characterized in that, before the downloading the firmware from the communication device in the serial port download mode, the method further comprises:
    将所述芯片的所述两个IO接口分别设置为所述串口下载模式对应的IO接口。The two IO interfaces of the chip are respectively set as the IO interfaces corresponding to the serial port download mode.
  10. 根据权利要求1至9中任一项所述的方法,其特征在于,所述方法应用于所述芯片发生复位后。The method according to any one of claims 1 to 9, wherein the method is applied after the chip is reset.
  11. 根据权利要求10所述的方法,其特征在于,所述芯片包括复位引脚,The method according to claim 10, wherein the chip includes a reset pin,
    若所述复位引脚接收到由所述通信设备控制串口板中的接收流控RTS引脚输出的低电平,所述芯片复位;和/或If the reset pin receives the low level output by the receiving flow control RTS pin in the communication device control serial port board, the chip is reset; and/or
    若所述复位引脚接收到由所述通信设备控制所述仿真器的复位引脚输出的复位信号,所述芯片复位。If the reset pin receives the reset signal output by the reset pin of the emulator controlled by the communication device, the chip is reset.
  12. 根据权利要求1至11中任一项所述的方法,其特征在于,所述串口下载模式为在线系统编程ISP下载模式,所述仿真器下载模式为串行调试SWD下载模式。The method according to any one of claims 1 to 11, wherein the serial port download mode is an online system programming ISP download mode, and the emulator download mode is a serial debugging SWD download mode.
  13. 根据权利要求12所述的方法,其特征在于,所述ISP下载模式对应的IO接口包括接收RX接口和发送TX接口。The method according to claim 12, wherein the IO interface corresponding to the ISP download mode includes a receiving RX interface and a transmitting TX interface.
  14. 根据权利要求12或13所述的方法,其特征在于,所述SWD下载模式对应的IO接口包括串行数据输入输出SWDIO接口和串行时钟SWCLK接口。The method according to claim 12 or 13, wherein the IO interface corresponding to the SWD download mode comprises a serial data input and output SWDIO interface and a serial clock SWCLK interface.
  15. 一种芯片,其特征在于,所述芯片包括两个IO接口和处理单元,A chip, characterized in that the chip includes two IO interfaces and a processing unit,
    所述两个IO接口配置为支持串口下载模式以及仿真器下载模式;The two IO interfaces are configured to support a serial port download mode and an emulator download mode;
    所述处理单元用于:The processing unit is used for:
    确定所述芯片是否通过仿真器与所述通信设备连接,所述仿真器用于所述仿真器下载模式;Determining whether the chip is connected to the communication device through an emulator, the emulator being used in the emulator download mode;
    根据所述芯片是否通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式或者所述仿真器下载模式,从所述通信设备下载应用程序的固件。According to whether the chip is connected to the communication device through the emulator, it is determined to adopt the serial port download mode or the emulator download mode to download the firmware of the application program from the communication device.
  16. 根据权利要求15所述的芯片,其特征在于,所述处理单元用于:The chip according to claim 15, wherein the processing unit is configured to:
    若所述芯片通过所述仿真器与所述通信设备连接,确定采用所述仿真器下载模式,从所述通信设备下载所述固件。If the chip is connected to the communication device through the emulator, it is determined to adopt the emulator download mode to download the firmware from the communication device.
  17. 根据权利要求16所述的芯片,其特征在于,所述处理单元用于:The chip according to claim 16, wherein the processing unit is configured to:
    检测所述应用程序的启动信息;Detecting the startup information of the application program;
    若检测的所述启动信息错误,通过所述仿真器,从所述通信设备下载所述固件。If the detected startup information is wrong, download the firmware from the communication device through the emulator.
  18. 根据权利要求17所述的芯片,其特征在于,所述处理单元用于:The chip according to claim 17, wherein the processing unit is configured to:
    若所述芯片通过所述仿真器与所述通信设备连接,将所述芯片的所述两个IO接口配置为所述仿真器下载模式对应的IO接口。If the chip is connected to the communication device through the emulator, the two IO interfaces of the chip are configured as IO interfaces corresponding to the download mode of the emulator.
  19. 根据权利要求15所述的芯片,其特征在于,所述处理单元用于:The chip according to claim 15, wherein the processing unit is configured to:
    若所述芯片未通过所述仿真器与所述通信设备连接,确定采用所述串口下载模式,从所述通信设备下载所述固件。If the chip is not connected to the communication device through the emulator, it is determined to adopt the serial port download mode to download the firmware from the communication device.
  20. 根据权利要求19所述的芯片,其特征在于,所述处理单元用于:The chip according to claim 19, wherein the processing unit is configured to:
    若接收到所述通信设备发送的目标命令,根据所述目标命令,采用所述串口下载模式,从所述通信设备下载所述固件,其中,所述目标命令用于指示所述串口下载模式。If a target command sent by the communication device is received, according to the target command, the serial port download mode is adopted to download the firmware from the communication device, wherein the target command is used to indicate the serial port download mode.
  21. 根据权利要求19所述的芯片,其特征在于,所述处理单元用于:The chip according to claim 19, wherein the processing unit is configured to:
    若未接收到所述通信设备发送的目标命令,检测所述应用程序的启动信息,其中,所述目标命令用于指示所述串口下载模式;If the target command sent by the communication device is not received, detecting the startup information of the application program, where the target command is used to indicate the serial port download mode;
    若检测的所述启动信息错误,采用所述串口下载模式,从所述通信设备下载所述固件。If the detected startup information is wrong, the serial port download mode is adopted to download the firmware from the communication device.
  22. 根据权利要求20或21所述的芯片,其特征在于,所述处理单元还用于:The chip according to claim 20 or 21, wherein the processing unit is further configured to:
    若所述芯片未通过所述仿真器与所述通信设备连接,启动定时器;If the chip is not connected to the communication device through the emulator, start a timer;
    在所述定时器超时之前,确定是否接收到所述目标命令。Before the timer expires, it is determined whether the target command is received.
  23. 根据权利要求19至22中任一项所述的芯片,其特征在于,在所述处理单元采用所述串口下载模式,从所述通信设备下载所述固件之前,所述处理单元用于:The chip according to any one of claims 19 to 22, wherein before the processing unit adopts the serial port download mode to download the firmware from the communication device, the processing unit is configured to:
    将所述芯片的所述两个IO接口配置为所述串口下载模式对应的IO接口。The two IO interfaces of the chip are configured as IO interfaces corresponding to the serial port download mode.
  24. 根据权利要求15至23中任一项所述的芯片,其特征在于,所述处理单元下载所述固件在所述芯片发生复位后。The chip according to any one of claims 15 to 23, wherein the processing unit downloads the firmware after the chip is reset.
  25. 根据权利要求24所述的芯片,其特征在于,所述芯片还包括复位引脚,The chip according to claim 24, wherein the chip further comprises a reset pin,
    若所述复位引脚接收到由所述通信设备控制串口板中的接收流控RTS引脚输出的低电平,所述芯片复位;和/或If the reset pin receives the low level output by the receiving flow control RTS pin in the communication device control serial port board, the chip is reset; and/or
    若所述复位引脚接收到由所述通信设备控制所述仿真器的复位引脚输出的复位信号,所述芯片复位。If the reset pin receives the reset signal output by the reset pin of the emulator controlled by the communication device, the chip is reset.
  26. 根据权利要求15至25中任一项所述的芯片,其特征在于,所述串口下载模式为在线系统编程ISP下载模式,所述仿真器下载模式为串行调试SWD下载模式。The chip according to any one of claims 15 to 25, wherein the serial port download mode is an online system programming ISP download mode, and the emulator download mode is a serial debugging SWD download mode.
  27. 根据权利要求26所述的芯片,其特征在于,所述ISP下载模式对应的IO接口包括接收RX接口和发送TX接口。The chip according to claim 26, wherein the IO interface corresponding to the ISP download mode includes a receiving RX interface and a transmitting TX interface.
  28. 根据权利要求26或27所述的芯片,其特征在于,所述SWD下载模式对应的IO接口包括串行数据输入输出SWDIO接口和串行时钟SWCLK接口。The chip according to claim 26 or 27, wherein the IO interface corresponding to the SWD download mode comprises a serial data input and output SWDIO interface and a serial clock SWCLK interface.
PCT/CN2020/074461 2020-02-07 2020-02-07 Firmware download method for chip, and chip WO2021155551A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/074461 WO2021155551A1 (en) 2020-02-07 2020-02-07 Firmware download method for chip, and chip
CN202080001498.7A CN111758088B (en) 2020-02-07 2020-02-07 Method for downloading firmware by chip and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/074461 WO2021155551A1 (en) 2020-02-07 2020-02-07 Firmware download method for chip, and chip

Publications (1)

Publication Number Publication Date
WO2021155551A1 true WO2021155551A1 (en) 2021-08-12

Family

ID=72712037

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/074461 WO2021155551A1 (en) 2020-02-07 2020-02-07 Firmware download method for chip, and chip

Country Status (2)

Country Link
CN (1) CN111758088B (en)
WO (1) WO2021155551A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805904A (en) * 2021-09-30 2021-12-17 北京维普无限智能技术有限公司 A machine and method for downloading programs in batches

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416376B (en) * 2020-11-20 2025-07-15 上海东软载波微电子有限公司 Chip burning method, burning equipment, chip and system
CN113760806B (en) * 2021-11-09 2022-02-15 南京沁恒微电子股份有限公司 Multi-mode virtual serial port chip, implementation method, firmware downloading system and method
CN117250483A (en) * 2023-11-17 2023-12-19 深圳市航顺芯片技术研发有限公司 Chip test system and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070028292A1 (en) * 2003-02-20 2007-02-01 Secure Systems Limited Bus bridge security system and method for computers
CN103778092A (en) * 2014-01-06 2014-05-07 建荣集成电路科技(珠海)有限公司 USB and SD interface multiplex circuit and multiplex method
CN107341111A (en) * 2017-09-08 2017-11-10 北京奥博泰科技有限公司 A kind of multi-functional embedded system development tools of USB interface
CN108363577A (en) * 2018-02-01 2018-08-03 四川泰瑞创通讯技术股份有限公司 The device of automatic classifying downloaded optical module firmware program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW490637B (en) * 2001-01-16 2002-06-11 Ind Tech Res Inst Memory emulator for simulating memory components of different interface specification and not restrained to memory space
CN106569416B (en) * 2016-10-28 2019-12-24 珠海格力电器股份有限公司 Method and device for multiplexing serial interface and simulation debugging interface of microcontroller

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070028292A1 (en) * 2003-02-20 2007-02-01 Secure Systems Limited Bus bridge security system and method for computers
CN103778092A (en) * 2014-01-06 2014-05-07 建荣集成电路科技(珠海)有限公司 USB and SD interface multiplex circuit and multiplex method
CN107341111A (en) * 2017-09-08 2017-11-10 北京奥博泰科技有限公司 A kind of multi-functional embedded system development tools of USB interface
CN108363577A (en) * 2018-02-01 2018-08-03 四川泰瑞创通讯技术股份有限公司 The device of automatic classifying downloaded optical module firmware program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805904A (en) * 2021-09-30 2021-12-17 北京维普无限智能技术有限公司 A machine and method for downloading programs in batches

Also Published As

Publication number Publication date
CN111758088A (en) 2020-10-09
CN111758088B (en) 2024-10-01

Similar Documents

Publication Publication Date Title
WO2021155551A1 (en) Firmware download method for chip, and chip
WO2018120213A1 (en) Firmware updating method and controller
KR101343714B1 (en) Shared nonvolatile memory architecture
CN100464282C (en) Method and device for controlling power-on sequence of distributed system
US9557791B2 (en) Computer device and method for converting working mode of universal serial bus connector of the computer device
CN103176816B (en) Manufacturing system and firmware burning method
CN111240753A (en) Loading method of bootstrap program, storage medium and embedded terminal
CN110459260B (en) Automatic test switching device, method and system
US20120117366A1 (en) Method for controlling multi-port network interface card
CN113709142B (en) Hot spot distribution network method and device, intelligent terminal and storage medium
WO2017121077A1 (en) Method and device for switching between two boot files
JP3762643B2 (en) Mobile terminal device, stored data update method, and firmware update method
CN101770434A (en) Method and system for switching different function units in PCI device
US10169281B2 (en) Switch system and operation method thereof
TWI591483B (en) Switch system
CN111400113B (en) Complete machine self-checking method, device and system of computer system
US10803008B2 (en) Flexible coupling of processor modules
KR102414206B1 (en) AUTOSAR standard application software component
TWI612424B (en) Switch system
WO2017075997A1 (en) Method and apparatus for starting android debug bridge, and terminal
CN106445571B (en) Mainboard and starting method
CN108231131B (en) eMMC test method and device
KR100706409B1 (en) Booting method of wide area CDM and CDM mobile terminal
CN112731875B (en) Target device control method and device, nonvolatile storage medium and processor
TWI757923B (en) Pre-boot execution environment determination system and 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: 20917966

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

Country of ref document: EP

Kind code of ref document: A1