CN117687664A - Online upgrade configuration method and device for DSP - Google Patents

Online upgrade configuration method and device for DSP Download PDF

Info

Publication number
CN117687664A
CN117687664A CN202311638304.6A CN202311638304A CN117687664A CN 117687664 A CN117687664 A CN 117687664A CN 202311638304 A CN202311638304 A CN 202311638304A CN 117687664 A CN117687664 A CN 117687664A
Authority
CN
China
Prior art keywords
dsp
upgraded
data
file
packet
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
CN202311638304.6A
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.)
Wuhan Ship Communication Research Institute 722 Research Institute Of China Shipbuilding Corp
Original Assignee
Wuhan Ship Communication Research Institute 722 Research Institute Of China Shipbuilding Corp
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 Wuhan Ship Communication Research Institute 722 Research Institute Of China Shipbuilding Corp filed Critical Wuhan Ship Communication Research Institute 722 Research Institute Of China Shipbuilding Corp
Priority to CN202311638304.6A priority Critical patent/CN117687664A/en
Publication of CN117687664A publication Critical patent/CN117687664A/en
Pending legal-status Critical Current

Links

Landscapes

  • Communication Control (AREA)

Abstract

The invention provides an online upgrade configuration method of a DSP, which is applied to a processor connected with the DSP through a network port, and comprises the following steps: judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, ending the upgrading; sequentially sending a plurality of data message packets of a file to be upgraded to the DSP, and acquiring a whole packet data verification result fed back by the DSP; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP. The invention does not need to change the Boot Loader of the DSP starting program, only needs to use the network port of the DSP chip, and simultaneously, the data abnormality generated in the whole upgrading process can be detected through CRC check, if the data abnormality is present, the upgrading process can be immediately stopped, and the invention can return to the initial state without influencing the subsequent normal operation of the DSP application program. The practicability is strong, the flexibility is high, and the application prospect is wide.

Description

Online upgrade configuration method and device for DSP
Technical Field
The invention relates to the technical field of online upgrade of Digital Signal Processors (DSPs), in particular to an online upgrade configuration method and device of DSPs.
Background
DSP (digital signal processor) has been widely used in various fields such as communications, computers, control, consumer electronics, etc. With the wide application, the maintainability of the product and the continuous change of the product requirement are considered, and the DSP program needs to be updated frequently. The DSP generally adopts Norflash as a storage medium of a program, and the traditional DSP program updating method adopts a special DSP simulator, wherein one end of the simulator is connected with a JTAG interface (JointTestActionGroup) of a DSP chip, the other end of the simulator is connected with a computer USB port which is provided with CCS software and a DSP simulator driver, the computer USB port is connected with the DSP chip to be upgraded by operating the CCS software in the computer, an executable program to be upgraded is loaded into a memory area in the DSP, the Norflash writing program is operated, and the executable program is written into a Norflash appointed space address.
It follows that the conventional DSP upgrade method has the following disadvantages:
1) The upgrade process needs to power off the equipment and restart the power-on operation, namely the DSP simulator can be connected under the power-off condition, the power-on operation is performed after the connection of the DSP simulator is successful, and the burning program is completed through the operation of CCS software.
2) The operation process is long-the time for installing, debugging and dismantling the software and hardware environment of the upgrade program is far longer than the actual program writing time;
3) The software and hardware upgrading environment is complex, the operation flow is complex, namely, a computer provided with CCS software and a DSP simulator driver and a DSP special simulator are used as an aid for upgrading, so that the CCS software environment is huge and complex, and a non-professional DSP developer is not easy to operate;
4) Depending on the JTAG interface state, the upgrade must transmit command and data through the JTAG interface, the plug operation can lead to abrasion of JTAG related interfaces, so that instability of the JTAG interface can occur, thereby not only affecting the success rate of the upgrade program, but also affecting the service life and running stability of the product.
In addition to the above-mentioned conventional program upgrading method, there is another upgrading method in the prior art: judging whether the DSP is in an upgrade mode or not when the DSP program is started by the improved Boot Loader program, and loading the upgrade program if the DSP is in the upgrade mode; if in the normal start mode, the DSP program is started normally. The method for judging the upgrade mode is divided into two types, one is state judgment obtained through software, and the other is state judgment through a hardware switch.
However, both methods have the defect that the Boot Loader program needs to be powered up again in the upgrading process, and the upgrading process can be started only by the fact that the Boot Loader program is powered up again and started and operated, so that the online upgrading function is not really realized, and the software is not upgraded while the DSP program is normally operated. In the first method, the acquisition of the software state needs to wait for a certain time, and when the DSP program is started normally, the starting time is increased, so that unnecessary starting waiting time is generated. The implementation of the second method depends on a hardware switch, and hardware condition support is needed, so that not all boards have the hardware condition, and the popularization is difficult.
Disclosure of Invention
The invention provides a method and a device for configuring online upgrade of a DSP, which are used for solving the technical defects existing in online upgrade of the DSP in the prior art, and the Boot Loader of a DSP starting program is not required to be changed, so that the subsequent normal operation of a DSP application program is not influenced. The method has the advantages of strong practicability, high flexibility and wide application prospect.
In a first aspect, the present invention provides an online upgrade configuration method for a DSP, which is applied to a processor connected to the DSP through a network port, the method including:
judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, ending the upgrading to generate alarm information;
sequentially sending a plurality of data message packets of a file to be upgraded to the DSP according to a preset transmission mechanism, and acquiring a whole packet data verification result fed back by the DSP;
when the verification result is incorrect, finishing upgrading and generating alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP.
According to the method for configuring online upgrade of DSP, the step of sending a file transfer handshake message to DSP and executing a handshake process includes:
step 201: sending a file transmission handshake message to the DSP based on a network port protocol corresponding to the network port, and starting timing;
step 202: judging whether the DSP response message is received within a preset counting time, if so, sequentially sending data message packets to the DSP according to a preset transmission mechanism, and if not, ending upgrading.
According to the method for configuring online upgrade of the DSP, the step of sending the data packets to the DSP sequentially according to a preset transmission mechanism includes:
step 301: transmitting a data message packet to the DSP based on a network port protocol corresponding to the network port and starting timing;
step 302: judging whether the timing reaches the preset counting time, if not, repeating the step, and if so, executing step 304;
step 303: based on the network port protocol corresponding to the network port type, sending a plurality of data message packets in the file packet to be upgraded to the DSP packet by packet according to a preset time interval, judging whether a response message fed back by the DSP is received within the preset time, if yes, executing step 304, otherwise, executing step 306;
step 304: judging whether a first response message corresponding to the first data message packet fed back by the DSP is correct, if so, executing a step 305, otherwise, executing a step 306;
step 305: transmitting a second data packet;
step 306: and retransmitting the first data packet.
The first data packet is a data packet selected currently from a plurality of data packets in the file packet to be upgraded, and the second data packet is the next data packet after the first data packet in the bit sequence in the file packet to be upgraded.
According to the DSP online upgrade configuration method, the format of the data packet is 6 field data, and the 6 fields respectively represent a total packet number field, a packet sequence number field, a total packet length field, a first CRC check code, a message field to be upgraded, and a second CRC check code.
According to the DSP online upgrade configuration method, the first CRC check code is a check result obtained by performing CRC check on the total packet number field, the packet sequence number field, and the total packet length field.
According to the online upgrade configuration method of the DSP, the second CRC check code is a check result obtained by CRC checking the message field to be upgraded.
In a second aspect, the present invention also provides an online upgrade configuration method of a DSP, which is applied to the DSP, the method comprising:
receiving a file transmission handshake message to be upgraded, and feeding back a response message;
acquiring a plurality of data message packets of the file to be upgraded, and feeding back response messages corresponding to each data message packet by packet;
performing whole packet data verification on a plurality of data packets to obtain a verification result, and judging an operation to be executed based on the verification result; when the verification result is correct, executing data writing operation based on the data packet; and when the verification result is incorrect, feeding back an upgrade failure result.
In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of any of the indoor and outdoor seamless unified reference construction methods described above when the program is executed by the processor.
In a third aspect, the present invention further provides a DSP online upgrade configuration apparatus, where the apparatus includes:
the communication establishing module is used for judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, finishing upgrading to generate alarm information;
the data transmission module is used for sequentially sending a plurality of data message packets of the file to be upgraded to the DSP according to a preset transmission mechanism and acquiring a whole packet data verification result fed back by the DSP;
the online upgrade configuration module is used for judging the operation to be executed according to the verification result, and ending the upgrade when the verification result is incorrect, so as to generate alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP.
In a fifth aspect, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the DSP online upgrade configuration apparatus described above.
The online upgrading configuration method of the DSP is applied to a processor connected with the DSP through a network port, and the file package to be upgraded is imported in real time through the external processor, so that the whole online upgrading process does not need special hardware design, a DSP starting program Boot Loader does not need to be changed, only the network port of a DSP chip is needed to be utilized, meanwhile, the data abnormality generated in the whole upgrading process can be detected through CRC (cyclic redundancy check), the upgrading process can be immediately stopped if the data abnormality exists, the initial state can be returned, and the subsequent normal operation of the DSP application program is not influenced. The practicability is strong, the flexibility is high, and the application prospect is wide.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an application scenario of an online upgrade configuration method of a DSP provided by the present invention;
FIG. 2 is a second application scenario diagram of the online upgrade configuration method of the DSP according to the present invention;
FIG. 3 is a flowchart illustrating steps of an online upgrade configuration method for a DSP according to the present invention;
FIG. 4 is a diagram illustrating a handshake message format according to the present invention;
fig. 5 is a schematic diagram of a data transmission message format provided in the present invention;
FIG. 6 is a schematic diagram illustrating a transmission process of a data packet according to the present invention;
fig. 7 is a schematic diagram of a data format to be upgraded according to the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that in the description of embodiments of the present invention, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The terms "first," "second," and the like in this application are used for distinguishing between similar objects and not for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. In addition, "and/or" indicates at least one of the connected objects, and the character "/", generally indicates that the associated object is an "or" relationship.
In order to facilitate understanding, an application scenario to which the online upgrade configuration method of a DSP provided in the present application is applicable is first described, fig. 1 is a schematic diagram of an application scenario in which the online upgrade configuration method of a DSP provided in an embodiment of the present invention is applied to a computer connected to the DSP through a network port, as shown in fig. 1, the network port of the DSP may be directly connected to the computer port, and in the computer, whether a file to be upgraded is successfully selected is judged, if yes, a handshake message is sent to the DSP to transmit the file to be upgraded, and a handshake process is performed, if not, the upgrade is ended, and alarm information is generated; sequentially sending a plurality of data message packets of a file to be upgraded to the DSP according to a preset transmission mechanism, and acquiring a whole packet data verification result fed back by the DSP; when the verification result is incorrect, finishing upgrading and generating alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP. The computer may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices. The portable wearable device may be a smart watch, smart bracelet, or the like.
Fig. 2 is a schematic diagram of an application scenario in which the online upgrade configuration method of the DSP according to the embodiment of the present invention is applied to a processor connected to the DSP through a network port, as shown in fig. 2, the network port of the DSP is not led out and cannot be directly connected to a computer, but hardware having a high-speed interface (PCIe, rapidio, etc.) and a network port, for example, a processor, may be connected through the high-speed interface to serve as a relay. The data to be upgraded is passed through the high-speed interface to the processor and then through the network port to the DSP and vice versa. Judging whether the file to be upgraded is selected successfully or not in the processor, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, finishing upgrading to generate alarm information; sequentially sending a plurality of data message packets of a file to be upgraded to the DSP according to a preset transmission mechanism, and acquiring a whole packet data verification result fed back by the DSP; when the verification result is incorrect, finishing upgrading and generating alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP.
The online upgrade configuration method of the DSP according to the embodiment of the present invention is described below with reference to fig. 3 to 7.
As shown in fig. 3, an online upgrade configuration method of a DSP is provided, and the method is applied to the processor connected to the DSP through a network port in fig. 2, as shown in fig. 3, and includes, but is not limited to, the following STEPs (STEP, S for short):
s101: judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, ending the upgrading to generate alarm information.
S102: sequentially sending a plurality of data message packets of a file to be upgraded to the DSP according to a preset transmission mechanism, and acquiring a whole packet data verification result fed back by the DSP;
when the verification result is incorrect, finishing upgrading and generating alarm information; and when the verification result is correct, judging whether a DSP feedback data writing success result is received within a preset time number, if so, generating a transmission completion message and sending the transmission completion message to the DSP, otherwise, finishing upgrading and generating alarm information.
Specifically, in the upgrading process, whether the file to be upgraded is successfully selected or not is judged by judging the selection of the file to be upgraded. The judgment can be made by checking whether the file exists, whether the file authority meets the requirement or not, and the like. If the file selection is successful, entering the next step; if the file selection fails, the upgrading is finished, and alarm information is generated.
If the file selection is successful, sending a file transmission handshake message to be upgraded to the DSP, and executing a handshake process. The handshake messages are used to establish the transmission channel and ensure the readiness of both parties. In the handshake process, the two parties can exchange and verify information, and the correctness and the integrity of transmission are ensured.
After the handshake is successful, the file to be upgraded is segmented into a plurality of data message packets according to a preset transmission mechanism, and the data message packets are sequentially sent to the DSP. After the DSP receives the data messages, the whole packet data verification is carried out to verify the integrity of all the received data messages.
After the processor receives the verification result, executing judgment whether the DSP feedback data is received within the preset time number, and if the processor receives the DSP feedback data within the preset time number, generating a successful writing result. And the processor judges after receiving the whole packet data verification result fed back by the DSP. If the check result is incorrect, it indicates that there may be error or lost data in the transmission process. In this case, the upgrade is ended and an alarm message is generated for timely processing.
Further, after the whole packet data verification is completed, the data writing result judgment is executed, and if the verification result of the whole packet data verification is correct, the file to be upgraded is successfully transmitted to the DSP. And ending the file transmission to be upgraded and completing the online upgrade configuration of the DSP. It will be appreciated that the DSP will perform a write operation of the file to be upgraded after the integrity check of the entire packet of data is completed.
Based on the foregoing embodiments, as an optional embodiment, in the method for configuring online upgrade of a DSP according to the present invention, the step of sending a file transfer handshake message to the DSP and executing a handshake procedure includes:
step 201: sending a file transmission handshake message to the DSP based on a network port protocol corresponding to the network port, and starting timing;
step 202: judging whether the DSP response message is received within a preset counting time, if so, sequentially sending data message packets to the DSP according to a preset transmission mechanism, and if not, ending upgrading.
Specifically, after the files to be upgraded required by the current upgrade are determined, a file transmission handshake message is sent to the DSP, a waiting timer is started, handshake failure is displayed when the waiting time is exceeded, and the current online upgrade is ended.
Based on the foregoing embodiments, as an optional embodiment, in the method for configuring online upgrade of a DSP according to the present invention, the step of sequentially sending data packets to the DSP according to a preset transmission mechanism includes:
step 301: transmitting a data message packet to the DSP based on a network port protocol corresponding to the network port and starting timing;
step 302: judging whether the timing reaches the preset counting time, if not, repeating the step, and if so, executing step 304;
step 303: based on the network port protocol corresponding to the network port type, sending a plurality of data message packets in the file packet to be upgraded to the DSP packet by packet according to a preset time interval, judging whether a response message fed back by the DSP is received within the preset time, if yes, executing step 304, otherwise, executing step 306;
step 304: judging whether a first response message corresponding to the first data message packet fed back by the DSP is correct, if so, executing a step 305, otherwise, executing a step 306;
step 305: transmitting a second data packet;
step 306: and retransmitting the first data packet.
Specifically, after the handshake is successful, the processor continuously sends the data message to be upgraded to the DSP, and once the processor sends one packet of data message, the waiting timer is started, and after receiving the receiving message ACK returned by the DSP, the processor sends the next packet.
After receiving the complete file to be upgraded, carrying out data verification of the whole package of the file, and sending a verification result to the processor. The verification aims to mainly prevent errors of the DSP upgrade data in the transmission process. If the verification result is correct, the processor interface prompts that the data transmission is successful, and the next upgrading stage is entered. If the verification result is incorrect, the processor prompts that the data transmission fails, and the online upgrading is finished, and corresponding alarm information is generated. At this time, the software and hardware environment needs to be checked again, so that online upgrade is carried out again after reliable and correct transmission is ensured.
The format of the data packet is 6 field data, and 6 fields respectively represent a total packet number field, a packet sequence number field, a total packet length field, a first CRC check code, a message field to be upgraded and a second CRC check code.
Specifically, the first CRC check code is a check result obtained by performing CRC check on the total packet number field, the packet sequence number field, and the total packet length field. And the second CRC check code is a check result obtained by performing CRC check on the message field to be upgraded.
The invention also provides a device for configuring online upgrade of the DSP, which comprises: the communication establishing module is used for judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, finishing upgrading to generate alarm information;
the data transmission module is used for sequentially sending a plurality of data message packets of the file to be upgraded to the DSP according to a preset transmission mechanism and acquiring a whole packet data verification result fed back by the DSP;
the online upgrade configuration module is used for judging the operation to be executed according to the verification result, and ending the upgrade when the verification result is incorrect, so as to generate alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP.
Based on the foregoing embodiments, as an optional embodiment, the DSP online upgrade configuration apparatus includes a DSP online upgrade configuration system, where the DSP online upgrade configuration system includes a communication establishment module, a data transmission module, and an online upgrade configuration module
Before data transmission starts, the DSP online upgrade configuration system sends a handshake message to the DSP, starts a waiting timer, displays handshake failure if the waiting time is exceeded and does not receive a response message, and finishes the online upgrade. Fig. 4 is a schematic diagram of a handshake message format according to an embodiment of the present invention, where, as shown in fig. 4, message types are divided into: upgrade data handshake and transmission message, upgrade data handshake and transmission response message, online upgrade instruction message and online upgrade instruction response message. As shown in fig. 4, CRC check is performed on the message type field and the message body field and the message tail is filled.
After the handshake is successful, the DSP online upgrade configuration system continuously transmits a data message to be upgraded to the DSP. Figure 5 is a diagram of a data transmission message format according to an embodiment of the present invention,
as shown in FIG. 5, before the message cutting is performed on the file to be upgraded, CRC of the whole file to be upgraded is attached to the end of the file to be used as verification. Fig. 7 is a schematic diagram of a data format to be upgraded according to an embodiment of the present invention, as shown in fig. 7. The file to be upgraded is equally divided into a plurality of data messages (except the last packet of data messages, the length of which is variable) according to the block size of Norflash, and the data messages are sent one by one. And performing CRC (cyclic redundancy check) on the total packet number field, the packet sequence number field and the total packet length field, filling the first CRC of the message, performing CRC on the message field to be upgraded, and filling the second CRC of the message.
And starting a waiting timer when the DSP online upgrading configuration system transmits one packet of data message, and transmitting the next packet after receiving a receiving message ACK returned by the DSP. And if the received message NAK message returned by the DSP is received or the response message of the DSP is not received, the packet data is retransmitted for 3 times at most, if the received message ACK from the DSP is not received for 3 times, the data transmission is failed, the online upgrade is ended, at the moment, the software and hardware environment is required to be checked again, and the online upgrade can be restarted after the reliable and correct transmission is ensured. Fig. 6 is a schematic diagram of a transmission process of a plurality of data packets of a data packet to be upgraded according to an embodiment of the present invention, as shown in fig. 6. The specific implementation function is mainly implemented by adopting the following four functional functions:
a)CtrlDataSend
the function sends a handshake flow related message.
b)FileDataSend
The function sends a data message to be upgraded.
c)DataRecv
The function receives the message from the DSP, and after the receiving is finished, the function is transferred to analysis processing according to the type of the message.
d)StatusDataParse
The function parses the status message from the DSP and operates according to the flow.
In an example, the present invention further provides a method for configuring online upgrade of a DSP, which is described below by taking application of the method to the DSP in fig. 2 as an example, where the method includes:
step 1: receiving a file transmission handshake message to be upgraded, and feeding back a response message;
step 2: acquiring a plurality of data message packets of a file to be upgraded, and feeding back a response message corresponding to each data message packet by packet;
step 3: performing whole packet data verification on a plurality of data packets to obtain a verification result, and judging an operation to be executed based on the verification result; when the verification result is correct, executing data writing operation based on the data packet; and when the verification result is incorrect, feeding back an upgrade failure result.
The DSP receives a message to be upgraded sent from a processor carrying a file to be upgraded, as shown in fig. 5, according to the interface format of the network port, performs CRC verification first, extracts the message segment to be upgraded if the CRC is correct, and puts the message segment to be upgraded into a buffer area, where the storage start address is the end of the storage address of the data to be upgraded, as shown in fig. 7.
When the DSP receives the last packet of data message, it then starts to perform CRC check on the entire file, as shown in fig. 7. And if the CRC of the whole file is correct, transferring to a file read-write step to be upgraded.
Specifically, DPS reads and writes NorFlash through the EMIF bus, writes the file to be upgraded in the designated address, and performs read-back verification. If the read-back verification is successful, the upgrade is sent to the processor, otherwise, the online upgrade is sent to fail.
Based on the above embodiments, as an alternative embodiment, since the space in the DSP chip is small, the cache file of the file to be upgraded is stored at the DDR outside the DSP chip and at a continuous address, as shown in fig. 7. The receiving and piecing together of the complete file to be upgraded is shown in fig. 7. The data message field to be updated of the second packet is stored immediately following the last address of the message field to be updated of the first packet, as shown in fig. 5, by combining the number field of the packet and the total number field of the packet in the packet and the number of the packets received currently, whether the packet is the last packet is comprehensively judged, and the last packet is received, namely the whole file to be updated is completely received. The specific implementation function is mainly implemented by adopting the following three functional functions:
a)FileDataRecv
the function receives the message from the processor, and after the receiving is finished, the function shifts to analysis processing.
b)FileDataParse
The function parses the message from the processor and operates according to the flow
c)FileDataSave
The function sequentially stores and hashes the extracted data message fields to be upgraded according to the addresses.
The verification of the file to be upgraded is performed by calculating CRC 32. The checking module is mainly used for preventing error checking of the file data to be upgraded in the transmission and storage processes. The data verification of the file to be upgraded is carried out by adopting a mode of calculating CRC32, and the method comprises the following two steps:
in the case of explicitly updating the file CRC32 check polynomial and CRC deposit location, calculation interval, after the DSP receives data from the processor, the DSP checks the CRC according to the message format, as shown in fig. 4 and 5.
After the DSP finishes receiving all the data packets in the buffer, CRC check is performed on the entire file to be upgraded, as shown in fig. 7.
Only when all the above CRC checks are correct, the next step of reading and writing NorFlash can be entered.
The NorFlash read-write flow is divided into the following three steps:
a) Removing the Norflash write protection to finish the operation of erasing the Norflash designated area;
b) Entering an updating flow, and finishing writing each block one by one;
c) And checking the data in each block, and performing CRC (cyclic redundancy check). And (3) if all CRC checks correctly, the online upgrade is successful, otherwise, the step a) is returned until the read data CRC checks correctly.
The implementation function mainly comprises the following three functions:
a)Erase Flash(unsigned Flash Base, unsigned sector Addr);
the function erases a certain sector of Nor Flash, every 1024 x 1024 bytes of sector size, and 128 sectors are all available. Wherein Flash Base is a Flash Base address, and sector Addr is a sector number.
b)Write Flash(unsigned Flash Base, unsigned offset, unsigned short *data);
This function writes to the specified Nor Flash address (base address+offset). Wherein Flash Base is a Flash Base address, offset is an offset, and data is a data address to be written into Flash.
c)Read Flash(unsigned Flash Base, unsigned offset, unsigned short *data);
This function performs a read operation on the specified Nor Flash address (base address+offset). Wherein Flash Base is a Flash Base address, offset is an offset, and data is a read data address.
When the file is written, the size of the Flash space is recorded, namely, the interval needing to participate in calculation is determined, the position of the CRC32 is determined, and according to the address record, the data is read back and CRC check is carried out. This calculated CRC is compared with the CRC value contained in the file.
In summary, the online upgrade configuration method of the DSP provided by the present invention is applied to a processor connected to the DSP through a network port, and the file package to be upgraded is imported in real time through an external processor, so that no special hardware design is required in the whole online upgrade process, no modification of the Boot Loader of the DSP is required, only the network port of the DSP chip is required, and meanwhile, the occurrence of data anomalies in the whole upgrade process can be detected through CRC check, if the data anomalies immediately terminate the upgrade process, and the process can return to the initial state, without affecting the subsequent normal operation of the DSP application. The practicability is strong, the flexibility is high, and the application prospect is wide.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing the online upgrade configuration method of a DSP provided by the above embodiments, the method comprising: judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, ending the upgrading to generate alarm information; sequentially sending a plurality of data message packets of a file to be upgraded to the DSP according to a preset transmission mechanism, and acquiring a whole packet data verification result fed back by the DSP; when the verification result is incorrect, finishing upgrading and generating alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP.
In still another aspect, the present invention further provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the online upgrade configuration method of a DSP provided by the above embodiments, the method comprising: judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, ending the upgrading to generate alarm information; sequentially sending a plurality of data message packets of a file to be upgraded to the DSP according to a preset transmission mechanism, and acquiring a whole packet data verification result fed back by the DSP; when the verification result is incorrect, finishing upgrading and generating alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. An online upgrade configuration method of a DSP, which is applied to a processor connected to the DSP through a network port, includes:
judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, ending the upgrading to generate alarm information;
sequentially sending a plurality of data message packets of a file to be upgraded to the DSP according to a preset transmission mechanism, and acquiring a whole packet data verification result fed back by the DSP;
when the verification result is incorrect, finishing upgrading and generating alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP.
2. The method for configuring online upgrade of a DSP according to claim 1, wherein the step of sending a file transfer handshake message to the DSP and performing a handshake process comprises:
step 201: sending a file transmission handshake message to the DSP based on a network port protocol corresponding to the network port, and starting timing;
step 202: judging whether the DSP response message is received within a preset counting time, if so, sequentially sending data message packets to the DSP according to a preset transmission mechanism, and if not, ending upgrading.
3. The method for configuring online upgrade of a DSP according to claim 1, wherein the step of sequentially transmitting the data packets to the DSP according to a preset transmission mechanism comprises:
step 301: transmitting a data message packet to the DSP based on a network port protocol corresponding to the network port and starting timing;
step 302: judging whether the timing reaches the preset counting time, if not, repeating the step, and if so, executing step 304;
step 303: based on the network port protocol corresponding to the network port type, sending a plurality of data message packets in the file packet to be upgraded to the DSP packet by packet according to a preset time interval, judging whether a response message fed back by the DSP is received within the preset time, if yes, executing step 304, otherwise, executing step 306;
step 304: judging whether a first response message corresponding to the first data message packet fed back by the DSP is correct, if so, executing a step 305, otherwise, executing a step 306;
step 305: transmitting a second data packet;
step 306: and retransmitting the first data packet.
4. The method for configuring on-line upgrade of DSP according to claim 1, wherein the format of the data packet is 6 field data, and 6 fields respectively represent a total packet number field, a packet sequence number field, a total packet length field, a first CRC check code, a message field to be upgraded, and a second CRC check code.
5. The method according to claim 4, wherein the first CRC check code is a check result obtained by performing CRC check on the total packet number field, the packet sequence number field, and the total packet length field.
6. The method for configuring online upgrade of DSP according to claim 4, wherein the second CRC check code is a check result obtained by performing CRC check on the message field to be upgraded.
7. An online upgrade configuration method for a DSP, which is applied to the DSP, the method comprising:
receiving a file transmission handshake message to be upgraded, and feeding back a response message;
acquiring a plurality of data message packets of the file to be upgraded, and feeding back response messages corresponding to each data message packet by packet;
performing whole packet data verification on a plurality of data packets to obtain a verification result, and judging an operation to be executed based on the verification result; when the verification result is correct, executing data writing operation based on the data packet; and when the verification result is incorrect, feeding back an upgrade failure result.
8. A DSP online upgrade configuration apparatus, the apparatus comprising:
the communication establishing module is used for judging whether the file to be upgraded is selected successfully, if so, sending a file transmission handshake message to be upgraded to the DSP, executing a handshake process, and if not, finishing upgrading to generate alarm information;
the data transmission module is used for sequentially sending a plurality of data message packets of the file to be upgraded to the DSP according to a preset transmission mechanism and acquiring a whole packet data verification result fed back by the DSP;
the online upgrade configuration module is used for judging the operation to be executed according to the verification result, and ending the upgrade when the verification result is incorrect, so as to generate alarm information; and when the verification result is correct, ending the transmission of the file to be upgraded, and finishing the online upgrade configuration of the DSP.
9. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of the online upgrade configuration method of a DSP according to any one of claims 1 to 6.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a DSP implements the steps of the online upgrade configuration method of a DSP as defined in claim 7.
CN202311638304.6A 2023-12-03 2023-12-03 Online upgrade configuration method and device for DSP Pending CN117687664A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311638304.6A CN117687664A (en) 2023-12-03 2023-12-03 Online upgrade configuration method and device for DSP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311638304.6A CN117687664A (en) 2023-12-03 2023-12-03 Online upgrade configuration method and device for DSP

Publications (1)

Publication Number Publication Date
CN117687664A true CN117687664A (en) 2024-03-12

Family

ID=90138258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311638304.6A Pending CN117687664A (en) 2023-12-03 2023-12-03 Online upgrade configuration method and device for DSP

Country Status (1)

Country Link
CN (1) CN117687664A (en)

Similar Documents

Publication Publication Date Title
CN110134415A (en) A kind of controller and its method for upgrading software and device
CN107179909A (en) Method for upgrading software, device and computer-readable recording medium
CN109964215B (en) Flow control in remote direct memory access data communications with ring buffer mirroring
CN111008033A (en) Universal DSP (digital signal processor) online upgrading system and upgrading method based on serial port
CN101815988A (en) Firmware image update and management
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
CN109284117A (en) Firmware upgrade method and system and flash memory microcontroller based on flash memory microcontroller
CN110580235B (en) SAS expander communication method and device
CN114281394A (en) Method, system, equipment and medium for fast on-line upgrading program
CN112181459B (en) CPLD upgrade optimization method and system
CN112231005B (en) UBOOT-based method for managing FPGA version
CN113703803A (en) Remote upgrading system, method and medium based on FPGA
JP2006190257A (en) Data transfer device and its method
CN110134423B (en) Firmware updating method and device and computer readable storage medium
CN117687664A (en) Online upgrade configuration method and device for DSP
CN107908418B (en) Method for upgrading logic program of fiber channel node card and fiber channel bus equipment
CN112181444B (en) DSP multi-core data programming method based on 1553B bus
US7159142B2 (en) Pseudo I/O system and method
CN114115957A (en) FPGA (field programmable Gate array) online updating method with backup and system thereof
CN114968301A (en) Program updating method and system based on serial port communication
CN103902323B (en) A kind of lung ventilator method for upgrading software and its system
CN113010114A (en) Data processing method and device, computer equipment and storage medium
CN111722858A (en) Online upgrading method and terminal equipment
CN113467842B (en) Method for starting embedded device suitable for industrial application scene, embedded device and computer readable storage medium
CN111506333B (en) double-DSP program online upgrading method and system

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