CN116860302A - Program upgrading method, upper computer and computer readable storage medium - Google Patents

Program upgrading method, upper computer and computer readable storage medium Download PDF

Info

Publication number
CN116860302A
CN116860302A CN202310722414.4A CN202310722414A CN116860302A CN 116860302 A CN116860302 A CN 116860302A CN 202310722414 A CN202310722414 A CN 202310722414A CN 116860302 A CN116860302 A CN 116860302A
Authority
CN
China
Prior art keywords
upgrade
upgraded
driver
program
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310722414.4A
Other languages
Chinese (zh)
Inventor
庄国伟
付兴龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yankong Automation Technology Co ltd
Original Assignee
Shenzhen Yankong Automation Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yankong Automation Technology Co ltd filed Critical Shenzhen Yankong Automation Technology Co ltd
Priority to CN202310722414.4A priority Critical patent/CN116860302A/en
Publication of CN116860302A publication Critical patent/CN116860302A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention discloses a program upgrading method, an upper computer and a computer readable storage medium, wherein the program upgrading method comprises the following steps: after establishing connection with a driver to be upgraded, determining a storage address of a flash memory of the driver to be upgraded; controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address; after the driver to be upgraded completes data erasure of the flash memory, an upgrade file is sent to the driver to be upgraded based on the storage address; and controlling the upgrade driver to execute a preset program upgrade action based on the upgrade file. After the connection with the driver to be upgraded is established, the storage address of the flash memory is directly determined, the data of the flash memory is erased according to the storage address, and the upgrade file is sent to finish the upgrade of the program based on the upgrade file, so that the problem of simplifying the program upgrade step is solved.

Description

Program upgrading method, upper computer and computer readable storage medium
Technical Field
The present invention relates to the field of program upgrade, and in particular, to a program upgrade method, an upper computer, and a computer readable storage medium.
Background
The servo driver is an important component of modern motion control and is widely applied to automation equipment such as industrial robots, numerical control machining centers and the like. The servo driver is mostly loaded with an ARM (Advanced RISC Machine, advanced reduced instruction set machine) chip, and stores a control program based on the chip. In the process of on-site debugging and solving the problem of the client, the program may need to be modified for solving the problem of the client several times, so that a new program needs to be burnt in the ARM chip to update the program in the ARM chip.
In the related art, because the brands and the series of chips used by different series of servo drivers of the same servo manufacturer are different, when a new program is burnt on an ARM chip of the servo driver, an engineer is required to manually select the software corresponding to the chip according to the model of the ARM chip, and the model of the chip and the program to be burnt are configured in the software to be burnt. Most of the current burning mode steps need to be manually executed, so that the updating step of the program in the ARM chip is complicated.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The main objective of the present invention is to provide a program upgrading method, an upper computer and a computer readable storage medium, which solve the problem of simplifying the program upgrading steps.
In order to achieve the above object, the present invention provides a program upgrading method, the method comprising the steps of:
after establishing connection with a driver to be upgraded, determining a storage address of a flash memory of the driver to be upgraded;
controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address;
after the driver to be upgraded completes data erasure of the flash memory, an upgrade file is sent to the driver to be upgraded based on the storage address;
and controlling the upgrade driver to execute a preset program upgrade action based on the upgrade file.
Optionally, the host computer establishes a connection with the to-be-upgraded drive based on an external interface of the to-be-upgraded drive, and the step of determining the storage address of the flash memory of the to-be-upgraded drive after establishing the connection with the to-be-upgraded drive includes:
after establishing connection with an external interface of the driver to be upgraded, sending a chip parameter request to the driver to be upgraded;
Determining the chip model of the driver to be upgraded according to the response information of the driver to be upgraded, which is requested by the chip parameters;
and determining a storage address of the flash memory based on the chip model.
Optionally, before the step of sending the upgrade file to the drive to be upgraded based on the storage address after the drive to be upgraded completes data erasure of the flash memory, the method further includes:
and checking the received check data, and judging that the driver to be upgraded completes data erasure of the flash memory after the check is passed.
Optionally, the step of sending the upgrade file to the to-be-upgraded drive based on the storage address after the to-be-upgraded drive completes data erasure of the flash memory includes:
after the driver to be upgraded completes data erasure of the flash memory, determining a target byte when the upgrade file is sent;
and sending the upgrade file to the driver to be upgraded based on the target byte and the storage address.
Optionally, before the step of controlling the drive to be upgraded to perform the data erasing action of the flash memory based on the storage address, the method further includes:
Determining an operation mode of the driver to be upgraded;
when the driver to be upgraded is in an idle mode, an upgrade starting identification is sent to the driver to be upgraded, so that the driver to be upgraded enters an upgrade mode after receiving the upgrade identification;
and when the driver to be upgraded is in the upgrading mode, executing the step of controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address.
Optionally, the upgrade file includes upgrade data, and the step of controlling the upgrade driver to perform a preset program upgrade action based on the upgrade file includes:
controlling the driver to be upgraded to write the received upgrade data into a storage address where the data erasing action is completed;
when the data of the storage address read after the writing operation is completed is the same as the upgrading data, controlling the driver to be upgraded to send identification data to the upper computer; or alternatively
And when the data of the storage address read after the writing operation is finished is different from the upgrading data, judging that the upgrading data fails to be written or the upgrading data is wrongly written, and controlling the driver to be upgraded to stop receiving the upgrading file.
Optionally, after the step of determining the storage address of the flash memory of the drive to be upgraded after the connection is established with the drive to be upgraded, the method further includes:
acquiring an upgrade program;
compiling the upgrade program into the upgrade file based on a preset program compiler, wherein the upgrade file comprises the storage address and upgrade data, and the upgrade data comprises a communication protocol corresponding to the upgrade driver.
Optionally, after the step of controlling the upgrade driver to execute the preset program upgrade action based on the upgrade file, the method further includes:
outputting an upgrade result prompt interface when the upgrade failure of the drive to be upgraded is detected;
when a control action is received based on the upgrade result prompt interface, responding to the control action, and executing at least one of the following steps:
exiting the upgrade mode;
and skipping to execute the step of sending the upgrade file to the drive to be upgraded based on the storage address.
In addition, in order to achieve the above object, the present invention further includes a host computer including a memory, a processor, and a program upgrade program stored on the memory and executable on the processor, the program upgrade program implementing the steps of the program upgrade method as described above when executed by the processor.
In addition, to achieve the above object, the present invention further includes a computer-readable storage medium having stored thereon a program upgrade program which, when executed by a processor, implements the steps of the program upgrade method as described above.
The embodiment of the invention provides a program upgrading method, an upper computer and a computer readable storage medium, wherein after the upper computer is connected with a driver to be upgraded, a storage address of a flash memory of the driver to be upgraded is determined, then the driver to be upgraded is controlled to execute a data erasing action of the flash memory based on the storage address, after the driver to be upgraded finishes data erasing of the flash memory, an upgrading file is sent to the driver to be upgraded based on the storage address, and then the driver to be upgraded is controlled to execute a preset upgrading action based on the upgrading file so as to realize program upgrading. It can be seen that the storage address of the flash memory in the ARM chip of the driver to be upgraded can be determined by establishing connection with the driver to be upgraded, so that the data of the flash memory can be directly erased based on the storage address, an upgrade file is sent, and the driver to be upgraded is directly controlled to finish the upgrade of the program based on the upgrade file at last. In the process, program programming software associated with the ARM chip does not need to be selected, and corresponding chip parameters and models do not need to be configured in the programming software, so that the updating step of the program of the ARM chip is simplified, and the upgrading efficiency of the ARM chip is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a first embodiment of a program upgrade method according to the present invention;
FIG. 2 is a flow chart of a second embodiment of the program upgrading method of the present invention;
FIG. 3 is a flowchart illustrating a program upgrade method according to a third embodiment of the present invention;
FIG. 4 is a flowchart of a fourth embodiment of a program upgrade method according to the present invention;
FIG. 5 is a flowchart of an alternative implementation of the program upgrade method according to the present invention in which the host computer interacts with the driver to complete the program upgrade;
fig. 6 is a schematic diagram of a terminal hardware structure of various embodiments of the program upgrade method of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the related art, because the brands of chips used by different series of servo drivers of the same servo manufacturer are different, when a new program is burned into an ARM chip of the servo driver, an engineer is required to manually select the corresponding burning software of the chip according to the model of the ARM chip, and the model of the chip and the program to be burned are configured in the burning software. Most of the current burning mode steps need to be manually executed, so that the updating step of the program in the ARM chip is complicated. And when a large number of programs of ARM chips with different types are required to be burnt, the current burning mode has lower efficiency.
In order to solve the above-mentioned drawbacks, an embodiment of the present invention provides a program upgrade method, which mainly includes the following steps:
after establishing connection with a driver to be upgraded, determining a storage address of a flash memory of the driver to be upgraded;
controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address;
after the driver to be upgraded completes data erasure of the flash memory, an upgrade file is sent to the driver to be upgraded based on the storage address;
And controlling the upgrade driver to execute a preset program upgrade action based on the upgrade file.
According to the method, the storage address of the flash memory in the ARM chip of the driver to be upgraded can be determined by establishing connection with the driver to be upgraded, further, the data of the flash memory can be directly erased based on the storage address, the upgrade file is sent, and the like, the driver to be upgraded is directly controlled to finish the upgrade of the program based on the upgrade file at last, the upgrade software corresponding to the ARM chip is not required to be selected, the corresponding model is not required to be configured in the upgrade software, and the like, so that the upgrade step of the program is simplified.
In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Referring to fig. 1, fig. 1 is a flowchart illustrating a program upgrading method according to a first embodiment of the present invention.
The embodiment is applied to an upper computer, the upper computer refers to a program which is used for being in communication connection with a driver in calculation, data of the driver can be modified, and an online upgrading function can be provided for the driver. In this embodiment, the program upgrading method refers to that a new program is burned into a storage address corresponding to a flash (flash memory) in an ARM chip of a servo driver through an upper computer, and the burning mode is to replace original data with new burned data, and the replacement process can be completely replaced or partially replaced, so that the program is updated and upgraded.
In this embodiment, the program upgrading method includes the following steps:
step S10, after establishing connection with a driver to be upgraded, determining a storage address of a flash memory of the driver to be upgraded;
in this embodiment, the driver to be upgraded refers to a driver to which an ARM chip that needs to burn a new program belongs, for example, a stepper motor driver, a servo driver, etc. of a robot. The response information may include parameter information of the ARN chip or current state information of the drive to be upgraded. The flash memory refers to flash in an ARM chip of a driver to be upgraded, and a control program of the ARM chip is stored. It can be understood that the memory addresses of the flash memories corresponding to different types of ARM chips are different, for example, in the ARM chip of manufacturer a, the memory addresses include 100-1000, in the ARM chip of manufacturer b, the memory addresses include 200-1000, and in the ARM chip of different types of ARM of the same manufacturer, there may be a difference in the memory addresses, so that the memory addresses of the flash memories need to be learned when updating the control program of the flash memories in the ARM chip.
Specifically, after the upper computer can be vertically connected with the servo driver, the storage address corresponding to the flash memory is set in the driver program, and based on the upper computer, the storage address of the flash memory can be directly determined after the upper computer establishes connection with the servo driver.
Optionally, after step S10, the method further includes: and acquiring an upgrade program, and compiling the upgrade program into the upgrade file based on a preset program compiler, wherein the upgrade file comprises the storage address and upgrade data, and the upgrade data comprises a communication protocol corresponding to the upgrade driver. Specifically, the upgrade program is a program that needs to be updated to a storage address, and the upgrade file refers to a Hex file, where the Hex file includes an address to be written of the upgrade program, that is, the storage address, and data to be written, that is, data that needs to be updated and burned into the storage address.
It should be noted that, when the upper computer is connected with the driver to be upgraded, the driver to be upgraded is in a start-up state.
Step S20, controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address;
in this embodiment, the data erasing action refers to deleting original data of the storage address in the flash memory, so that the program can update and burn in the drive. Before that, it is required to determine that the current state information of the to-be-upgraded drive is in an idle state (also called a non-enabled running state), and then control the to-be-upgraded drive to execute a corresponding control action (burning action) based on the state information. That is, before step S20, the method further includes:
Step S21, determining an operation mode of the driver to be upgraded;
step S22, when the driver to be upgraded is in an idle mode, an upgrade starting identification is sent to the driver to be upgraded, so that the driver to be upgraded enters an upgrade mode after receiving the upgrade identification;
step S23 is to execute the step of controlling the drive to be upgraded to execute the data erasing action of the flash memory based on the storage address when the drive to be upgraded is in the upgrade mode.
Specifically, the state information of the servo driver includes an idle state, an upgrade state (also referred to as a writing state), and an enabling operation state, and the corresponding operation modes are an idle mode, an upgrade mode (also referred to as a writing mode), and an enabling operation mode. Based on the method, the current operation mode of the servo driver can be determined according to the state information of the servo driver, so that the upper computer can be ensured to control the servo driver to execute data erasing action. Therefore, after the upper computer is connected with the servo driver, the upper computer sends a state information request to the servo driver, determines the current operation mode of the servo driver after receiving the state information fed back by the servo driver, if the current operation mode is an idle mode, the upper computer sends an upgrade starting identification to the servo driver so that the servo driver enters an upgrade mode after receiving the upgrade starting identification, and if the current operation mode is the upgrade mode, the servo driver is directly controlled to execute the data erasing action, and the operations such as subsequent writing, reading, checking, sending, checking, resetting and the like.
Optionally, the operation mode of the driver to be upgraded can be determined by sending a request, or the operation mode of the driver to be upgraded can be obtained directly based on a control program of the upper computer.
Step S30, after the driver to be upgraded completes the data erasure of the flash memory, an upgrade file is sent to the driver to be upgraded based on the storage address;
in this embodiment, after the driver to be upgraded completes data erasure of the flash memory, the host computer needs to send the upgrade file to the driver to be upgraded in batches.
In this embodiment, the upgrade file is generally sent in batches based on preset bytes, that is, the upgrade file is sent in pages, for example, when the upgrade file is sent, the target bytes are 256, and at this time, the upper computer sends the upgrade file to the to-be-upgraded drive sequentially by using 256 bytes as a sending unit. It should be noted that, the upgrade file is sent to the drive first, and the drive writes the upgrade data into the storage address, instead of directly sending the upgrade file into the storage address.
And step S40, controlling the upgrade driver to execute a preset program upgrade action based on the upgrade file.
In this embodiment, the upgrade file includes data to be upgraded, that is, upgrade data. The preset program upgrading action comprises the steps of writing the upgrading data into a storage address for completing the data erasing action, comparing the written data with the upgrading data, and carrying out corresponding data transmission based on the comparison result of whether the written data and the upgrading data are the same or not. After the upper computer sends the file to be upgraded to the driver to be upgraded, the driver to be upgraded sends the file to be upgraded to the storage address.
Optionally, after the upgrade is completed, the driver to be upgraded may be restarted by a soft reset restart mode, so that the driver to be upgraded executes a new program.
In an alternative embodiment, step S40 specifically includes:
step S41, controlling the driver to be upgraded to write the received upgrade data into a storage address where the data erasing action is completed;
step S42, when the data of the storage address read after the writing operation is completed is the same as the upgrading data, controlling the driver to be upgraded to send identification data to the upper computer;
in this embodiment, the data of the program to be upgraded is sent based on the size of the target byte, after the driver to be upgraded completes the data to be written, if the written data is the same as the data to be written, the identification data is sent to the upper computer, the identification data mainly includes the first five bytes for communication judgment, two self-set flag bits and instruction CRC check, the upper computer mainly checks the flag bits and CRC check code of the identification data, if the check passes, it is indicated that the current writing is successful, and the next step such as continuously sending the data not to be written can be continuously executed. Specifically, when the upper computer detects that the written data and the upgrade data are the same, the current un-burnt hex file is continuously sent until all CRC check codes in the identification data are checked to pass by upper computer calculation, and when the subsequent data are not burnt, all the upgrade data are considered to be burnt successfully.
Optionally, after the writing of all the upgrade files is completed, a reset restart instruction may be sent to the driver to be upgraded, so that the driver to be upgraded restarts based on the reset restart instruction, and then the updated program is run.
Optionally, after step S41, the method further includes:
and step S43, judging that the writing failure of the upgrade data or the writing error of the upgrade data is caused when the data of the storage address read after the writing operation is finished is different from the upgrade data, and controlling the driver to be upgraded to stop receiving the upgrade file. When the written data and the upgrade data are different, the current sent upgrade data are indicated to be failed in burning, namely, the current upgrade data are failed in burning or are wrong in writing, at the moment, the driver to be upgraded stops receiving the upgrade file, and after no response feedback information is received based on the upgrade file, the upper computer considers that the current burning and upgrading are failed, and can pop up a burning failure prompt.
Optionally, the driver may further send an upgrade failure instruction to the upper computer, so that the upper computer may determine whether to perform the re-recording operation, for example, if a related instruction of "directly performing the re-recording operation after the upgrade data fails to be recorded" is set in the control program of the upper computer, and at this time, the upper computer may perform a corresponding determination processing operation based on such a determination instruction.
In the technical scheme disclosed in this embodiment, after the upper computer establishes a connection with the servo driver to be upgraded, a storage address of the flash memory in the ARM chip is obtained based on response information returned by the driver to be upgraded, so that data of the flash memory can be directly erased based on the storage address, an upgrade file is sent, and finally, the program is upgraded based on the upgrade file. Based on the method, the storage address obtained according to the response information can be directly used for programming and upgrading, an engineer does not need to manually select programming software, and the chip type and the content to be programmed and upgraded are configured in the programming software, so that the program upgrading steps are simplified, and meanwhile, the program upgrading efficiency of the scene can be improved when programming and upgrading of programs of ARM chips of different types is performed.
Referring to fig. 2, in the second embodiment, based on the first embodiment, step S10 includes:
step S11, after establishing connection with an external interface of the driver to be upgraded, sending a chip parameter request to the driver to be upgraded;
step S12, determining the chip model of the driver to be upgraded according to the response information of the driver to be upgraded, which is requested by the chip parameter;
Step S13, determining the storage address of the flash memory based on the chip model.
Specifically, the upper computer can be connected with an external interface of the servo driver, wherein the external interface can be a USB (universal serial bus) and a network port; after connection is established, an information request of ARM chip parameters is sent to the servo driver, then the servo driver responds to the information request and feeds back response information of the ARM chip parameters to the upper computer, and the upper computer determines a storage address of the flash memory in the ARM chip based on the received response information.
Optionally, the chip model can also be checked by a tester according to the product model information externally pasted on the servo driver in a way of turning over the chip manual.
The computer is connected with a standard interface with an RS232 communication protocol outside a direct-current servo electric driver of the robot, an ARM chip parameter request is sent to the direct-current servo electric driver through the RS232 communication protocol, the driver feeds back current parameter information of an ARM chip to the computer after receiving the request, then the computer obtains a chip model A based on the parameter information, and a storage address corresponding to the A chip model A is 400-1000 in a data table stored in a computer database, a local database or a cloud database. Therefore, the computer can determine that the memory address of the flash memory in the ARM chip of the direct current servo motor driver is located in the interval of 400-1000.
Optionally, after the tester obtains the storage address corresponding to the chip of the servo driver through the chip manual, the burning program of the upper computer can be directly controlled to execute the burning action of the program based on the storage address.
In the technical scheme disclosed in this embodiment, after the upper computer establishes a connection with the external interface of the driver to be upgraded, communication is performed based on the communication protocol of the external interface, so as to obtain response information returned by the driver to be upgraded, and further obtain a storage address of the flash memory in the ARM chip according to the response information, or a tester directly obtains the storage address of the flash memory in the ARM chip based on a chip manual. In the process, the upper computer is electrically connected with the driver to be upgraded by using the external interface of the driver to be upgraded, so that the servo driver can be prevented from being disassembled, and the program upgrading process is further improved in upgrading efficiency and safety by means of burning and upgrading through the simulator.
Referring to fig. 3, in the third embodiment, based on the first embodiment, before step S30, the method further includes:
step S31, checking the received check data, and judging that the driver to be upgraded completes data erasure of the flash memory after the check is passed;
In this embodiment, the received check data includes the first 5 bytes of communication data plus the flag bit set by the driver and the cyclic redundancy check code of the instruction. In this embodiment, to ensure the success rate of data erasure, the acquired check data needs to be checked, for example, after the cyclic redundancy check code passes, the upper computer may send an upgrade file compiled by an upgrade program to the driver to be upgraded, and at this time, the upper computer may send the upgrade file through a serial number and a communication baud rate set by the program. The serial number and the communication baud rate may be preset data, or may be manually selected by an engineer based on actual conditions.
The program burning process, namely the program upgrading process, is to sequentially send the files to be upgraded to the servo driver based on the target byte number preset by the upper computer, for example, based on the fixed 256 byte number in the flash, so as to improve the accuracy in the program upgrading process.
In the technical scheme disclosed by the embodiment, the received verification data is verified, and the driver to be upgraded is judged to finish data erasure after the verification is passed, so that the host computer can send an upgrade file to the driver to be upgraded based on the 256 bytes fixed in the flash after data erasure, and the accuracy in the upgrade process is improved.
Referring to fig. 4, in the fourth embodiment, based on any of the above embodiments, after step S40, the method further includes:
step S50, outputting an upgrade result prompt interface when the upgrade failure of the driver to be upgraded is detected;
step S60, when a control action is received based on the upgrade result prompt interface, responding to the control action, executing at least one of the following steps:
step S70, exiting the upgrade mode;
step S80, the step of sending the upgrade file to the drive to be upgraded based on the storage address is carried out in a jumping mode.
In the related art, when program burning and upgrading fail, the driver needs to be controlled to execute a restarting operation, so that the driver is powered on again, the chip enters a BOOT mode, and finally, software provided by a chip manufacturer is adopted to perform program re-burning.
In an optional implementation manner of this embodiment, the chip manufacturer of the driver to be upgraded is rissa, and when receiving the upgrade failure instruction sent by the driver to be upgraded, that is, detecting that the upgrade failure of the driver to be upgraded occurs, the driver outputs an upgrade result prompt interface, where the interface may include an upgrade failure prompt identifier, an exit upgrade prompt box and a re-upgrade prompt box. Based on the above, if the output interface includes all the prompt identifiers, the engineer may click on one of the identifier instructions, that is, after the driver receives the control action of the upgrade result prompt interface, respond to the control action. For example, when the engineer clicks on the prompt box to exit the upgrade, the drive executes the exit upgrade mode. Therefore, in the scheme of the embodiment, after the program upgrade fails, an implementation manner may exist, so that the current driver to be upgraded can finish the re-upgrade of the program without restarting, complicated steps in the process of restarting the driver to be upgraded are reduced, and the upgrade efficiency of re-upgrade after the program upgrade fails is improved.
In the technical scheme disclosed in this embodiment, for a servo driver of a specific chip type, such as a rissa chip, when a program upgrade fails, an upgrade failure prompt interface is output, and after a re-upgrade control action received in the upgrade failure prompt interface, an upgrade file is sent to a driver to be upgraded again, so that the situation that when the program upgrade fails, the driver to be upgraded needs to be restarted and relevant information needs to be reconfigured to execute the program upgrade action again can be avoided. Therefore, when the program upgrade fails, the step of re-upgrading is simplified, and the upgrading efficiency of the re-upgrading is improved.
Referring to fig. 5, in a fifth embodiment, based on any of the above embodiments, an alternative implementation manner of the program upgrading method of the present invention is provided, in which the host computer and the driver interact to complete the program upgrading.
In this embodiment, after the connection between the host computer and the external interface of the driver is established, a status query instruction is sent to the driver, and when the driver is in an idle state, a burn start flag (i.e., an upgrade start flag) is sent to the driver, and if the driver does not receive the flag, the driver continues to maintain the idle state. When the driver receives the burning start identification sent by the upper computer, the driver enters a burning mode (program upgrading mode), then the data of the storage address corresponding to the content to be burned is erased, and after the driver judges that the erasure is completed, the driver sends a cyclic redundancy check code to the upper computer. And checking the check code by the upper computer, and after the check is passed, indicating that the current Flash is successfully erased. And then the upper computer sends a Hex file to be burnt to the driver, the driver receives Hex file page data (namely a sub-upgrading file) sent by the upper computer through the ARM chip, and after the burning of the Hex file page data is completed, the driver continues to calculate and sends a cyclic redundancy check code corresponding to the current sub-upgrading file to the upper computer, and after the upper computer passes the check, the fact that the burning of the Hex file data of a single page is successful is indicated.
Then, whether all the Hex files are received or not (namely whether the sub-upgrading files are completely burnt and upgraded or not) is also needed to be judged, if all the data are not received, the servo driver is needed to continuously wait for receiving the files to be upgraded sent by the upper computer, and corresponding verification information is returned; when all the sub-upgrade files are burnt and upgraded, the upper computer can control the driver to carry out soft reset (restarting), so as to further run the upgraded program.
In the technical scheme disclosed by the embodiment, the upper computer and the driver are interacted to finish program upgrading, and in the process, the process is automatically finished by the upper computer and the driver without excessive participation of manpower, so that the efficiency of program upgrading is improved. Meanwhile, too many program upgrading parameters do not need to be configured, and the program upgrading steps are simplified.
Referring to fig. 6, fig. 6 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 6, the terminal may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a network interface 1003, and a memory 1004. Wherein the communication bus 1002 is used to enable connected communication between these components. The network interface 1003 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1004 may be a stable Non-Volatile Memory (NVM), such as disk Memory. The memory 1004 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal structure shown in fig. 6 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 6, an operating system, a data storage module, a network communication module, and a control program may be included in the memory 1004, which is one type of computer storage medium.
In the terminal shown in fig. 6, the network interface 1003 is mainly used for a program for connecting to an upper computer; the processor 1001 may call a program upgrade program stored in the memory 1004 and perform the following operations:
after establishing connection with a driver to be upgraded, determining a storage address of a flash memory of the driver to be upgraded;
controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address;
after the driver to be upgraded completes data erasure of the flash memory, an upgrade file is sent to the driver to be upgraded based on the storage address;
and controlling the upgrade driver to execute a preset program upgrade action based on the upgrade file.
Further, the processor 1001 may call a program upgrade program stored in the memory 1004, and further perform the following operations:
After establishing connection with an external interface of the driver to be upgraded, sending a chip parameter request to the driver to be upgraded;
determining the chip model of the driver to be upgraded according to the response information of the driver to be upgraded, which is requested by the chip parameters;
and determining a storage address of the flash memory based on the chip model.
Further, the processor 1001 may call a program upgrade program stored in the memory 1004, and further perform the following operations:
and checking the received check data, and judging that the driver to be upgraded completes data erasure of the flash memory after the check is passed.
Further, the processor 1001 may call a program upgrade program stored in the memory 1004, and further perform the following operations:
after the driver to be upgraded completes data erasure of the flash memory, determining a target byte when the upgrade file is sent;
and sending the upgrade file to the driver to be upgraded based on the target byte and the storage address.
Further, the processor 1001 may call a program upgrade program stored in the memory 1004, and further perform the following operations:
Determining an operation mode of the driver to be upgraded;
when the driver to be upgraded is in an idle mode, an upgrade starting identification is sent to the driver to be upgraded, so that the driver to be upgraded enters an upgrade mode after receiving the upgrade identification;
and when the driver to be upgraded is in the upgrading mode, executing the step of controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address.
Further, the processor 1001 may call a program upgrade program stored in the memory 1004, and further perform the following operations:
controlling the driver to be upgraded to write the received upgrade data into a storage address where the data erasing action is completed;
when the data of the storage address read after the writing operation is completed is the same as the upgrading data, controlling the driver to be upgraded to send identification data to the upper computer; or alternatively
And when the data of the storage address read after the writing operation is finished is different from the upgrading data, judging that the upgrading data fails to be written or the upgrading data is wrongly written, and controlling the driver to be upgraded to stop receiving the upgrading file.
Further, the processor 1001 may call a program upgrade program stored in the memory 1004, and further perform the following operations:
acquiring an upgrade program;
compiling the upgrade program into the upgrade file based on a preset program compiler, wherein the upgrade file comprises the storage address and upgrade data, and the upgrade data comprises a communication protocol corresponding to the upgrade driver.
Further, the processor 1001 may call a program upgrade program stored in the memory 1004, and further perform the following operations:
outputting an upgrade result prompt interface when the upgrade failure of the drive to be upgraded is detected;
when a control action is received based on the upgrade result prompt interface, responding to the control action, and executing at least one of the following steps:
exiting the upgrade mode;
and skipping to execute the step of sending the upgrade file to the drive to be upgraded based on the storage address.
Furthermore, it will be appreciated by those of ordinary skill in the art that implementing all or part of the processes in the methods of the above embodiments may be accomplished by computer programs to instruct related hardware. The computer program comprises program instructions, and the computer program may be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the control terminal to carry out the flow steps of the embodiments of the method described above.
Accordingly, the present invention also includes a computer-readable storage medium storing a program upgrade program that, when executed by a processor, implements the steps of the program upgrade method described in the above embodiments.
It should be noted that, because the storage medium provided in the embodiments of the present invention is a storage medium used for implementing the method in the embodiments of the present invention, based on the method described in the embodiments of the present invention, a person skilled in the art can understand the specific structure and the modification of the storage medium, and therefore, the description thereof is omitted herein. All storage media adopted by the method of the embodiment of the invention belong to the scope of protection of the invention.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flowchart and/or block of the flowchart illustrations and/or block diagrams, and combinations of flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second and third, et cetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. The program upgrading method is characterized by being applied to an upper computer, and comprises the following steps:
after establishing connection with a driver to be upgraded, determining a storage address of a flash memory of the driver to be upgraded;
Controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address;
after the driver to be upgraded completes data erasure of the flash memory, an upgrade file is sent to the driver to be upgraded based on the storage address;
and controlling the upgrade driver to execute a preset program upgrade action based on the upgrade file.
2. The program upgrade method of claim 1, wherein the host computer establishes a connection with the drive to be upgraded based on an external interface of the drive to be upgraded, and the step of determining the storage address of the flash memory of the drive to be upgraded after establishing the connection with the drive to be upgraded comprises:
after establishing connection with an external interface of the driver to be upgraded, sending a chip parameter request to the driver to be upgraded;
determining the chip model of the driver to be upgraded according to the response information of the driver to be upgraded, which is requested by the chip parameters;
and determining a storage address of the flash memory based on the chip model.
3. The program upgrade method of claim 1, wherein after the driver to be upgraded completes the data erasure of the flash memory, before the step of sending an upgrade file to the driver to be upgraded based on the storage address, further comprising:
And checking the received check data, and judging that the driver to be upgraded completes data erasure of the flash memory after the check is passed.
4. The program upgrade method of claim 1, wherein the step of sending an upgrade file to the drive to be upgraded based on the storage address after the drive to be upgraded completes the data erasure of the flash memory comprises:
after the driver to be upgraded completes data erasure of the flash memory, determining a target byte when the upgrade file is sent;
and sending the upgrade file to the driver to be upgraded based on the target byte and the storage address.
5. The program upgrade method of claim 1, wherein before the step of controlling the drive to be upgraded to perform the data erase action of the flash memory based on the storage address, further comprising:
determining an operation mode of the driver to be upgraded;
when the driver to be upgraded is in an idle mode, an upgrade starting identification is sent to the driver to be upgraded, so that the driver to be upgraded enters an upgrade mode after receiving the upgrade identification;
And when the driver to be upgraded is in the upgrading mode, executing the step of controlling the driver to be upgraded to execute the data erasing action of the flash memory based on the storage address.
6. The program upgrade method of claim 1, wherein the upgrade file includes upgrade data, and the step of controlling the upgrade driver to perform a preset program upgrade action based on the upgrade file comprises:
controlling the driver to be upgraded to write the received upgrade data into a storage address where the data erasing action is completed;
when the data of the storage address read after the writing operation is completed is the same as the upgrading data, controlling the driver to be upgraded to send identification data to the upper computer; or alternatively
And when the data of the storage address read after the writing operation is finished is different from the upgrading data, judging that the upgrading data fails to be written or the upgrading data is wrongly written, and controlling the driver to be upgraded to stop receiving the upgrading file.
7. The program upgrade method of claim 1, wherein after the step of determining the storage address of the flash memory of the drive to be upgraded after the connection is established with the drive to be upgraded, further comprising:
Acquiring an upgrade program;
compiling the upgrade program into the upgrade file based on a preset program compiler, wherein the upgrade file comprises the storage address and upgrade data, and the upgrade data comprises a communication protocol corresponding to the upgrade driver.
8. The program upgrade method according to any one of claims 1-7, wherein after the step of controlling the upgrade driver to perform a preset program upgrade action based on the upgrade file, further comprising:
outputting an upgrade result prompt interface when the upgrade failure of the drive to be upgraded is detected;
when a control action is received based on the upgrade result prompt interface, responding to the control action, and executing at least one of the following steps:
exiting the upgrade mode;
and skipping to execute the step of sending the upgrade file to the drive to be upgraded based on the storage address.
9. The utility model provides a host computer which characterized in that, the host computer includes: memory, a processor and a program upgrade program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the program upgrade method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a program upgrade program which, when executed by a processor, implements the steps of the program upgrade method according to any one of claims 1 to 8.
CN202310722414.4A 2023-06-16 2023-06-16 Program upgrading method, upper computer and computer readable storage medium Pending CN116860302A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310722414.4A CN116860302A (en) 2023-06-16 2023-06-16 Program upgrading method, upper computer and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310722414.4A CN116860302A (en) 2023-06-16 2023-06-16 Program upgrading method, upper computer and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116860302A true CN116860302A (en) 2023-10-10

Family

ID=88220689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310722414.4A Pending CN116860302A (en) 2023-06-16 2023-06-16 Program upgrading method, upper computer and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116860302A (en)

Similar Documents

Publication Publication Date Title
CN110474961B (en) Method for realizing multi-path remote OTA (over the air) upgrading of pure passenger vehicle based on CAN (controller area network) bus
CN109189445B (en) Method for upgrading program of equipment of Internet of things
CN109358887B (en) On-line upgrading method, device and system for single chip microcomputer program
CN111562933B (en) Air conditioner upgrading method and air conditioner system
CN111769962A (en) MCU firmware OTA upgrading method
CN114281394A (en) Method, system, equipment and medium for fast on-line upgrading program
CN112540725A (en) Nonvolatile data storage method, embedded system and storage medium
CN112433769A (en) BMC starting method and device, computer equipment and storage medium
CN113608772B (en) Application program upgrading method and device
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN113867750A (en) SOC processor software online upgrading method
WO2022156512A1 (en) Method and apparatus for firmware upgrade, device, and storage medium
CN114610355A (en) Upgrading method and device suitable for power chip control software
CN112181444B (en) DSP multi-core data programming method based on 1553B bus
CN113220319A (en) Data updating method and device and vehicle
CN112612500A (en) Method and device for upgrading BMC, electronic equipment and storage medium
CN116860302A (en) Program upgrading method, upper computer and computer readable storage medium
CN116700765A (en) Firmware upgrading method and device of servo driver and servo driver
CN117215656A (en) Linux system-based self-adaptive vehicle chip method and device, electronic equipment and vehicle
CN111427604A (en) Remote software upgrading system and method based on functional mobile phone
CN116755735A (en) Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium
CN113190259B (en) Data programming method and device, internet module and storage medium
CN112860582A (en) Local voice recognition module production test method
CN113741916A (en) Network card MAC address burning compatible method, system, terminal and storage medium
CN116301974A (en) Labview-based multi-board online upgrading method for single-board voltage inspection device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination