CN1297919C - Single-chip microcomputer background debug system and method - Google Patents

Single-chip microcomputer background debug system and method Download PDF

Info

Publication number
CN1297919C
CN1297919C CNB2004100152119A CN200410015211A CN1297919C CN 1297919 C CN1297919 C CN 1297919C CN B2004100152119 A CNB2004100152119 A CN B2004100152119A CN 200410015211 A CN200410015211 A CN 200410015211A CN 1297919 C CN1297919 C CN 1297919C
Authority
CN
China
Prior art keywords
message
module
chip microcomputer
foreground
backstage
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.)
Expired - Fee Related
Application number
CNB2004100152119A
Other languages
Chinese (zh)
Other versions
CN1558334A (en
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.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CNB2004100152119A priority Critical patent/CN1297919C/en
Publication of CN1558334A publication Critical patent/CN1558334A/en
Application granted granted Critical
Publication of CN1297919C publication Critical patent/CN1297919C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention discloses a system and a method for debugging the background of a single-chip microcomputer. The system of the present invention at least comprises a physical drive module, a data link module, a foreground and background communication module, and an application function module, wherein the physical drive module sets links between the background debugging system, and the application system of the single-chip microcomputer by the serial port or the extension facility of the single-chip microcomputer; the data link module takes charge of the data transmission and the data processing of the physical drive module, and the foreground and background communication module; the foreground and background communication module is a foreground and background communication interface, and takes charge of the data transmission of the data link module and the application function module; in the system, users can cut out arrangement and can develop a new debugging method on the base. The present invention overcomes the defect that the traditional single-chip microcomputer does not have the background debugging, and provides a background debugging system capable of cutting out and expansion, and a method thereof for developers to conveniently develop the single-chip microcomputer.

Description

A kind of system and method for single-chip microcomputer background debug
Technical field
The present invention relates to scm application system, especially relate to the system of 8051 single-chip microcomputer background debugs.
Background technology
8051 reach the standard technique of the series monolithic compatible with it as industry, are widely used in each electric appliances and the communication product.In general, the The application of single-chip computer process is such.At first that Single Chip Microcomputer (SCM) program is burned by cd-rom recorder, then the single-chip microcomputer insertion is powered on.May have a lot of type informations in the program for the developer, these type informations can be got to hyper terminal or be presented at the window of appointment by other physical equipment by serial ports, in addition the information with regard to having only the observation that do not stop to print.In case when Single Chip Microcomputer (SCM) program outage or scm application system broke down, we generally were difficult to navigate to end problem and go out there,, do not know even where program is moved on earth to make mistakes if type information is not enough.And work as program and change to some extent, what that was I guess slight a bit changes, all with cd-rom recorder that program is burned again, though some single-chip microcomputer producer provides boot, but because different producer's boot is different, cause versatility very poor, can not unify to use.In addition, be to carry out artificial debugging before program writes single-chip microcomputer,, normally can't carry out the Remote Dynamic debugging in case program is write single-chip microcomputer, this use to single-chip microcomputer brings very big inconvenience, does not also fundamentally solve the problem of the another one debugging of single-chip microcomputer application.
The defective of prior art is the instrument that trace debug is not provided, and can't monitor the location to its working condition after the Single Chip Microcomputer (SCM) program operation, can not directly download after modification of program.
Summary of the invention
The object of the invention provides a kind of system and method for realizing single-chip microcomputer operation is carried out background debug, overcomes prior art and can't observe the Single Chip Microcomputer (SCM) system operation, can't go wrong or realize the technical matters of searching fast and locating during fault.
The system of single-chip microcomputer background debug of the present invention comprises a physical drives module at least, a data link module, an AM/BAM communication module and an applied function module.
Described physical drives module utilizes the serial ports of single-chip microcomputer or expansion equipment to set up contact between background debug system and scm application system.
Described data link module, takes out and sends to described AM/BAM communication module at the data parsing that described physical drives module is sent, and the data that this AM/BAM communication module is sent send to described physical drives module.
Described AM/BAM communication module is the AM/BAM communication interface, and the data that described data link module is sent are taken out, and distributes the appropriate section of applied function module and handles, and the data that applied function module is sent are sent data link module.
Described applied function module is realized background debug, comprises the realization and and the interacting message of AM/BAM communication module at interface.
The method of single-chip microcomputer background debug of the present invention can realize following any one background debug: application framework guide, information observation at least in described realization single-chip microcomputer background debug system, software download, query software version and compilation time, each status register of single-chip microcomputer is inquired about or be provided with to the statistics cpu busy percentage, the query modification variable, move arbitrary function, debugging interface control read-write mcu resource, batch processing, layout setting is preserved in the message debugging.Single-chip microcomputer background debug method of the present invention comprises the steps:
The aforesaid applied function module of step 1 sends the background debug solicited message to aforementioned AM/BAM communication module;
The aforesaid AM/BAM communication module of step 2 sends to the aforementioned data link module with these debug requesting message data;
The aforesaid data link module of step 3 sends to aforementioned physical drives module with these debug requesting message data;
The aforesaid physical drives module of step 4 utilizes the serial ports of single-chip microcomputer or expansion equipment to set up contact between background debug system and scm application system, and the debug requesting message data that aforesaid data link module is sent are sent to the system that single-chip microcomputer uses handles;
The aforesaid physical drives module of step 5 receives the Debugging message data of returning by after the scm application system processing, and sends the Debugging message data of returning to aforesaid data link module;
The aforesaid data link module of step 6 with this Debugging message data parsing, taking-up of returning, sends to aforementioned AM/BAM communication module;
The aforesaid AM/BAM communication module of step 7 takes out these Debugging message data of returning, distributes the aforementioned applications functional module;
This Debugging message that the aforesaid applied function module of step 8 returns according to aforementioned AM/BAM communication module is realized background debug.
Described application framework guide is achieved as follows: in background interface special configuration background function, after having disposed, to use the function of configuration, increasing new function need reconfigure only; The backstage will dispose the file of its generation of back and issue the foreground, and the foreground covers original configuration file.
Described information observation is achieved as follows, and AM/BAM realizes starting, stopping, forbidding, preserve, delete operation information by interacting message, and the backstage shows the operation information that will print, and can or preserve the deletion of the operation information on the interface.
Described software download is achieved as follows: the software download standard according to given, receive and send data downloaded, and in downloading process, forbid other all work, finish until download.
Described query software version and compilation time are achieved as follows: the backstage is inquired about at described query interface, sends a message to the foreground by the AM/BAM communication module; The foreground after receiving message is returned the information of software version and compilation time, after receive on the backstage, shows on described query interface.
Described statistics cpu busy percentage is achieved as follows: the backstage sends the message of statistics foreground cpu busy percentage to the foreground by the AM/BAM communication module; The backstage demonstration is returned statistics to after receiving message in the foreground.
Described inquiry or each status register of single-chip microcomputer is set is achieved as follows: send by message the address of the single-chip microcomputer status register that the backstage will be inquired about and be provided with, value that reads or the value that writes setting are taken out after receiving message in the foreground, return the message that reads or be provided with success then and give the backstage.
Described query modification variable is achieved as follows: after following last compiling before single-chip microcomputer, generate a map file, the backstage imports this document, the variable name that demonstration will be inquired about and revise; During inquiry, address of variable corresponding in the map file is sent by message, wait for then and return Query Value and revise the result.
The arbitrary function of described operation is realized down: after following last compiling before single-chip microcomputer, generate a map file: the backstage imports this document, the variable name that demonstration will be inquired about and revise; During inquiry, the entry address of function is sent by message, the wait foreground is returned Query Value and is revised the result.
Described debugging interface control read-write mcu resource is achieved as follows: at first define query structure, specifically should comprise the size of type classification, query contents corresponding address and query contents of differentiation, the query manipulation object of mcu resource; Read in the map file after foreground program compiles, query contents corresponding address and size are shown on the interface; Choose the content that will inquire about, optional many also optional one, select inquiry to call AM/BAM communication module interface function message is sent, wait for the foreground response.The differentiation of described mcu resource comprises the program storage wiped of serial, the register of bus chip etc.; The type classification of described query manipulation object comprises program storage area, internal RAM, special function register etc.; Described query contents corresponding address need be read in the map file.
Described message realization of debugging is as follows: send single message, arrange the interface according to communications protocol.
Being achieved as follows of described preservation layout setting: when withdrawing from the backstage, setting and current information with all backstages are saved in the ini file, read ini file when each backstage starts.
Described batch processing is achieved as follows: the debugging in the developer on the backstage as required with message dispatch to the foreground; Formulated message file many or wall scroll importing again, regularly or manually sent; The developer edits any a piece of news on the batch processing interface, the message that described system has edited the developer automatically when closing described batch processing interface at every turn deposits specified file in.The intact message file of described formulation is to have formulated user file, and the developer can be made into * .dat file according to the message of system separately.
The present invention allows the developer can see the ruuning situation of program for the developer provides a general background debug system, and back-to-back running information timely provides simultaneously the function of various on-line debuggings and emulation again, makes things convenient for the developer.
Description of drawings
Fig. 1 is a single-chip microcomputer background debug system construction drawing of the present invention;
Fig. 2 is the method flow diagram in realization query modification register debugging of the present invention;
Fig. 3 is the method flow diagram in realization batch processing debugging of the present invention;
Fig. 4 is the method flow diagram in realization software download debugging of the present invention.
Embodiment
Below in conjunction with accompanying drawing implementation method is described in detail.
As shown in Figure 1: the background system structural drawing
The structure of layering is adopted on the backstage, and the bottom is to encapsulate the physics driver module respectively, mainly is to write driver at obstructed communication interface.
Data link module is to be responsible for encapsulating respectively the data that the physics driver module receives to tear frame open, with the data framing that the upper strata sends out, specifically is how to determine framing, tear frame open according to different agreements.
The AM/BAM communication is the AM/BAM communication interface that the background debug system adopts, the different agreement of developer's regulation is done during according to application, mainly be to provide a general interface function to the developer, the developer only need call corresponding interface and get final product when increasing function.The AM/BAM communication module takes out the data that described data link module comes, and distributes the corresponding function of applied function module and realizes partly handling; And the data that applied function module is sent are organized according to the agreement of developer's regulation and are dealt into data link module.Exist in the internal memory after the data parsing that the AM/BAM communication module is sent up data link module, the scanning specified memory that the backstage timer can be regularly takes out data and handles.When the backstage sent data, the interface function that directly calls the AM/BAM communication got final product.
Applied function module is to realize each debug function, promptly is the realization of the whole bag of tricks of single-chip microcomputer background debug.
Below to do detailed description at the example that is embodied as of the inquiry of singlechip register and modification, singlechip application programs batch processing and three kinds of typical background debug methods of software download.
Shown in Fig. 2 query modification register method flow diagram:
At first, need do the interface of a query modification register on the backstage, content should be determined according to the concrete number that single-chip microcomputer can be inquired about and allow to revise register.We are the address informations of searching register according to the * .map file behind the single-chip microcomputer foreground application software translating for generalized cases.After the backstage imports * .map file, it is deposited in.The user only need click corresponding option when will inquiring about and revise concrete register, the backstage will send to the foreground with the address information of register, and the foreground is made the corresponding value of handling back return register inquiry or revising according to address information and shown on the backstage.The compiling usefulness of our foreground software be Keil C51 compiler, after front and back define communication structure, as long as the address information of corresponding register is received on the foreground, will finish inquiry or revise, and the result is turned back to the backstage.
Shown in Fig. 3 batch processing method process flow diagram:
Batch processing mainly is to do according to concrete The application of single-chip computer, and what it was realized is one of dynamic modulation to single-chip microcomputer.The specific implementation process is such: at first, formulate the batch processing message of oneself according to the task on single-chip microcomputer foreground, generally these message are exactly the message frame of normal communication, are saved as * .dat file.When using, under the batch processing interface file is imported, the message of batch processing can be shown on the interface, and the user can be according to the needs of oneself, interim editor revises message, can accomplish with senior Programming with Pascal Language such as C++Builder or Delphi.This method also should have manual transmission and two kinds of options of timed sending selective, setting completed, just can enter then and debug, the user clicks the debugging message that will send and can be one and also can be many and send to the foreground, the foreground is according to Message Processing, and after disposing, to return operation information and show that to the backstage ruuning situation of foreground program is determined on the backstage according to operation information.
Shown in Fig. 4 software download realization flow figure (wherein gbtimeupflag downloads overtime sign global variable):
Software download is to realize according to the boot program of concrete single-chip microcomputer, and the boot of single-chip microcomputer at first will provide a unified frame structure to the backstage, and the backstage sends to the foreground according to given frame structure with the downloaded files packing and downloads.Here we finish like this: 1. the software download request is initiated on the backstage, waits for the response on foreground;
2. receive that the foreground allows software download to respond;
3. begin to download,, comprise the frame number of this frame in the frame structure, wait for the foreground response first frame data packing transmission of file in download;
4. receive the foreground response, check data structure, judge according to frame number whether the foreground receives success, next frame is sent out in success (frame number is the frame number of next frame), and unsuccessful (frame number is this frame frame number) retransmits these frame data;
5. judge according to downloading overtime sign (gbtimeupflag) that if retransmit four times, the foreground all and do not receive successfully, backstage demonstration on the download interface is overtime;
6. judge whether last frame, if last frame, sending out frame number is the frame structure of 0xFFFE, and the response of 0xFFFF frame number is returned on the wait foreground, if success, expression is downloaded and finished, otherwise repeating transmission, until overtime.
All background debug methods that the present invention proposes realize as development platform with the backstage debug system.It will be apparent to those skilled in the art that and in system of the present invention, to expand other functions, just increase the background debug method.

Claims (6)

1, a kind of system of single-chip microcomputer background debug is characterized in that, comprises a physical drives module at least, a data link module, an AM/BAM communication module and an applied function module;
Described physical drives module utilizes the serial ports of single-chip microcomputer or expansion equipment to set up contact between background debug system and scm application system;
Described data link module, takes out and sends to described AM/BAM communication module at the data parsing that described physical drives module is sent, and the data that this AM/BAM communication module is sent send to described physical drives module;
Described AM/BAM communication module is the AM/BAM communication interface, and the data that described data link module is sent are taken out, and distributes the appropriate section of applied function module and handles, and the data that applied function module is sent are sent to data link module;
Described applied function module is realized background debug, comprises the realization and and the interacting message of AM/BAM communication module at interface.
2, the method for the single-chip microcomputer background debug realized of a kind of single-chip microcomputer background debug according to claim 1 system, it is characterized in that comprising at least following any one background debug: application framework guide, information observation, software download, query software version and compilation time, the statistics cpu busy percentage, inquire about or be provided with each status register of single-chip microcomputer, the query modification variable moves arbitrary function, debugging interface control read-write mcu resource, batch processing, layout setting is preserved in the message debugging, and described single-chip microcomputer background debug method comprises the steps:
Step 1 applied function module backstage communication module forward sends the background debug solicited message;
Step 2 AM/BAM communication module sends to data link module with these debug requesting message data;
Step 3 data link module sends to the physical drives module with these debug requesting message data;
Step 4 physical drives module utilizes the serial ports of single-chip microcomputer or expansion equipment to set up contact between background debug system and scm application system, and these debug requesting message data that data link module is sent are sent to the system that single-chip microcomputer uses handles;
Step 5 physical drives module receives the Debugging message data of returning by after the scm application system processing, and sends the Debugging message data of returning to data link module;
Step 6 data link module with this Debugging message data parsing, taking-up of returning, sends to the AM/BAM communication module;
Step 7 AM/BAM communication module takes out these Debugging message data of returning, distributes applied function module;
This Debugging message that step 8 applied function module returns according to the AM/BAM communication module is realized background debug.
3, method according to claim 2 is characterized in that:
Described application framework guide is achieved as follows: in background interface special configuration background function, and use the function that disposes; The backstage will dispose the file of its generation of back and issue the foreground; The foreground covers original configuration file;
Described information observation is achieved as follows: AM/BAM realizes starting, stopping, forbidding, preserve, delete operation information by interacting message, and the backstage shows the operation information that will print;
Described query software version and compilation time are achieved as follows: the backstage is inquired about at query interface, sends a message to the foreground by the AM/BAM communication module; The foreground after receiving message is returned the information of software version and compilation time, after information is received on the backstage, shows on described query interface;
Described statistics cpu busy percentage is achieved as follows: the backstage sends the message of statistics foreground cpu busy percentage to the foreground by the AM/BAM communication module; The backstage demonstration is returned statistics to after receiving message in the foreground;
Described inquiry or each status register of single-chip microcomputer is set is achieved as follows: send by message the address of the single-chip microcomputer status register that the backstage will be inquired about and be provided with; Value that reads or the value that writes setting are taken out after receiving message in the foreground, return the message that reads or be provided with success then and give the backstage;
Described query modification variable is achieved as follows: after following last compiling before single-chip microcomputer, generate a map file, the backstage imports this document, the variable name that demonstration will be inquired about and revise; During inquiry, address of variable corresponding in the map file is sent by message, wait for then and return Query Value and revise the result;
The arbitrary function of described operation is achieved as follows: after following last compiling before single-chip microcomputer, generate a map file; The backstage imports this document, the variable name that demonstration will be inquired about and revise; During inquiry, the entry address of function is sent by message, the wait foreground is returned Query Value and is revised the result;
Described debugging interface control read-write mcu resource is achieved as follows: define query structure earlier, specifically should comprise the size of type classification, query contents corresponding address and query contents of differentiation, the query manipulation object of mcu resource; Read in the map file after foreground program compiles again, query contents corresponding address and size are shown on the interface; Choose many or the content that will inquire about then, inquire about and call AM/BAM communication module interface function message is sent, wait for that the foreground responds;
Described message realization of debugging is as follows: send single message, arrange the interface according to communications protocol;
Described preservation layout setting is achieved as follows: when withdrawing from the backstage, setting and current information with all backstages are saved in the ini file, read ini file when each backstage starts;
Described batch processing is achieved as follows: the debugging in the developer on the backstage as required with message dispatch to the foreground; Formulated behind the message file many or wall scroll and imported, regularly or manually sent; The developer edits any a piece of news on the batch processing interface, the message that system has edited the developer automatically when closing described batch processing interface at every turn deposits specified file in.
4, method according to claim 3 is characterized in that, in the described debugging interface control read-write mcu resource: the differentiation of described mcu resource comprises the program storage wiped of serial, the register of bus chip; The type classification of described query manipulation object comprises program storage, internal RAM, special function register; Described query contents corresponding address need be read in the map file.
According to the described method of claim 3, it is characterized in that 5, in the described batch processing, the intact message file of described formulation is to have formulated user file, the developer is made into * .dat file according to the message of system separately.
According to claim 2 or 5 described methods, it is characterized in that 6, in the described batch processing, when closing described batch processing interface, if use for the first time, the user needs specified path and filename to deposit in.
CNB2004100152119A 2004-01-16 2004-01-16 Single-chip microcomputer background debug system and method Expired - Fee Related CN1297919C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100152119A CN1297919C (en) 2004-01-16 2004-01-16 Single-chip microcomputer background debug system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100152119A CN1297919C (en) 2004-01-16 2004-01-16 Single-chip microcomputer background debug system and method

Publications (2)

Publication Number Publication Date
CN1558334A CN1558334A (en) 2004-12-29
CN1297919C true CN1297919C (en) 2007-01-31

Family

ID=34351363

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100152119A Expired - Fee Related CN1297919C (en) 2004-01-16 2004-01-16 Single-chip microcomputer background debug system and method

Country Status (1)

Country Link
CN (1) CN1297919C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100382502C (en) * 2005-06-01 2008-04-16 华为技术有限公司 Serial-port mapping system for debugging single board
CN100518355C (en) * 2005-06-13 2009-07-22 中兴通讯股份有限公司 Debugging system and method for broadband wireless access system
CN100422953C (en) * 2005-12-30 2008-10-01 北京中电华大电子设计有限责任公司 On-line debugging method for SoC system using HDL to expand serial port
CN102446138B (en) * 2011-09-19 2014-02-19 清华大学 Method for calibrating MAP data of single chip system
CN106557351B (en) * 2016-11-21 2019-08-09 广东高标电子科技有限公司 The data processing method and device of built-in application program

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6557119B1 (en) * 1999-10-01 2003-04-29 Stmicroelectronics Limited Microcomputer debug architecture and method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6557119B1 (en) * 1999-10-01 2003-04-29 Stmicroelectronics Limited Microcomputer debug architecture and method

Also Published As

Publication number Publication date
CN1558334A (en) 2004-12-29

Similar Documents

Publication Publication Date Title
CN110825369A (en) Method for automatically generating codes based on java language
CN1153138C (en) System and method for improving management and usability of Java environment
Smith et al. Heterogeneous process migration: The Tui system
US6272674B1 (en) Method and apparatus for loading a Java application program
US8965842B2 (en) Virtual environment spanning desktop and cloud
CN1885264A (en) Software package constructing method and system for embedded system
CN1248116C (en) General purpose testing arrangement for embedded module and subsystem based on host machine platform
CN1781077A (en) Selective loading of remote classes or resources for debugging a Java application in a Java micro device
CN1752946A (en) Debugging method of embedded system and its system
CN101042645A (en) Method, equipment and system for unionize software development environment
CN1949185A (en) Parallel adjusting and performance analyzing method of supporting multi-language multi-platform under isomerized environment
CN1627254A (en) Method for debuging embedded system and equipment
CN1737755A (en) Modeling and code generating method of embedded real-time operating system
CN102289774A (en) Graphical message processing and test system and method in financial transaction processing system
CN1297919C (en) Single-chip microcomputer background debug system and method
CN114610640A (en) Fuzzy testing method and system for trusted execution environment of Internet of things
CN115185539A (en) Method, device and storage medium for generating executable dynamic link library file
CN1929399A (en) Embedded Web network management system and its interactive method
CN114218906A (en) Vue-based table data formatting component implementation method
CN114513410A (en) Method and system for equipment to rapidly access Internet of things platform
WO2022099459A1 (en) Webassembly loading method and apparatus, and storage medium
CN116400914A (en) Method for quickly constructing web application based on data model
CN108595160B (en) Method and storage medium for calling native object by JS
CN114924733A (en) Form dependency relationship management and form accurate rendering method and system
Knabe Performance-oriented implementation strategies for a mobile agent language

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070131

Termination date: 20140116