A method and device for symmetric loading and running of DSP programs
By adding LOAD and GO modules to the DSP program, the symmetric loading and operation of the program is achieved, solving the problem of too long debugging in the existing technology, and efficient program debugging is achieved.
Patent Information
- Application Number
- CN202111330900.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-11-11
AI Technical Summary
In DSP development, the existing technology requires continuous reloading of running programs to locate target problems, resulting in too long debugging.
Adding LOAD modules and GO modules to the program generates a debugging program, compiling it into the first target program, and modifying the memory start address of the link file to generate the second target program, loading it through the LOAD module and jumping it to run it by the GO module, realizing unlimited calls to the first target program and the second target program.
It effectively saves a lot of debugging time and improves the efficiency of program positioning target problems.
Smart Images

Figure CN114035920B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a program loading technology, and in particular, to a method for symmetrically loading and running a DSP program. The present application also relates to an apparatus for symmetrically loading and running a DSP program. Background Art
[0002] In an embedded system, if there is no operating system, programmers usually need to directly face the bare machine and bare devices when writing programs. In this case, the embedded program is usually divided into two parts, namely the foreground program and the background program.
[0003] In DSP (Digital Signal Processor) development, a foreground-background design scheme is generally adopted, and a product is designed according to functional requirements to complete all functions. In the early stage of the project, an emulator is generally used as the main debugging means. When the product completes system integration, the device generally only retains the debugging serial port for upgrading the program.
[0004] When a problem occurs during the system integration stage of the product and needs to be analyzed, it can only be analyzed through the existing print information output by the debugging serial port, unless the target program in the FLASH is modified to locate the target problem. And modifying the target program in the FLASH to locate the target problem requires continuously reloading and running the program, and the target problem is located through continuous iteration. Summary of the Invention
[0005] To solve the problem that the current technical solution requires continuously reloading and running the program to locate the target problem, the present application proposes a method for symmetrically loading and running a DSP program. The present application also provides an apparatus for symmetrically loading and running a DSP program.
[0006] The present application provides a method for symmetrically loading and running a DSP program, including:
[0007] Adding a LOAD module and a GO module to the program to generate a debugging program, and compiling the debugging program to obtain a first target program;
[0008] Modifying the memory start address of the link file in the debugging program to generate a modified debugging program, and compiling the modified debugging program to obtain a second target program;
[0009] Loading and running the first target program, and loading the second target program into the corresponding memory according to the LOAD module in the first target program, and jumping to the second target program to run according to the GO module in the first target program.
[0010] Optionally, it further includes:
[0011] The first target program is loaded into the corresponding memory according to the LOAD module in the second target program, and the second target program is jumped to for running according to the GO module in the second target program.
[0012] Optionally, the LOAD module and the GO module are used by the host computer to control the execution of the first target program through the serial port.
[0013] Optionally, it further includes:
[0014] The LOAD module and the GO module are integrated in the form of a static library LIB.
[0015] Optionally, the jumping to the second target program for running includes:
[0016] The GO module parses the BIN file of the second target program, and parses each segment of the BIN file into the corresponding address space;
[0017] Jump to the second target program for running.
[0018] This application also provides a device for symmetric loading and running of a DSP program, including:
[0019] A first setting module, used to add a LOAD module and a GO module to the program to generate a debug program, and compile the debug program to obtain a first target program;
[0020] A second setting module, used to modify the memory start address of the link file in the debug program to generate a modified debug program, and compile the modified debug program to obtain a second target program;
[0021] A symmetric loading module, used to load and run the first target program, and load the second target program into the corresponding memory according to the LOAD module in the first target program, and jump to the second target program for running according to the GO module in the first target program.
[0022] Optionally, the loading module is further used for:
[0023] Loading the first target program into the corresponding memory according to the LOAD module in the second target program, and jumping to the first target program for running according to the GO module in the second target program.
[0024] Optionally, the LOAD module and the GO module are used by the host computer to control the execution of the first target program through the serial port.
[0025] Optionally, the LOAD module and the GO module are integrated in the form of a static library LIB.
[0026] Optionally, the jump to the second target program for execution includes:
[0027] The GO module parses the BIN file of the second target program and parses each segment of the BIN file into the corresponding address space;
[0028] Jump to the second target program for execution.
[0029] The difference between this application and the prior art is:
[0030] This application provides a method for symmetric loading and execution of a DSP program, including: adding a LOAD module and a GO module to the program to generate a debug program, compiling the debug program to obtain a first target program; modifying the memory start address of the link file in the debug program to generate a modified debug program, and compiling the modified debug program to obtain a second target program; loading and executing the first target program, and loading the second target program into the corresponding memory according to the LOAD module in the first target program, and jumping to the second target program for execution according to the GO module in the first target program. Through the mutual call of the first target program and the second target program, unlimited reloading and execution can be achieved, which can effectively save a large amount of debugging time. Description of the Drawings
[0031] Figure 1 It is the flow chart of symmetric loading and execution of the DSP program in this application.
[0032] Figure 2 It is the flow chart of the GO module loading the program in this application.
[0033] Figure 3 It is the schematic diagram of the device for symmetric loading and execution of the DSP program in this application. Detailed Embodiments
[0034] The following content is all examples of the specific implementation process provided to detail the technical solution to be protected by this application. However, this application can also be implemented in other ways different from the described ones. Those skilled in the art can implement this application by using different technical means under the guidance of the concept of this application. Therefore, this application is not limited by the following specific embodiments.
[0035] The present application provides a method for symmetrically loading and running a DSP program, including: adding a LOAD module and a GO module to a program to generate a debug program, and compiling the debug program to obtain a first target program; modifying the memory start address of the link file in the debug program to generate a modified debug program, and compiling the modified debug program to obtain a second target program; loading and running the first target program, and loading the second target program into the corresponding memory according to the LOAD module in the first target program, and jumping to the second target program to run according to the GO module in the first target program. By means of mutual calls between the first target program and the second target program, unrestricted reloading and running can be achieved, which can effectively save a large amount of debugging time.
[0036] Figure 1 It is the flow chart of symmetrically loading and running the DSP program in the present application.
[0037] Please refer to Figure 1 As shown, in S101, a LOAD module and a GO module are added to the program to generate a debug program, and the debug program is compiled to obtain a first target program.
[0038] The program in the present application is a program designed according to functional requirements in DPS development, and it is the program that needs to be debugged after the system integration is completed.
[0039] Specifically, the program is stored in a non-volatile storage medium. When the program needs to be run, it needs to be loaded into the memory first for further execution.
[0040] Before the program is loaded into the memory, first, a LOAD module and a GO module are added on the basis of the original functions of the program to generate a debug program for debug running.
[0041] The LOAD module is a section of loading code for loading other programs into the memory during the running process of the program itself, and the GO module is a section of calling code for calling other programs to run during the running process of the program itself. The LOAD module and the GO module are integrated in the form of a static library LIB.
[0042] Then, the debug program is compiled into a first target program for loading and running.
[0043] Please refer to Figure 1 As shown, in S102, the memory start address of the link file in the debug program is modified to generate a modified debug program, and the modified debug program is compiled to obtain a second target program.
[0044] The second target program is mostly the same as the first target program, and the difference is that the loading addresses of the first target program and the second target program are different.
[0045] Specifically, after the first target program is generated, a copy of the debugging program will be saved, and then the memory starting address in the connection file of the saved debugging program will be modified to generate a modified debugging program. Then, the modified memory address is compiled to generate a second target program. It should be noted that the memory addresses of the first target file and the second target file in this application are different and do not overlap.
[0046] Please refer to Figure 1 As shown, load and run the first target program, and load the second target program into the corresponding memory according to the LOAD module in the first target program, and jump to the second target program to run according to the GO module of the first target program.
[0047] After the compilation of the first target program and the second target program is completed, the next step is to start running and make mutual calls.
[0048] Specifically, first burn the first target file into the FLASH, turn on the power to start, and start running the first target program. During this process, the DSP program communicates with the host computer through the serial port. Preferably, according to the instructions of the host computer, it loads the second target program through the LOAD module. Those skilled in the art can also set other methods to provide an instruction to start loading for the LOAD module to load the second target program.
[0049] When the LOAD performs the loading, it needs to retrieve the second target program and load it into the corresponding memory for the second target program to run.
[0050] Finally, call the second target program through the GO module and jump to the second target program to run.
[0051] Figure 2 It is the flowchart of the GO module loading program in this application.
[0052] Please refer to Figure 2 As shown, in S201, the GO module parses the BIN file of the second target program and parses each segment of the BIN file into the corresponding address space.
[0053] The BIN file mainly records the following parts: starting address, data length, check code, and data. The BIN is not a simple copy of the memory program space. It is necessary to parse the content it contains according to the BIN format before it can be loaded and run.
[0054] Please refer to Figure 2 As shown, in S202, jump to the second target program to run.
[0055] Further, when running the second target program, it is also possible to jump to the first target program using the same method. Load the first target program into the corresponding memory according to the LOAD module in the second target program, and jump to the first target program to run according to the GO module of the second target program.
[0056] The present application also provides a device for symmetric loading and running of DSP programs, corresponding to the method for symmetric loading and running of DSP programs described above, including: a first setting module 301, a second setting module 302, and a symmetric loading module 303.
[0057] Figure 3 It is a schematic diagram of the device for symmetric loading and running of DSP programs in the present application.
[0058] Please refer to Figure 3 As shown, the first setting module 301 is used to add a LOAD module and a GO module to the program to generate a debug program, and compile the debug program to obtain a first target program.
[0059] The program in the present application is a program designed according to functional requirements in DPS development, and it is the program that needs to be debugged after the system integration is completed.
[0060] Specifically, the program is stored in a non-volatile storage medium. When the program needs to be run, it needs to be loaded into the memory first for further execution.
[0061] Before the program is loaded into the memory, first, based on the original function of the program, a LOAD module and a GO module are added to generate a debug program for debugging and running.
[0062] The LOAD module is a piece of loading code used to load other programs into the memory during the running process of its own program, and the GO module is a piece of calling code used to call other programs to run during the running process of its own program. The LOAD module and the GO module are integrated in the form of a static library LIB.
[0063] Then, compile the debug program into a first target program for loading and running.
[0064] Please refer to Figure 3 As shown, the second setting module 302 is used to modify the memory start address of the link file in the debug program to generate a modified debug program, and compile the modified debug program to obtain a second target program.
[0065] The second target program is mostly the same as the first target program, and the difference is that the loading addresses of the first target program and the second target program are different.
[0066] Specifically, after the first target program is generated, a copy of the debug program will be saved, and then the memory start address in the connection file of the saved debug program will be modified to generate a modified debug program. Then, the modified memory address is compiled to generate a second target program. It should be noted that the memory addresses of the first target file and the second target file in this application are different and do not overlap.
[0067] Please refer to Figure 3 As shown, the symmetric loading module 303 is used to load and run the first target program, and load the second target program into the corresponding memory according to the LOAD module in the first target program, and jump to the second target program to run according to the GO module of the first target program.
[0068] After the compilation of the first target program and the second target program is completed, the running will start next, and mutual calls will be made.
[0069] Specifically, first burn the first target file into the FLASH, turn on the power to start, and start running the first target program. During this process, the DSP program communicates with the host computer through the serial port. Preferably, according to the instructions of the host computer, it loads the second target program through the LOAD module. Those skilled in the art can also set other methods to provide an instruction to start loading for the LOAD module to load the second target program.
[0070] For the LOAD to perform the loading, it is necessary to retrieve the second target program and load it into the corresponding memory for the second target program to run.
[0071] Finally, the second target program is called through the GO module, and the jump is made to the second target program to run.
[0072] Please refer to Figure 2 As shown, in S201, the GO module parses the BIN file of the second target program, and parses each segment of the BIN file into the corresponding address space.
[0073] The BIN file mainly records the following parts, namely: start address, data length, check code and data. The BIN is not a simple copy of the memory program space. It is necessary to parse the content it contains according to the BIN format before it can be loaded and run.
[0074] S202 jumps to the second target program to run.
[0075] Further, the loading module is also used to, when running the second target program, jump to the first target program in the same way. Load the first target program into the corresponding memory according to the LOAD module in the second target program, and jump to the first target program to run according to the GO module of the second target program.
Claims
1. A method for symmetric loading and running of DSP programs, characterized in that Including: Adding LOAD module code and GO module code to the program to generate a debug program, and compiling the debug program to obtain a first target program; Modifying the memory start address of the link file in the debug program to generate a modified debug program, and compiling the modified debug program to obtain a second target program; Loading and running the first target program, loading the second target program into the corresponding memory according to the LOAD module code in the first target program, and jumping to the second target program to run according to the GO module code in the first target program; Loading the first target program into the corresponding memory according to the LOAD module code in the second target program, and jumping to the first target program to run according to the GO module code in the second target program.
2. The method for symmetrically loading and running a DSP program according to claim 1, characterized in that, The LOAD module code and GO module code are used by the host computer to control the execution of the first target program through the serial port.
3. The method for symmetrically loading and running a DSP program according to claim 1, characterized in that Also including: The LOAD module code and GO module code are integrated in the form of a static library LIB.
4. The method for symmetric loading and running of the DSP program according to claim 1, characterized in that, The jumping to the second target program to run includes: The GO module code parses the BIN file of the second target program, and parses each segment of the BIN file into the corresponding address space; Jumping to the second target program to run.
5. A device for symmetrically loading and running a DSP program, characterized in that, Including: A first setting module, which is used to add LOAD module code and GO module code to the program to generate a debug program, and compile the debug program to obtain a first target program; A second setting module, which is used to modify the memory start address of the link file in the debug program to generate a modified debug program, and compile the modified debug program to obtain a second target program; A symmetric loading module, which is used to load and run the first target program, load the second target program into the corresponding memory according to the LOAD module code in the first target program, jump to the second target program to run according to the GO module code in the first target program, and load the first target program into the corresponding memory according to the LOAD module code in the second target program, and jump to the first target program to run according to the GO module code in the second target program.
6. The device for symmetrically loading and running a DSP program according to claim 5, wherein The LOAD module code and GO module code are used by the host computer to control the execution of the first target program through the serial port.
7. The device for symmetrically loading and running the DSP program according to claim 6, characterized in that, The LOAD module code and GO module code are integrated in the form of a static library LIB.
8. The device for symmetrically loading and running the DSP program according to claim 6, characterized in that The jumping to the second target program to run includes: The GO module code parses the BIN file of the second target program, and parses each segment of the BIN file into the corresponding address space; Jumping to the second target program to run.
Citation Information
Patent Citations
Software loading and storing method under embedded asymmetric multiprocessing architecture
CN102637134A
Debugging method and debugging system for embedded system
CN104503905A