A DSP loading method and device based on Fudan microprocessor
Through the DSP loading method based on Fudan microprocessor, DSP loading is realized by using one Ethernet interface, which solves the problem of limited network port resources, improves data transmission efficiency and speed, and is suitable for processors with fewer network port resources.
Patent Information
- Application Number
- CN202411006494.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-07-25
AI Technical Summary
How to successfully load the DSP when network port resources are limited, especially when the CPU needs to use multiple network ports to load the DSP at the same time, the existing technology may cause loading failure.
A DSP loading method based on Fudan microprocessor is adopted to realize DSP loading through an Ethernet interface, including sending a parameter acquisition request to the Fudan microprocessor, receiving and feeding back the IP address and file name, performing data packet request and initialization, writing a success flag, and performing handshake communication at the memory location to finally complete the DSP software loading.
When network port resources are limited, DSP loading is successfully completed through an Ethernet interface, which improves data transmission efficiency and speed. It is suitable for processors with fewer network port resources.
Smart Images

Figure CN119052218B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a DSP loading method and device based on a Fudan microprocessor. Background Art
[0002] With the advancement of communications technology, the application of digital signal processors (DSPs) is becoming increasingly widespread. At the same time, communications equipment is moving towards miniaturization and localization, resulting in reduced board area and increased component density. To reduce board area, the central processing unit (CPU) and DSP application are often integrated onto the same memory chip, which poses challenges for DSP loading.
[0003] The traditional DSP loading method involves the CPU reading the DSP software version from the onboard FLASH memory via the SGMII network port and loading it into the system for use. Because the CPU requires at least two Ethernet ports for DSP loading, processors with limited network port resources may experience DSP loading failures if the CPU needs to use multiple Ethernet ports simultaneously for DSP loading, given the processor's limited network port resources.
[0004] Therefore, how to successfully load DSP when network port resources are limited has become an urgent problem to be solved in this field. Summary of the Invention
[0005] The present application provides a DSP loading method and device based on a Fudan microprocessor, the purpose of which is to successfully load the DSP when network port resources are limited.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] A DSP loading method based on a Fudan microprocessor, applied to a DSP, comprising:
[0008] When receiving the DSP load instruction, it sends a parameter acquisition request to the Fudan microprocessor;
[0009] When receiving the IP address and the file name of the dsp.s file fed back by the Fudan microprocessor according to the parameter acquisition request, sending a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file;
[0010] After receiving the dsp.s file fed back by the Fudan microprocessor according to the data packet request, initializing according to the dsp.s file, and after the initialization is completed, writing a success flag to the first position of the memory, so that the Fudan microprocessor writes the success flag to the second position of the memory according to the success flag;
[0011] After reading the success flag from the second position of the memory, sending a software loading request to the Fudan microprocessor;
[0012] After receiving the target dsp.s file fed back by the Fudan microprocessor according to the software loading request, the DSP software is loaded according to the target dsp.s file; the target dsp.s file is a DSP version file with the same file name as the dsp.s file;
[0013] When the DSP software is loaded, the success flag is written into the third location of the memory; the memory is a shared memory for handshake communication between the Fudan microprocessor and the DSP.
[0014] Optionally, when receiving the DSP load instruction, sending a parameter acquisition request to the Fudan microprocessor includes:
[0015] When receiving the DSP load instruction sent by the Fudan microprocessor, identifying the DSP load instruction and obtaining a reset instruction;
[0016] Execute a reset operation according to the reset instruction;
[0017] When the reset operation is completed, determining the Ethernet interface according to the level of the GPIO pin in the reset instruction;
[0018] A parameter acquisition request is sent to the Fudan microprocessor through the Ethernet interface.
[0019] Optionally, sending a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file includes:
[0020] Establishing a file transfer network with the Fudan microprocessor according to the IP address;
[0021] In the file transfer network, a data packet request is sent to the Fudan microprocessor according to the file name of the dsp.s file.
[0022] Optionally, the initialization according to the dsp.s file includes:
[0023] Read the file content of the dsp.s file to obtain register configuration data;
[0024] Initialization is performed according to the register configuration data.
[0025] A DSP loading method based on a Fudan microprocessor, applied to the Fudan microprocessor, comprising:
[0026] Sending a DSP load instruction to the DSP, so that the DSP sends a parameter acquisition request according to the DSP load instruction;
[0027] When receiving the parameter acquisition request, sending the IP address and the file name of the dsp.s file to the DSP;
[0028] When receiving a data packet request fed back by the DSP according to the IP address and the file name of the dsp.s file, sending the dsp.s file to the DSP, so that the DSP writes a success flag in the first position of the memory according to the dsp.s file;
[0029] After the success flag is read from the first position of the memory, a target dsp.s file is determined according to the dsp.s file, and the success flag is written to the second position of the memory; the target dsp.s file is a DSP version file with the same file name as the dsp.s file;
[0030] After receiving the software loading request sent by the DSP according to the success flag, sending the target dsp.s file to the DSP, so that the DSP writes the success flag in the third location of the memory according to the target dsp.s file;
[0031] When the success flag is read from the third location of the memory, it is determined that the DSP loading is completed.
[0032] Optionally, determining a target dsp.s file according to the dsp.s file includes:
[0033] Deleting the dsp.s file from the preset memory;
[0034] After the dsp.s file is deleted, the DSP version file is read from the preset memory, and the file name of the DSP version file is modified to the dsp.s file;
[0035] After the file name modification is completed, the DSP version file having the same file name as the dsp.s file is used as the target dsp.s file.
[0036] Optionally, before deleting the dsp.s file from the preset memory, the method further includes:
[0037] Get register configuration data and board location information;
[0038] The dsp.s file is generated based on the register configuration data and the board location information, and the dsp.s file is stored in a preset memory.
[0039] Optionally, also include:
[0040] When the success flag is not read from the first location of the memory within a first preset time, determining that the DSP loading has failed;
[0041] When the success flag is not read from the third location of the memory within the second preset time, it is determined that the DSP loading fails, and the dsp.s file in the preset memory is deleted;
[0042] If the DSP loading fails, the process returns to executing the step of sending a DSP loading instruction to the DSP so that the DSP sends a parameter acquisition request according to the DSP loading instruction until the DSP loading is completed.
[0043] A DSP loading device based on a Fudan microprocessor, applied to a DSP, comprising:
[0044] The first sending unit is used to send a parameter acquisition request to the Fudan microprocessor when receiving the DSP loading instruction;
[0045] A second sending unit is configured to send a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file when receiving the IP address and the file name of the dsp.s file fed back by the Fudan microprocessor according to the parameter acquisition request;
[0046] an initialization unit for, upon receiving the dsp.s file fed back by the Fudan microprocessor according to the data packet request, performing initialization according to the dsp.s file, and after the initialization is completed, writing a success flag to a first location of a memory, so that the Fudan microprocessor writes the success flag to a second location of the memory according to the success flag;
[0047] A reading unit, configured to send a software loading request to the Fudan microprocessor after reading the success flag from the second location of the memory;
[0048] A loading unit is configured to load DSP software according to the target dsp.s file after receiving the target dsp.s file fed back by the Fudan microprocessor according to the software loading request; the target dsp.s file is a DSP version file with the same file name as the dsp.s file;
[0049] A writing unit is used to write the success flag into the third location of the memory after the DSP software is loaded; the memory is a shared memory for handshake communication between the Fudan microprocessor and the DSP.
[0050] A DSP loading device based on a Fudan microprocessor, applied to the Fudan microprocessor, comprising:
[0051] A first sending unit, configured to send a DSP loading instruction to the DSP, so that the DSP sends a parameter acquisition request according to the DSP loading instruction;
[0052] A second sending unit is configured to send an IP address and a file name of a dsp.s file to the DSP when receiving the parameter acquisition request;
[0053] a third sending unit, configured to, upon receiving a data packet request fed back by the DSP according to the IP address and the file name of the dsp.s file, send the dsp.s file to the DSP, so that the DSP writes a success flag in a first position of a memory according to the dsp.s file;
[0054] a determining unit configured to, after reading the success flag from the first location of the memory, determine a target dsp.s file based on the dsp.s file and write the success flag to a second location of the memory; the target dsp.s file being a DSP version file having the same file name as the dsp.s file;
[0055] a fourth sending unit, configured to, upon receiving a software loading request sent by the DSP according to the success flag, send the target dsp.s file to the DSP, so that the DSP writes a success flag in a third location of the memory according to the target dsp.s file;
[0056] The data determination unit is configured to determine that the DSP loading is completed after the success flag is read from the third position of the memory.
[0057] The technical solution provided by the present application is as follows: when a DSP loading instruction is received, a parameter acquisition request is sent to the Fudan microprocessor; when the IP address and the file name of the dsp.s file fed back by the Fudan microprocessor according to the parameter acquisition request are received, a data packet request is sent to the Fudan microprocessor according to the IP address and the file name of the dsp.s file; after receiving the dsp.s file fed back by the Fudan microprocessor according to the data packet request, initialization is performed according to the dsp.s file, and after the initialization is completed, a success flag is written to the first position of the memory, so that the Fudan microprocessor writes the success flag in the second position of the memory according to the success flag; after the success flag is read from the second position of the memory, a software loading request is sent to the Fudan microprocessor; after receiving the target dsp.s file fed back by the Fudan microprocessor according to the software loading request, DSP software is loaded according to the target dsp.s file; after the DSP software loading is completed, the success flag is written to the third position of the memory. In this application, only one Ethernet interface is required for the Fudan microprocessor to be provided, and data is transmitted through the Ethernet interface to realize DSP loading. Even for processors with fewer network port resources, DSP loading can be successfully completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0059] Figure 1 A flowchart of a DSP loading method based on a Fudan microprocessor provided in an embodiment of the present application;
[0060] Figure 2 A flowchart of a method for sending a parameter acquisition request provided in an embodiment of the present application;
[0061] Figure 3 A schematic diagram of an S-Record file provided in an embodiment of the present application;
[0062] Figure 4 A schematic diagram of data transmission provided in an embodiment of the present application;
[0063] Figure 5 A flowchart of another DSP loading method based on a Fudan microprocessor provided in an embodiment of the present application;
[0064] Figure 6A flowchart of a method for determining a target dsp.s file provided in an embodiment of the present application;
[0065] Figure 7 A flowchart of a DSP loading method provided in an embodiment of the present application;
[0066] Figure 8 A schematic diagram of the architecture of a DSP loading platform provided in an embodiment of the present application;
[0067] Figure 9 An interactive flow chart of a DSP loading method based on a Fudan microprocessor provided in an embodiment of the present application;
[0068] Figure 10 A schematic diagram of a DSP loading process provided in an embodiment of the present application;
[0069] Figure 11 A structural diagram of a DSP loading process provided in an embodiment of the present application;
[0070] Figure 12 A schematic diagram of the architecture of a DSP loading device based on a Fudan microprocessor provided in an embodiment of the present application;
[0071] Figure 13 This is a schematic diagram of the architecture of another DSP loading device based on a Fudan microprocessor provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0073] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0074] like Figure 1 FIG. 1 is a flowchart of a DSP loading method based on a Fudan microprocessor provided in an embodiment of the present application, which is applied to a DSP and includes the following steps:
[0075] S101: When a DSP loading instruction is received, a parameter acquisition request is sent to the Fudan microprocessor.
[0076] The parameter acquisition request indicates a request for acquiring an IP address and a file name.
[0077] Optionally, the Fudan microprocessor (Program Logic, PL) is a high-performance microprocessor.
[0078] It is understandable that when receiving the DSP loading instruction, the DSP sends a broadcast packet request (i.e., a parameter acquisition request) to the Fudan microprocessor through the DHCP client, and by sending a request to obtain the IP address and file name to the Fudan microprocessor, the Fudan microprocessor feeds back the IP address and file name.
[0079] Optionally, in another embodiment of the present application, the specific implementation of step S101 is as follows: Figure 2 As shown, the following steps are included:
[0080] S201: When a DSP load instruction sent by the Fudan microprocessor is received, the DSP load instruction is identified to obtain a reset instruction.
[0081] The reset instruction indicates an instruction for resetting the DSP.
[0082] It is understandable that when the DSP loading instruction sent by the Fudan microprocessor is received, since the DSP loading action can only be executed after the DSP is reset, the reset instruction is first identified from the DSP loading instruction and the DSP is reset.
[0083] S202: Execute a reset operation according to the reset instruction.
[0084] It is understandable that the Fudan microprocessor pulls down or up the DSP reset pin (ie, the GPIO pin) through the GPIO pin, that is, performs a reset operation according to the reset instruction, thereby resetting the DSP.
[0085] S203: When the reset operation is completed, the Ethernet interface is determined according to the level of the GPIO pin in the reset instruction.
[0086] It is understandable that after the reset operation is completed, the DSP bootloader will read the GPIO pin levels and determine the DSP loading mode based on the GPIO pin levels. Specifically, the loading mode is determined by the DSP's three GPIO pins, GPIO9, GPIO8, and GPIO7. When the DSP reads the three GPIO pins as 101b (1 for high, 0 for low), that is, GPIO9 is high, GPIO8 is low, and GPIO7 is high, the Ethernet interface (such as the SGMII interface) is selected for DSP loading.
[0087] S204: Sending a parameter acquisition request to the Fudan microprocessor via the Ethernet interface.
[0088] It is understandable that since the Ethernet interface supports a data transmission rate of 1.25 Gbps and can meet the requirements of high-speed Ethernet communication, sending a parameter acquisition request to the Fudan microprocessor through the Ethernet interface can ensure the efficiency and speed of data transmission.
[0089] S102: When receiving the IP address and the file name of the dsp.s file fed back by the Fudan microprocessor according to the parameter acquisition request, sending a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file.
[0090] The data packet request indicates a request for obtaining the file name of the dsp.s file.
[0091] It can be understood that when the IP address and file name of the dsp.s file are fed back by the Fudan microprocessor according to the parameter acquisition request, a configuration success message is sent to the Fudan microprocessor. After the information is sent, a data packet request is also sent to the Fudan microprocessor according to the IP address and file name of the dsp.s file.
[0092] Optionally, in another embodiment of the present application, the specific implementation of sending the data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file in step S102 includes:
[0093] Establish a file transfer network with Fudan microprocessor based on IP address.
[0094] It can be understood that after sending the configuration success information to the Fudan microprocessor, a file transfer network is established with the Fudan microprocessor based on the IP address. Specifically, a TCP / IP-based Simple File Transfer Protocol (Trivial File Transfer Protocol, TFTP) file transfer is established between the SGMII network port of the Fudan microprocessor.
[0095] In the file transfer network, a data packet request is sent to the Fudan microprocessor according to the file name of the dsp.s file.
[0096] After the file transfer network is established, data can be transferred in the file transfer network. Therefore, in the file transfer network, a data packet request is sent to the Fudan microprocessor according to the file name of the dsp.s file.
[0097] S103: After receiving the dsp.s file fed back by the Fudan microprocessor according to the data packet request, initialization is performed according to the dsp.s file, and after the initialization is completed, a success flag is written to the first position of the memory, so that the Fudan microprocessor writes a success flag to the second position of the memory according to the success flag.
[0098] The memory includes but is not limited to: a dual-port RAM, and the first position of the memory may be an address Addr.
[0099] Optionally, the success flag includes but is not limited to: 0xA5A50000.
[0100] It can be understood that after receiving the dsp.s file fed back by the Fudan microprocessor according to the data packet request, it is initialized according to the file content of the dsp.s file. After the initialization is completed, the success flag 0xA5A50000 is written to the dual-port RAM address Addr. The indicator light can be used to confirm that the first stage of DSP loading is completed.
[0101] Optionally, in another embodiment of the present application, the specific implementation of initialization according to the dsp.s file in step S103 includes:
[0102] Read the file contents of the dsp.s file to obtain the register configuration data.
[0103] The register configuration data is configuration data written into the register, such as memory clock frequency, delay, and timing parameters.
[0104] Optionally, the register includes but is not limited to: Double Data Rate Synchronous Dynamic Random Access Memory (DDR).
[0105] Initialize according to register configuration data.
[0106] Among them, initialization is performed according to the register configuration data, that is, initialization of itself and DDR is completed according to the register configuration data.
[0107] It can be understood that the dsp.s file is received packet by packet and placed in the internally planned memory. After receiving the dsp.s file, the bootloader program reads the dsp.s file from the memory. The dsp.s file is an S-Record file, which is an ASCII text file used to express binary content. The bootloader program can read the S-Record file, parse and read the DDR configuration data contained in the dsp.s file according to the S-Record file, and write the DDR configuration data to the corresponding DDR control register to initialize the DDR. Specifically, the specific form of the S-Record file is as follows: Figure 3 shown.
[0108] It should be noted that since the DSP does not initialize the DDR memory when it is powered on, it cannot access the DDR memory. Data can only be written to the DDR memory after the DDR is initialized.
[0109] S104: After the success flag is read from the second location of the memory, a software loading request is sent to the Fudan microprocessor.
[0110] Optionally, the second location of the memory includes but is not limited to: the address at the dual-port RAM Addr2.
[0111] It is understandable that after the success flag is read from the second location of the memory, a software loading request is sent to the Fudan microprocessor via the TFTP client, so that the DSP software is subsequently loaded according to the information fed back by the Fudan microprocessor.
[0112] S105: After receiving the target dsp.s file fed back by the Fudan microprocessor according to the software loading request, the DSP software is loaded according to the target dsp.s file.
[0113] The target dsp.s file is a DSP version file having the same file name as the dsp.s file.
[0114] It is understandable that after receiving the target dsp.s file, the bootloader program jumps to the beginning of the application and directly executes the application code, that is, the step of performing DSP software loading.
[0115] For details, see Figure 4The diagram shows a data transmission diagram. When the DSP loading mode is performed, the IP address and the file name of the dsp.s file fed back by the Fudan microprocessor are received. A data packet request is sent to the Fudan microprocessor according to the IP address and the file name of the dsp.s file. The Fudan microprocessor subpackages the dsp.s file and transmits it to the DSP through the TFTP server. When the dsp.s file is received, the DSP sends a message indicating that the data has been successfully received to the Fudan microprocessor. When a success flag is read from the second position of the memory, the DSP sends a software loading request to the Fudan microprocessor. After receiving the DSP data request, the Fudan microprocessor subpackages the target dsp.s file and transmits it to the DSP through the TFTP server.
[0116] S106: When the DSP software is loaded, a success flag is written into the third location of the memory.
[0117] Among them, the memory is a shared memory for handshake communication between Fudan microprocessor and DSP.
[0118] Optionally, the third location of the memory includes but is not limited to: dual-port RAMAddr3 address.
[0119] It is understandable that, when the DSP software is loaded, a success flag is written into the third location of the memory, indicating that the DSP is loaded successfully.
[0120] In summary, the Fudan microprocessor only needs to provide one Ethernet interface, and data transmission is carried out through one Ethernet interface (SGMII network port) to realize DSP loading. Even for processors with fewer network port resources, DSP loading can be successfully completed.
[0121] like Figure 5 FIG. 1 is a flowchart of another DSP loading method based on a Fudan microprocessor provided in an embodiment of the present application, which is applied to a Fudan microprocessor and includes the following steps:
[0122] S501: Send a DSP loading instruction to the DSP, so that the DSP sends a parameter acquisition request according to the DSP loading instruction.
[0123] Among them, before the DSP sends the DSP load instruction, it is necessary to first build the SGMII (Serial Gigabit Media Independent Interface, SGMII) IP core, output the SGMII interface through the processor system (PS) side, and after power-on, initialize the dual-port RAM (i.e. memory) and enable the Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol, DHCP) service and the Trivial File Transfer Protocol (TFTP) service, and set the TFTP IP address.
[0124] Initialize the dual-port RAM because the dual-port RAM is used as the shared memory for the interaction between the Fudan microprocessor and the DSP. Clear the dual-port RAM memory value to zero and put the interaction state between the two parties in a certain initial state.
[0125] Enable the DHCP Server service. This allows the DSP to act as a DHCP client. When the DSP requests an IP address, the Fudan microprocessor, acting as the DHCP server, can assign the DSP the corresponding IP address. Enable the TFTP Server service. This allows the DSP to act as a TFTP client when the DSP sends a software load request. The Fudan microprocessor can respond to the request and transfer data via TFTP. TFTP is an application layer protocol. When transmitting data, it uses IP addresses as the source and destination addresses. Setting the IP address complies with the UDP protocol.
[0126] In short, initializing the dual-port RAM, starting the DHCP Server service, TFTP Server service, and setting the TFTP IP address are all preparations for the subsequent communication between the Fudan microprocessor and DSP and the transmission of DSP data.
[0127] In addition, after initializing the dual-port RAM, enabling the DHCP Server service and TFTP Server service, and setting the TFTP IP address, you also need to bind the Ethernet interrupt and TFTP Server task to any CPU core other than core 0, and monopolize that CPU core to ensure the stability of data transmission during the DSP loading process and prevent interference from other tasks that could cause the TFTP Server to time out.
[0128] S502: When receiving the parameter acquisition request, the IP address and the file name of the dsp.s file are sent to the DSP.
[0129] It is understandable that when a parameter acquisition request is received, the IP address and the file name of the dsp.s file are sent to the DSP via the DHCP server, so that the DSP can subsequently load the DSP according to the IP address and the file name of the dsp.s file.
[0130] S503: When receiving the data packet request fed back by the DSP according to the IP address and the file name of the dsp.s file, the dsp.s file is sent to the DSP, so that the DSP writes a success flag in the first position of the memory according to the dsp.s file.
[0131] It can be understood that when the DSP receives a data packet request based on the IP address and the file name of the dsp.s file, the dsp.s file is sub-packetized and transmitted to the DSP. When the DSP receives the dsp.s file, it feeds back information that the data has been successfully received and writes a success flag in the first position of the memory.
[0132] S504: After the success flag is read from the first position of the memory, a target dsp.s file is determined according to the dsp.s file, and the success flag is written to the second position of the memory.
[0133] The target dsp.s file is a DSP version file with the same file name as the dsp.s file.
[0134] Optionally, a success flag is periodically read from a first location of the memory, and when the success flag is read within a first preset time, a target dsp.s file is determined according to the dsp.s file, and the success flag is written to a second location of the memory.
[0135] It can be understood that the target dsp.s file is determined according to the dsp.s file. Specifically, the DSP version file is first determined according to the dsp.s file; and the target dsp.s file is determined according to the DSP version file.
[0136] Optionally, in another embodiment of the present application, in step S504, a specific implementation method of determining the target dsp.s file is determined according to the dsp.s file, such as Figure 6 As shown, the following steps are included:
[0137] S601: Deleting the dsp.s file from the preset memory.
[0138] It is understood that when transferring files between the Fudan microprocessor and the DSP, the DSP only recognizes the file name "dsp.s." This file name is assigned to the DSP by the Fudan microprocessor acting as a DHCP server. In the embodiment of the present application, DSP loading is divided into two phases: the first phase transfers the configuration parameter file (i.e., the "dsp.s" file), and the second phase transfers the DSP software version file. Both files can only use the file name "dsp.s." To prevent confusion between the first and second phase files, "dsp.s" is deleted first.
[0139] Optionally, before step S601, it is necessary to first store the dsp.s file in a preset memory so that the dsp.s file can be directly obtained from the preset memory later without having to manually load the dsp.s file each time the system is started or updated. Therefore, another embodiment of the present application provides a method for storing a dsp.s file, including:
[0140] Get register configuration data and board location information.
[0141] The board location information indicates which slot the board is located in the chassis. The destination MAC address can be determined based on the board operation information.
[0142] Generate a dsp.s file based on register configuration data and board location information, and store the dsp.s file in a preset memory.
[0143] Optionally, the preset memory includes but is not limited to: eMMC flash.
[0144] It can be understood that the dsp.s file is generated based on the register configuration data and the board location information. Specifically, the dsp.s file in the S-Record format is first generated; the register configuration data and the board location information are written into the dsp.s file; after the information is written, the dsp.s file is stored in the preset memory.
[0145] S602: After the dsp.s file is deleted, the DSP version file is read from the preset memory, and the file name of the DSP version file is modified to the dsp.s file.
[0146] It is understandable that, since the DSP only recognizes the file name dsp.s when transferring files between the Fudan microprocessor and the DSP, it is necessary to change the file name of the DSP version file to dsp.s file.
[0147] S603: After the file name modification is completed, the DSP version file having the same name as the dsp.s file is set as the target dsp.s file.
[0148] In order to distinguish the DSP version file and the dsp.s file after the file name is modified, the DSP version file with the same file name as the dsp.s file is used as the target dsp.s file.
[0149] S505: After receiving the software loading request sent by the DSP according to the success flag, the target dsp.s file is sent to the DSP, so that the DSP writes the success flag in the third location of the memory according to the target dsp.s file.
[0150] When receiving the software loading request sent by the DSP according to the success flag, the target dsp.s file is sent to the DSP so that the DSP loads the DSP according to the target dsp.s file. When the DSP loading is completed, the DSP writes the success flag in the third position of the memory.
[0151] S506: After the success flag is read from the third position of the memory, it is determined that the DSP loading is completed.
[0152] When the success flag is read from the third position of the memory, it indicates that the DSP has completed the DSP loading action, and it is determined that the DSP loading is completed.
[0153] It should be noted that after the DSP is loaded, the target dsp.s file in the preset memory is read, and the name of the target dsp.s file is changed to the original file name, and the status of the DSP is monitored in real time. When the DSP fails, the Fudan microprocessor deletes the target dsp.s file and triggers the DSP reset, and then loads the DSP program again.
[0154] It is important to emphasize that dual-port RAM is used as shared memory between the Fudan microprocessor and the DSP for handshake communication. A total of three handshakes are performed: the first handshake indicates that the DSP's first-stage software has been successfully loaded, the second handshake indicates that the Fudan microprocessor has requested the DSP application software version be loaded, and the third handshake indicates that the DSP software has been successfully loaded in the second stage.
[0155] Optionally, there may be a situation where the success flag cannot be successfully read from the memory. Failure to read the success flag indicates that the DSP loading has failed. In order to ensure that the DSP is successfully loaded, a DSP loading method is provided in another embodiment of the present application, such as Figure 7 As shown, the following steps are included:
[0156] S701: When a success flag is not read from a first location in a memory within a first preset time, it is determined that the DSP loading fails.
[0157] Optionally, the first preset time includes but is not limited to: 3 minutes.
[0158] S702: When the success flag is not read from the third position of the memory within the second preset time, it is determined that the DSP loading fails, and the dsp.s file in the preset memory is deleted.
[0159] Optionally, the second preset time includes but is not limited to: 5 minutes.
[0160] S703: If the DSP loading fails, the process returns to executing the step of sending a DSP loading instruction to the DSP, so that the DSP sends a parameter acquisition request according to the DSP loading instruction, until the DSP loading is completed.
[0161] It is understandable that if the DSP loading fails, the DSP is triggered to reset again and the DSP loading step is re-executed, that is, returning to the step of sending the DSP loading instruction to the DSP so that the DSP sends a parameter acquisition request according to the DSP loading instruction until the DSP loading is completed.
[0162] In summary, using dual-port RAM as shared memory between the Fudan microprocessor and the DSP for handshake communication during DSP loading allows both to access the shared memory simultaneously without having to wait for the other to complete operations. This effectively improves data transmission efficiency and speed. Furthermore, the Fudan microprocessor only needs to provide one Ethernet interface, and data transmission is carried out through one Ethernet interface (SGMII network port) to achieve DSP loading. Even processors with limited network port resources can successfully complete DSP loading.
[0163] like Figure 8 FIG. 1 is a schematic diagram of the architecture of a DSP loading platform provided in an embodiment of the present application, including:
[0164] Fudan microprocessor 100 and DSP200, wherein the information interaction process between Fudan microprocessor 100 and DSP200 is as follows: Figure 9 As shown, the following steps are included:
[0165] S901: The Fudan microprocessor sends a DSP loading instruction to the DSP.
[0166] It should be noted that the specific implementation of step S901 can refer to step S501 accordingly, and will not be repeated here.
[0167] S902: After receiving the DSP loading instruction, the DSP sends a parameter acquisition request to the Fudan microprocessor.
[0168] It should be noted that the specific implementation of step S902 can refer to step S101 accordingly, and will not be repeated here.
[0169] S903: After receiving the parameter acquisition request, the Fudan microprocessor sends the IP address and the file name of the dsp.s file to the DSP.
[0170] It should be noted that the specific implementation of step S903 can refer to step S502 accordingly, and will not be repeated here.
[0171] S904: After receiving the IP address and the file name of the dsp.s file, the DSP sends a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file.
[0172] It should be noted that the specific implementation of step S904 can refer to step S102 accordingly, and will not be repeated here.
[0173] S905: After receiving the data packet request, the Fudan microprocessor sends the dsp.s file to the DSP.
[0174] It should be noted that the specific implementation of step S905 can refer to step S503 accordingly, and will not be repeated here.
[0175] S906: After receiving the dsp.s file, the DSP performs initialization according to the dsp.s file, and writes a success flag to the first location of the memory after the initialization is completed.
[0176] It should be noted that the specific implementation of step S906 may refer to step S103 accordingly, and will not be repeated here.
[0177] S907: After reading the success flag from the first location of the memory, the Fudan microprocessor determines the target dsp.s file according to the dsp.s file, and writes the success flag to the second location of the memory.
[0178] It should be noted that the specific implementation of step S907 may refer to step S504 accordingly, and will not be repeated here.
[0179] S908: After reading the success flag from the second location of the memory, the DSP sends a software loading request to the Fudan microprocessor.
[0180] It should be noted that the specific implementation of step S908 can refer to step S104 accordingly, and will not be repeated here.
[0181] S909: After receiving the software loading request, the Fudan microprocessor sends the target dsp.s file to the DSP.
[0182] It should be noted that the specific implementation of step S909 can refer to step S505 accordingly, and will not be repeated here.
[0183] S910: After receiving the target dsp.s file, the DSP loads the DSP software according to the target dsp.s file.
[0184] It should be noted that the specific implementation of step S910 may refer to step S105 accordingly, and will not be repeated here.
[0185] S911: When the DSP software is loaded, the DSP writes a success flag in the third location of the memory.
[0186] It should be noted that the specific implementation of step S911 can refer to step S106 accordingly, and will not be repeated here.
[0187] S912: After reading the success flag from the third location of the memory, the Fudan microprocessor determines that the DSP loading is completed.
[0188] It should be noted that the specific implementation of step S912 can refer to step S506 accordingly, and will not be repeated here.
[0189] Combine Figure 9 For the contents shown, see Figure 10 The schematic diagram of the DSP loading process is shown. The DSP's DHCP client sends a parameter acquisition request to the Fudan microprocessor. After receiving the parameter acquisition request, the Fudan microprocessor sends the IP address and the file name of the dsp.s file to the DSP through the DHCP server. The DSP transfers data with the TFTP server through the TETP client to complete the DSP loading. The DSP and the Fudan microprocessor determine whether the DSP loading is complete by reading / writing messages to the dual-port RAM.
[0190] Combine Figure 9 For the contents shown, see Figure 11 The diagram shows the DSP loading process. The Fudan microprocessor includes an SDMMC interface, a DDR3 interface, and an SGMII interface. An SGMII IP core is built on the PL side of the Fudan microprocessor, and an SGMII network port is exposed through the PS side. The DSP includes an SGMII interface and a DDR3 interface, and data is transmitted through these two SGMII interfaces.
[0191] In summary, using dual-port RAM as shared memory between the Fudan microprocessor and the DSP for handshake communication during DSP loading allows both to access the shared memory simultaneously without having to wait for the other to complete operations. This effectively improves data transmission efficiency and speed. Furthermore, the Fudan microprocessor only needs to provide one Ethernet interface, and data transmission is carried out through one Ethernet interface (SGMII network port) to achieve DSP loading. Even processors with limited network port resources can successfully complete DSP loading.
[0192] like Figure 12 As shown, it is a schematic diagram of the architecture of a DSP loading device based on a Fudan microprocessor provided in an embodiment of the present application, which is applied to a DSP. The DSP loading device includes: a first sending unit 1201, a second sending unit 1202, an initialization unit 1203, a reading unit 1204, a loading unit 1205 and a writing unit 1206.
[0193] The first sending unit 1201 is configured to send a parameter acquisition request to the Fudan microprocessor when receiving a DSP loading instruction.
[0194] The first sending unit 1201 is specifically used to: when receiving a DSP load instruction sent by the Fudan microprocessor, identify the DSP load instruction and obtain a reset instruction; perform a reset operation according to the reset instruction; after the reset operation is completed, determine the Ethernet interface according to the level of the GPIO pin in the reset instruction; and send a parameter acquisition request to the Fudan microprocessor through the Ethernet interface.
[0195] The second sending unit 1202 is configured to send a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file when receiving the IP address and the file name of the dsp.s file fed back by the Fudan microprocessor according to the parameter acquisition request.
[0196] The second sending unit 1202 is specifically configured to: establish a file transfer network with the Fudan microprocessor according to the IP address; and send a data packet request to the Fudan microprocessor according to the file name of the dsp.s file in the file transfer network.
[0197] The initialization unit 1203 is used to initialize according to the dsp.s file after receiving the dsp.s file fed back by the Fudan microprocessor according to the data packet request, and after the initialization is completed, write a success flag to the first position of the memory so that the Fudan microprocessor writes a success flag to the second position of the memory according to the success flag.
[0198] The initialization unit 1203 is specifically configured to: read the file content of the dsp.s file to obtain register configuration data; and perform initialization according to the register configuration data.
[0199] The reading unit 1204 is configured to send a software loading request to the Fudan microprocessor after reading the success flag from the second location of the memory.
[0200] The loading unit 1205 is used to load the DSP software according to the target dsp.s file after receiving the target dsp.s file fed back by the Fudan microprocessor according to the software loading request; the target dsp.s file is a DSP version file with the same file name as the dsp.s file.
[0201] The writing unit 1206 is used to write a success flag in the third location of the memory after the DSP software is loaded; the memory is a shared memory for handshake communication between the Fudan microprocessor and the DSP.
[0202] In summary, the Fudan microprocessor only needs to provide one Ethernet interface, and data transmission is carried out through one Ethernet interface (SGMII network port) to realize DSP loading. Even for processors with fewer network port resources, DSP loading can be successfully completed.
[0203] like Figure 13 As shown, it is a schematic diagram of the architecture of another DSP loading device based on a Fudan microprocessor provided in an embodiment of the present application, which is applied to a Fudan microprocessor. The DSP loading device includes: a first sending unit 1301, a second sending unit 1302, a third sending unit 1303, a determination unit 1304, a fourth sending unit 1305 and a data determination unit 1306.
[0204] The first sending unit 1301 is configured to send a DSP loading instruction to the DSP, so that the DSP sends a parameter acquisition request according to the DSP loading instruction.
[0205] The second sending unit 1302 is configured to send the IP address and the file name of the dsp.s file to the DSP when receiving the parameter acquisition request.
[0206] The third sending unit 1303 is configured to send the dsp.s file to the DSP upon receiving a data packet request fed back by the DSP according to the IP address and the file name of the dsp.s file, so that the DSP writes a success flag in the first position of the memory according to the dsp.s file.
[0207] The determining unit 1304 is configured to determine a target dsp.s file according to the dsp.s file after reading the success flag from the first location of the memory, and write the success flag to the second location of the memory; the target dsp.s file is a DSP version file having the same file name as the dsp.s file.
[0208] The determining unit 1304 is specifically used to: delete the dsp.s file from the preset memory; when the dsp.s file is deleted, read the DSP version file from the preset memory and modify the file name of the DSP version file to the dsp.s file; when the file name modification is completed, use the DSP version file with the same file name as the dsp.s file as the target dsp.s file.
[0209] The fourth sending unit 1305 is configured to send the target dsp.s file to the DSP after receiving the software loading request sent by the DSP according to the success flag, so that the DSP writes the success flag in the third location of the memory according to the target dsp.s file.
[0210] The data determination unit 1306 is configured to determine that the DSP loading is completed after a success flag is read from the third location of the memory.
[0211] In summary, using dual-port RAM as shared memory between the Fudan microprocessor and the DSP for handshake communication during DSP loading allows both to access the shared memory simultaneously without having to wait for the other to complete operations. This effectively improves data transmission efficiency and speed. Furthermore, the Fudan microprocessor only needs to provide one Ethernet interface, and data transmission is carried out through one Ethernet interface (SGMII network port) to achieve DSP loading. Even processors with limited network port resources can successfully complete DSP loading.
[0212] Preferably, combined Figure 13 As shown in the figure, the DSP loading device further includes: an acquisition unit and a production unit.
[0213] An acquisition unit, used to obtain register configuration data and board location information;
[0214] The generating unit is used to generate a dsp.s file based on register configuration data and board location information, and store the dsp.s file in a preset memory.
[0215] Preferably, combined Figure 13 As shown in the content, the DSP loading device also includes: an information determination unit, a deletion unit, and a return unit.
[0216] an information determining unit, configured to determine that the DSP loading has failed if a success flag is not read from a first location of the memory within a first preset time;
[0217] a deleting unit, configured to determine that the DSP loading has failed and delete the dsp.s file in the preset memory when a success flag is not read from the third location of the memory within a second preset time;
[0218] The return unit is used to return to the step of sending a DSP loading instruction to the DSP if the DSP loading fails, so that the DSP sends a parameter acquisition request according to the DSP loading instruction until the DSP loading is completed.
[0219] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Ordinary technicians in this field can understand and implement it without expending creative work.
[0220] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0221] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A DSP loading method based on Fudan microprocessor, characterized in that: Applied to DSP, including: When receiving the DSP load instruction, it sends a parameter acquisition request to the Fudan microprocessor; When receiving the IP address and the file name of the dsp.s file fed back by the Fudan microprocessor according to the parameter acquisition request, sending a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file; After receiving the dsp.s file fed back by the Fudan microprocessor according to the data packet request, initializing according to the dsp.s file, and after the initialization is completed, writing a success flag to the first position of the memory, so that the Fudan microprocessor writes the success flag to the second position of the memory according to the success flag; After reading the success flag from the second position of the memory, sending a software loading request to the Fudan microprocessor; After receiving the target dsp.s file fed back by the Fudan microprocessor according to the software loading request, the DSP software is loaded according to the target dsp.s file; the target dsp.s file is a DSP version file with the same file name as the dsp.s file; When the DSP software is loaded, the success flag is written into the third location of the memory; the memory is a shared memory for handshake communication between the Fudan microprocessor and the DSP.
2. The method according to claim 1, characterized in that When the DSP load instruction is received, a parameter acquisition request is sent to the Fudan microprocessor, including: When receiving the DSP load instruction sent by the Fudan microprocessor, identifying the DSP load instruction and obtaining a reset instruction; Execute a reset operation according to the reset instruction; When the reset operation is completed, determining the Ethernet interface according to the level of the GPIO pin in the reset instruction; A parameter acquisition request is sent to the Fudan microprocessor through the Ethernet interface.
3. The method according to claim 1, characterized in that The step of sending a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file comprises: Establishing a file transfer network with the Fudan microprocessor according to the IP address; In the file transfer network, a data packet request is sent to the Fudan microprocessor according to the file name of the dsp.s file.
4. The method according to claim 1, wherein The initialization according to the dsp.s file includes: Read the file content of the dsp.s file to obtain register configuration data; Initialization is performed according to the register configuration data.
5. A DSP loading method based on Fudan microprocessor, characterized in that: Applied to Fudan microprocessors, including: Sending a DSP load instruction to the DSP, so that the DSP sends a parameter acquisition request according to the DSP load instruction; When receiving the parameter acquisition request, sending the IP address and the file name of the dsp.s file to the DSP; When receiving a data packet request fed back by the DSP according to the IP address and the file name of the dsp.s file, sending the dsp.s file to the DSP, so that the DSP writes a success flag in the first position of the memory according to the dsp.s file; After the success flag is read from the first position of the memory, a target dsp.s file is determined according to the dsp.s file, and the success flag is written to the second position of the memory; the target dsp.s file is a DSP version file with the same file name as the dsp.s file; After receiving the software loading request sent by the DSP according to the success flag, sending the target dsp.s file to the DSP, so that the DSP writes the success flag in the third location of the memory according to the target dsp.s file; When the success flag is read from the third location of the memory, it is determined that the DSP loading is completed.
6. The method according to claim 5, characterized in that The step of determining a target dsp.s file according to the dsp.s file comprises: Deleting the dsp.s file from the preset memory; After the dsp.s file is deleted, the DSP version file is read from the preset memory, and the file name of the DSP version file is modified to the dsp.s file; After the file name modification is completed, the DSP version file having the same file name as the dsp.s file is used as the target dsp.s file.
7. The method according to claim 6, characterized in that Before deleting the dsp.s file from the preset memory, the method further comprises: Get register configuration data and board location information; The dsp.s file is generated based on the register configuration data and the board location information, and the dsp.s file is stored in a preset memory.
8. The method according to claim 5, characterized in that Also includes: When the success flag is not read from the first location of the memory within a first preset time, determining that the DSP loading has failed; When the success flag is not read from the third location of the memory within the second preset time, it is determined that the DSP loading fails, and the dsp.s file in the preset memory is deleted; If the DSP loading fails, the process returns to executing the step of sending a DSP loading instruction to the DSP so that the DSP sends a parameter acquisition request according to the DSP loading instruction until the DSP loading is completed.
9. A DSP loading device based on Fudan microprocessor, characterized in that: Applied to DSP, including: The first sending unit is used to send a parameter acquisition request to the Fudan microprocessor when receiving the DSP loading instruction; A second sending unit is configured to send a data packet request to the Fudan microprocessor according to the IP address and the file name of the dsp.s file when receiving the IP address and the file name of the dsp.s file fed back by the Fudan microprocessor according to the parameter acquisition request; an initialization unit for, upon receiving the dsp.s file fed back by the Fudan microprocessor according to the data packet request, performing initialization according to the dsp.s file, and after the initialization is completed, writing a success flag to a first location of a memory, so that the Fudan microprocessor writes the success flag to a second location of the memory according to the success flag; A reading unit, configured to send a software loading request to the Fudan microprocessor after reading the success flag from the second location of the memory; A loading unit is configured to load DSP software according to the target dsp.s file after receiving the target dsp.s file fed back by the Fudan microprocessor according to the software loading request; the target dsp.s file is a DSP version file with the same file name as the dsp.s file; A writing unit is used to write the success flag into the third location of the memory after the DSP software is loaded; the memory is a shared memory for handshake communication between the Fudan microprocessor and the DSP.
10. A DSP loading device based on Fudan microprocessor, characterized in that: Applied to Fudan microprocessors, including: A first sending unit, configured to send a DSP loading instruction to the DSP, so that the DSP sends a parameter acquisition request according to the DSP loading instruction; A second sending unit is configured to send an IP address and a file name of a dsp.s file to the DSP when receiving the parameter acquisition request; a third sending unit, configured to, upon receiving a data packet request fed back by the DSP according to the IP address and the file name of the dsp.s file, send the dsp.s file to the DSP, so that the DSP writes a success flag in a first position of a memory according to the dsp.s file; a determining unit configured to, after reading the success flag from the first location of the memory, determine a target dsp.s file based on the dsp.s file and write the success flag to a second location of the memory; the target dsp.s file being a DSP version file having the same file name as the dsp.s file; a fourth sending unit, configured to, upon receiving a software loading request sent by the DSP according to the success flag, send the target dsp.s file to the DSP, so that the DSP writes a success flag in a third location of the memory according to the target dsp.s file; The data determination unit is configured to determine that the DSP loading is completed after the success flag is read from the third position of the memory.
Citation Information
Patent Citations
Method and device for loading digital signal processor
CN102890635A
Ethernet loading method of DSP and FPGA and signal processing system
CN108153561A