CN114035920A - Method and device for symmetric loading and running of DSP (digital Signal processor) program - Google Patents

Method and device for symmetric loading and running of DSP (digital Signal processor) program Download PDF

Info

Publication number
CN114035920A
CN114035920A CN202111330900.9A CN202111330900A CN114035920A CN 114035920 A CN114035920 A CN 114035920A CN 202111330900 A CN202111330900 A CN 202111330900A CN 114035920 A CN114035920 A CN 114035920A
Authority
CN
China
Prior art keywords
program
target program
module
loading
target
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
CN202111330900.9A
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.)
Tianjin Embedtec Co Ltd
Original Assignee
Tianjin Embedtec Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Embedtec Co Ltd filed Critical Tianjin Embedtec Co Ltd
Priority to CN202111330900.9A priority Critical patent/CN114035920A/en
Publication of CN114035920A publication Critical patent/CN114035920A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Abstract

The application provides a method for symmetric loading and running of a DSP program, which comprises the following steps: adding a LOAD module and a GO module in a program to generate a debugging program, and compiling the debugging program to obtain a first target program; modifying the memory initial 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; and loading and operating the first target program, loading the second target program into a corresponding memory according to a LOAD module in the first target program, and jumping to the second target program for operation according to a GO module of the first target program. The first target program and the second target program are mutually called, so that unlimited reloading operation is not realized, and a large amount of debugging time can be effectively saved. The application also provides a device for symmetrically loading and operating the DSP program.

Description

Method and device for symmetric loading and running of DSP (digital Signal processor) program
Technical Field
The present application relates to program loading technologies, and in particular, to a method for symmetric loading and running of a DSP program. The application also relates to a device for symmetrically loading and operating the DSP program.
Background
In embedded systems, programmers typically need to face directly with bare machines and bare devices if there is no operating system. In this case, the embedded program is usually divided into two parts, i.e., a foreground program and a background program.
In the development of a Digital Signal Processor (DSP), a foreground and background design scheme is generally adopted to design a product according to functional requirements, and all functions are completed. In the early stage of the project, a simulator is generally adopted as a main debugging means, and when the product completes system integration, the equipment generally only keeps a debugging serial port as an upgrading program for use.
When a product has problems in the system integration stage and needs to be analyzed, the analysis can be performed only by debugging the existing printing information output by the serial port, unless the target program in the FLASH is modified to position the target problem, but the target program in the FLASH is modified to position the target problem, the running program needs to be continuously reloaded, and the target positioning problem is continuously completed through iteration.
Disclosure of Invention
In order to solve the problem that the running program needs to be continuously reloaded to position the target in the prior art, the application provides a method for symmetrically loading and running the DSP program. The application also provides a device for symmetrically loading and operating the DSP program.
The application provides a method for symmetric loading and running of a DSP program, which comprises the following steps:
adding a LOAD module and a GO module in a program to generate a debugging program, and compiling the debugging program to obtain a first target program;
modifying the memory initial 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;
and loading and operating the first target program, loading the second target program into a corresponding memory according to a LOAD module in the first target program, and jumping to the second target program for operation according to a GO module of the first target program.
Optionally, the method further includes:
and loading the first target program into a corresponding memory according to the LOAD module in the second target program, and jumping to the first target program for operation according to the GO module of the second target program.
Optionally, the LOAD module and the GO module are executed by the first object program controlled by the upper computer through a serial port.
Optionally, the method further includes:
the LOAD module and the GO module are integrated in a static library LIB mode.
Optionally, the jumping to the second target program operation includes:
the GO module analyzes the BIN file of the second target program and analyzes each segment of the BIN file to a corresponding address space;
and jumping to the second target program for running.
The application also provides a device for symmetric loading and running of the DSP program, which comprises:
the first setting module is used for adding a LOAD module and a GO module in a program to generate a debugging program, and compiling the debugging program to obtain a first target program;
the second setting module is used for modifying the memory starting 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;
and the symmetrical loading module is used for loading and operating the first target program, loading the second target program into a corresponding memory according to a LOAD module in the first target program, and jumping to the second target program for operation according to the GO module of the first target program.
Optionally, the loading module is further configured to:
and loading the first target program into a corresponding memory according to the LOAD module in the second target program, and jumping to the first target program for operation according to the GO module of the second target program.
Optionally, the LOAD module and the GO module are executed by the first object program controlled by the upper computer through a serial port.
Optionally, the LOAD module and the GO module are integrated by means of a static library LIB.
Optionally, the jumping to the second target program operation includes:
the GO module analyzes the BIN file of the second target program and analyzes each segment of the BIN file to a corresponding address space;
and jumping to the second target program for running.
The difference of this application compared with prior art is:
the application provides a method for symmetric loading and running of a DSP program, which comprises the following steps: adding a LOAD module and a GO module in a program to generate a debugging program, and compiling the debugging program to obtain a first target program; modifying the memory initial 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; and loading and operating the first target program, loading the second target program into a corresponding memory according to a LOAD module in the first target program, and jumping to the second target program for operation according to a GO module of the first target program. The first target program and the second target program are mutually called, so that unlimited reloading operation is not realized, and a large amount of debugging time can be effectively saved.
Drawings
Fig. 1 is a flowchart of symmetric loading operation of a DSP program in the present application.
FIG. 2 is a flowchart of the GO module loading routine of the present application.
Fig. 3 is a schematic diagram of an apparatus for symmetric loading and running of a DSP program in the present application.
Detailed Description
The following is an example of a specific implementation process provided for explaining the technical solutions to be protected in the present application in detail, but the present application may also be implemented in other ways than those described herein, and a person skilled in the art may implement the present application by using different technical means under the guidance of the idea of the present application, so that the present application is not limited by the following specific embodiments.
The application provides a method for symmetric loading and running of a DSP program, which comprises the following steps: adding a LOAD module and a GO module in a program to generate a debugging program, and compiling the debugging program to obtain a first target program; modifying the memory initial 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; and loading and operating the first target program, loading the second target program into a corresponding memory according to a LOAD module in the first target program, and jumping to the second target program for operation according to a GO module of the first target program. The first target program and the second target program are mutually called, so that unlimited reloading operation is not realized, and a large amount of debugging time can be effectively saved.
Fig. 1 is a flowchart of symmetric loading operation of a DSP program in the present application.
Referring to fig. 1, in S101, a LOAD module and a GO module are added to a program to generate a debugger, and the debugger is compiled to obtain a first target program.
The program is designed according to functional requirements in the development of the DPS, and is required to be debugged after the system integration is completed.
Specifically, the program is stored in a non-volatile storage medium, and when the program needs to be executed, the program needs to be loaded into a memory first, so as to be further executed.
Before the program is loaded into a memory, firstly, a LOAD module and a GO module are added on the basis of the original functions of the program to generate a debugging program for debugging and running.
The LOAD module is a section of loading code and is used for loading other programs into the memory in the running process of the program of the GO module, and the GO module is a section of calling code and is used for calling other programs to run in the running process of the program of the GO module. The LOAD module and the GO module are integrated in a static library LIB mode.
And compiling the debugging program into a first target program for loading and running.
Referring to fig. 1, S102 modifies the memory start address of the link file in the debugger, generates a modified debugger, and compiles the modified debugger to obtain a second target program.
The second target program is largely the same as the first target program, except that the first target program and the second target program have different load addresses.
Specifically, after the first target program is generated, another copy of the debugger is stored, and then the memory start address in the connection file of the debugger stored in another copy is modified to generate a modified debugger. And compiling the modified memory address to generate a second target program. It should be noted that, in the present application, the memory addresses of the first target file and the second target file are different and do not overlap.
Referring to fig. 1, the first target program is loaded and operated, the second target program is loaded into a corresponding memory according to a LOAD module in the first target program, and the GO module of the first target program is switched to the second target program to operate.
And after the first object program and the second object program are compiled, starting to operate and calling each other.
Specifically, a first target file is first programmed into the FLASH, and the power is turned on to start the FLASH, and the first target program starts to run. In the process, the DSP program is communicated with the upper computer through a serial port, and preferably, the DSP program LOADs a second target program through the LOAD module according to the instruction of the upper computer. Other ways may be provided by those skilled in the art to LOAD the second target program for the LOAD module, and provide an instruction to start loading.
And loading the LOAD, calling the second target program, and loading the second target program into a corresponding memory for running the second target program.
And finally, calling the second target program through the GO module, and jumping to the second target program for running.
FIG. 2 is a flowchart of the GO module loading routine of the present application.
Referring to fig. 2, in S201, the GO module parses a BIN file of the second target program, and parses each segment of the BIN file into a corresponding address space.
The BIN file mainly records the following parts: the BIN is not a simple copy of a memory program space, and the content contained in the BIN needs to be analyzed according to the format of the BIN and then can be loaded and operated.
Referring to fig. 2, S202 jumps to the second target program.
Furthermore, when the second target program is operated, the jump to the first target program can be carried out by the same method. And loading the first target program into a corresponding memory according to the LOAD module in the second target program, and jumping to the first target program for operation according to the GO module of the second target program.
The application also provides a device for the symmetric loading and operation of the DSP program, and a method corresponding to the symmetric loading and operation of the DSP program comprises the following steps: a first setup module 301, a second setup module 302, and a symmetric load module 303.
Fig. 3 is a schematic diagram of an apparatus for symmetric loading and running of a DSP program in the present application.
Referring to fig. 3, a first setting module 301 is configured to add a LOAD module and a GO module in a program to generate a debugging program, and compile the debugging program to obtain a first target program.
The program is designed according to functional requirements in the development of the DPS, and is required to be debugged after the system integration is completed.
Specifically, the program is stored in a non-volatile storage medium, and when the program needs to be executed, the program needs to be loaded into a memory first, so as to be further executed.
Before the program is loaded into a memory, firstly, a LOAD module and a GO module are added on the basis of the original functions of the program to generate a debugging program for debugging and running.
The LOAD module is a section of loading code and is used for loading other programs into the memory in the running process of the program of the GO module, and the GO module is a section of calling code and is used for calling other programs to run in the running process of the program of the GO module. The LOAD module and the GO module are integrated in a static library LIB mode.
And compiling the debugging program into a first target program for loading and running.
Referring to fig. 3, a second setting module 302 is configured to modify a memory start address of a link file in the debugger, generate a modified debugger, and compile the modified debugger to obtain a second target program.
The second target program is largely the same as the first target program, except that the first target program and the second target program have different load addresses.
Specifically, after the first target program is generated, another copy of the debugger is stored, and then the memory start address in the connection file of the debugger stored in another copy is modified to generate a modified debugger. And compiling the modified memory address to generate a second target program. It should be noted that, in the present application, the memory addresses of the first target file and the second target file are different and do not overlap.
Referring to fig. 3, the symmetric loading module 303 is configured to LOAD and run the first object program, LOAD the second object program into a corresponding memory according to the LOAD module in the first object program, and jump to the second object program to run according to the GO module of the first object program.
And after the first object program and the second object program are compiled, starting to operate and calling each other.
Specifically, a first target file is first programmed into the FLASH, and the power is turned on to start the FLASH, and the first target program starts to run. In the process, the DSP program is communicated with the upper computer through a serial port, and preferably, the DSP program LOADs a second target program through the LOAD module according to the instruction of the upper computer. Other ways may be provided by those skilled in the art to LOAD the second target program for the LOAD module, and provide an instruction to start loading.
And loading the LOAD, calling the second target program, and loading the second target program into a corresponding memory for running the second target program.
And finally, calling the second target program through the GO module, and jumping to the second target program for running.
Referring to fig. 2, in S201, the GO module parses a BIN file of the second target program, and parses each segment of the BIN file into a corresponding address space.
The BIN file mainly records the following parts: the BIN is not a simple copy of a memory program space, and the content contained in the BIN needs to be analyzed according to the format of the BIN and then can be loaded and operated.
And S202, jumping to the second target program to run.
Further, the loading module is further configured to jump to the first target program in the same manner when the second target program is run. And loading the first target program into a corresponding memory according to the LOAD module in the second target program, and jumping to the first target program for operation according to the GO module of the second target program.

Claims (10)

1. A method for symmetric loading and running of DSP programs is characterized by comprising the following steps:
adding a LOAD module and a GO module in a program to generate a debugging program, and compiling the debugging program to obtain a first target program;
modifying the memory initial 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;
and loading and operating the first target program, loading the second target program into a corresponding memory according to a LOAD module in the first target program, and jumping to the second target program for operation according to a GO module of the first target program.
2. The method for symmetric loading and running of the DSP program according to claim 1, further comprising:
and loading the first target program into a corresponding memory according to the LOAD module in the second target program, and jumping to the first target program for operation according to the GO module of the second target program.
3. The method for symmetric loading and running of the DSP program according to claim 1, wherein the LOAD module and the GO module are executed by the first object program under the control of an upper computer through a serial port.
4. The method for symmetric loading and running of the DSP program according to claim 1, further comprising:
the LOAD module and the GO module are integrated in a static library LIB mode.
5. The method for symmetric loading operation of DSP program according to claim 1, wherein the jumping to the second target program operation comprises:
the GO module analyzes the BIN file of the second target program and analyzes each segment of the BIN file to a corresponding address space;
and jumping to the second target program for running.
6. An apparatus for symmetric loading and running of a DSP program, comprising:
the first setting module is used for adding a LOAD module and a GO module in a program to generate a debugging program, and compiling the debugging program to obtain a first target program;
the second setting module is used for modifying the memory starting 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;
and the symmetrical loading module is used for loading and operating the first target program, loading the second target program into a corresponding memory according to a LOAD module in the first target program, and jumping to the second target program for operation according to the GO module of the first target program.
7. The apparatus for symmetric loading and running of DSP programs according to claim 6, wherein the loading module is further configured to:
and loading the first target program into a corresponding memory according to the LOAD module in the second target program, and jumping to the first target program for operation according to the GO module of the second target program.
8. The device for symmetric loading and running of the DSP program according to claim 6, wherein the LOAD module and the GO module are executed by the first object program under the control of an upper computer through a serial port.
9. The apparatus for symmetric loading and running of DSP programs according to claim 6, wherein said LOAD module and GO module are integrated by means of a static library LIB.
10. The apparatus for symmetric loading operation of DSP program according to claim 6, wherein the jump to the second target program operation comprises:
the GO module analyzes the BIN file of the second target program and analyzes each segment of the BIN file to a corresponding address space;
and jumping to the second target program for running.
CN202111330900.9A 2021-11-11 2021-11-11 Method and device for symmetric loading and running of DSP (digital Signal processor) program Pending CN114035920A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111330900.9A CN114035920A (en) 2021-11-11 2021-11-11 Method and device for symmetric loading and running of DSP (digital Signal processor) program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111330900.9A CN114035920A (en) 2021-11-11 2021-11-11 Method and device for symmetric loading and running of DSP (digital Signal processor) program

Publications (1)

Publication Number Publication Date
CN114035920A true CN114035920A (en) 2022-02-11

Family

ID=80143970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111330900.9A Pending CN114035920A (en) 2021-11-11 2021-11-11 Method and device for symmetric loading and running of DSP (digital Signal processor) program

Country Status (1)

Country Link
CN (1) CN114035920A (en)

Similar Documents

Publication Publication Date Title
JP2000181725A (en) Method and system for altering executable code and giving addition function
CN101957766B (en) Method, device and system for weaving byte code
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
CN108829465B (en) Local dynamic loading system and method based on direct read-write FLASH
CN102364433B (en) Method for realizing Wine construction tool transplanting on ARM (Advanced RISC Machines) processor
CN105354045A (en) Patch making method and apparatus and patch activation method and apparatus
CN1273897C (en) Automatic approach for unit testing
CN115617687A (en) Program instrumentation method, apparatus, device and storage medium
CN101334737A (en) Embedded equipment start-up or reset method
US10452364B2 (en) Method and system for preparing code to be executed by programmable control devices
CN104407852A (en) Code isolation-based construction method for embedded software and calling method for embedded software
CN105278445A (en) Secondary development method of synchronous generator excitation regulator control program
CN103631585A (en) Method and system for developing application program
CN109144849B (en) Embedded software debugging method
CN110806891A (en) Method and device for generating software version of embedded equipment
CN114035920A (en) Method and device for symmetric loading and running of DSP (digital Signal processor) program
CN113342702B (en) Application program testing method, device, equipment and readable storage medium
CN111984329B (en) Boot software standardized generation and execution method and system
KR100478463B1 (en) Dynamic Linking Method for Application Program
CN108958795B (en) BootLoader code reuse method and development board in embedded system
CN113157329A (en) Method, system, server and storage medium for starting application
CN100357908C (en) Test method for electronic device program
CN113672238B (en) Operation method, device and equipment based on real-time operating system modularized management
KR101548960B1 (en) Method for making and debuging program using virtual platform and appparatus therof
JP2004192604A (en) Device and method for developing embedded software

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