CN102193860B - Microcontroller online debugging circuit and method as well as microcontroller - Google Patents

Microcontroller online debugging circuit and method as well as microcontroller Download PDF

Info

Publication number
CN102193860B
CN102193860B CN201010123200.8A CN201010123200A CN102193860B CN 102193860 B CN102193860 B CN 102193860B CN 201010123200 A CN201010123200 A CN 201010123200A CN 102193860 B CN102193860 B CN 102193860B
Authority
CN
China
Prior art keywords
breakpoint
break point
signal generation
generation unit
point signal
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.)
Active
Application number
CN201010123200.8A
Other languages
Chinese (zh)
Other versions
CN102193860A (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.)
SHANGHAI EASTSOFT MICROELECTRONICS CO., LTD.
Original Assignee
Shanghai Hair Group Integated Circuit 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 Shanghai Hair Group Integated Circuit Co Ltd filed Critical Shanghai Hair Group Integated Circuit Co Ltd
Priority to CN201010123200.8A priority Critical patent/CN102193860B/en
Priority to PCT/CN2010/074120 priority patent/WO2011109971A1/en
Publication of CN102193860A publication Critical patent/CN102193860A/en
Application granted granted Critical
Publication of CN102193860B publication Critical patent/CN102193860B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a microcontroller online debugging circuit and method as well as a microcontroller, wherein the microcontroller online debugging circuit comprises an interface protocol module, a breakpoint mark signal generating module comprising a program breakpoint signal generating unit, and a program execution control module connected with the breakpoint mark signal generating module for controlling the realization of online breakpoint debugging according to the breakpoint mark signal; the breakpoint signal generating unit further comprises at least a first breakpoint signal generating unit for generating the breakpoint signal according to breakpoint setting information; the breakpoint setting information is the information beyond a program breakpoint address value; the breakpoint mark signal generating module further comprises a breakpoint configuration register and a breakpoint combination logic module. The types of the breakpoints are added so as to enhance the functions of the breakpoints and effectively realize the breakpoint debugging method of the complex program.

Description

Microcontroller on-line debugging circuit and method, microcontroller
Technical field
The present invention relates to ic test technique field, particularly a kind of microcontroller on-line debugging circuit and method, microcontroller.
Background technology
Microcontroller is a kind of by the general purpose microcontroller of CPU core, on-chip memory and multiple peripheral functionality module integration, and along with the fast development of electronic technology, the application system of microcontroller is increasingly sophisticated.The exploitation of microprogrammed control unit application system and debugging have multiple method, and wherein one is on-line debugging technology, are that debug function module is directly integrated into microcontroller.Debugger host computer only need can carry out Develop Application System and debugging to microcontroller by little several microcontroller pins (being generally five) online, exploitation and debugging can be carried out in the system of reality, the otherness developing simulated environment and real system can be avoided like this.
Fig. 1 is the structural representation of prior art microcontroller on-line debugging circuit, and this on-line debugging circuit is integrated in aforesaid microcontroller.As shown in Figure 1, this on-line debugging main circuit will comprise interface protocol module 11, program performs control module 12, data-carrier store/register Read-write Catrol module 13, program breakpoint register 14, programmable counter 15 and the first comparer 16.Wherein, program breakpoint register 14, programmable counter 15 and the first comparer 16 constitute breakpoint marking signal generation module 24.When carrying out the debugging of microcontroller, interface protocol module 11 can carry out communication by debug clock line and tune-up data line and host computer, explains the order that host computer sends, and produces debug control signals, and the program that is sent to performs control module 12.Program performs control module 12 can the debug command of host computer that sends of receiving interface protocol module 11, and according to the execution of this debug command control program, control, the debug function such as realize comprising full speed running, operation suspension, single step, step jump.Interface protocol module 11 can also according to the debug command control data memories/registers Read-write Catrol module 13 of host computer, and to realize controlling the read/write of on-chip memory/register, the data of this read/write can be transmitted by data read/write bus.The program breakpoint address value write-in program breakpoint register 14 that host computer will be arranged by interface protocol module 11; The value stored in programmable counter 15 is the address of the programmed instruction that next will perform.The currency of the value of program breakpoint register 14 and programmable counter 15 can compare by comparer 16, if the two is equal, shows that this program performs and arrives breakpoint location, i.e. exportable breakpoint marking signal.Program performs control module 12 can according to this breakpoint marking signal, and control program suspends in this position, to perform down-stream debug command.
Although above scheme can realize the basic debug function of microcontroller, exploitation and the debugging of assembly routine can be met.But the raising of the complexity along with application system, the program of microcontroller is also increasingly sophisticated, and procedure quantity improves constantly; The development environment of assembly language far can not satisfy the demands, and the higher level lanquages such as C language are widely adopted in system development.Because microcontroller can only run assembly language directive, therefore with regard to needing the program to using C language to write to compile, make it to change assembly routine into support that microcontroller performs.But,, C language statement often corresponding several even tens assembly instructions after compiling, and be not fixing from C language statement to the compiling of assembly instruction, it depends on compiler algorithm and the optimized algorithm of compiler, thus make the program address of C language assembly routine that statement corresponds to also be uncertain, therefore, program address breakpoint implementation single in above-mentioned prior art, is difficult to the debugging breakpoints supporting C programmer.
Summary of the invention
The invention provides a kind of microcontroller on-line debugging circuit and method, microcontroller, single in order to solve prior art point of interruption implementation method, be not suitable with the shortcoming of the cut-point measure of complicated process, realize the debugging breakpoints that accurately can control complicated process.
The invention provides a kind of microcontroller on-line debugging circuit, comprising:
Interface protocol module, for receiving debug command, and produces breakpoint setup information according to described debug command;
Breakpoint marking signal generation module, with described interface protocol model calling, for according to described breakpoint setup information, produces breakpoint marking signal; Comprise the break point signal generation unit for generation of break point signal, described break point signal generation unit comprises program breakpoint signal generation unit;
Program performs control module, is connected with described breakpoint marking signal generation module, for controlling the realization of on-line debugging breakpoint according to described breakpoint marking signal;
Described break point signal generation unit also comprises: at least one first break point signal generation unit, and for producing described break point signal according to described breakpoint setup information, described breakpoint setup information is the information outside program breakpoint address value;
Described breakpoint marking signal generation module also comprises:
Breakpoint configuration register, with described interface protocol model calling, for receiving the mode of breakpoint setup information and logical combination from described interface protocol module;
Breaking point assemblage logic module, being connected with described break point signal generation unit and breakpoint configuration register respectively, obtaining described breakpoint marking signal for carrying out logical combination according to the mode of described logical combination to the break point signal that described break point signal generation unit produces.
The present invention also provides a kind of microcontroller on-line debugging circuit, comprising:
Interface protocol module, for receiving tune-up data, and produces breakpoint setup information according to described tune-up data;
Breakpoint marking signal generation module, with described interface protocol model calling, for according to described breakpoint setup information, produces breakpoint marking signal; Described breakpoint marking signal generation module comprises the break point signal generation unit for generation of break point signal;
Program performs control module, is connected with described breakpoint marking signal generation module, for controlling the realization of on-line debugging breakpoint according to described breakpoint marking signal;
Described break point signal generation unit comprises data breakpoint signal generation unit and mark break point signal generation unit;
Described data breakpoint signal generation unit, comprising:
Data breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and data breakpoint matching value from described interface protocol module;
Reading and writing data bus, for reading and writing transmission value;
Second comparer, is connected with described data breakpoint register and reading and writing data bus respectively, for when described data breakpoint matching value is equal with the transmission value in described reading and writing data bus, exports data breakpoint signal;
Described mark break point signal generation unit, comprising:
Mark breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and Status Flag matching value from described interface protocol module;
Status register, stores status flag value;
3rd comparer, is connected with described mark breakpoint register and status register respectively, for when described Status Flag matching value is equal with described status flag value, and output identification break point signal;
Described breakpoint marking signal generation module also comprises:
Breakpoint configuration register, with described interface protocol model calling, for receiving the mode of breakpoint setup information and logical combination from described interface protocol module;
Breaking point assemblage logic module, being connected with described break point signal generation unit and breakpoint configuration register respectively, obtaining described breakpoint marking signal for carrying out logical combination according to the mode of described logical combination to the break point signal that described break point signal generation unit produces.
The invention provides a kind of microcontroller on-line debugging method, comprising:
Receive tune-up data, and produce breakpoint setup information according to described tune-up data;
Produce at least one break point signal according to described breakpoint setup information, described breakpoint setup information is the information outside described program breakpoint address value, and obtains breakpoint marking signal according at least one break point signal described;
Control the realization of on-line debugging breakpoint according to described breakpoint marking signal, complete on-line debugging.
The invention provides two kinds of microcontrollers, these two kinds of microcontrollers can comprise two kinds of above-mentioned microcontroller on-line debugging circuit respectively.
Microcontroller on-line debugging circuit of the present invention and method, microcontroller, by on the basis of original program breakpoint mode, increase the mode such as data breakpoint and Status Flag breakpoint, this circuit is made to add the kind of breakpoint, enhance the function of breakpoint, realize relative to the breakpoint of program breakpoint mode single at present, more effectively can realize the breakpoint debugging method of complicated process.
Accompanying drawing explanation
In order to be illustrated more clearly in technical scheme of the present invention, below by or description of the prior art in the required accompanying drawing used be briefly described.Apparently, the accompanying drawing in the following describes is more of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the structural representation of prior art microcontroller on-line debugging circuit;
Fig. 2 is the structural representation of microcontroller on-line debugging circuit of the present invention;
Fig. 3 is the schematic flow sheet of microcontroller on-line debugging method of the present invention.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Main technical schemes of the present invention is, on the basis of the microcontroller on-line debugging circuit of prior art, breakpoint marking signal generation module is improved, add the kind of breakpoint, make the break point signal generation unit for generation of break point signal in this module can also comprise at least one first break point signal generation unit, this the first break point signal generation unit can produce break point signal according to the breakpoint setup information outside program breakpoint address value, and namely it can adopt the mode outside the breakpoint mode of program address to carry out the setting of breakpoint; Thus realize relative to the breakpoint of program breakpoint mode single at present, can more effectively utilize other breakpoint modes to realize the breakpoint debugging method of complicated process.
Below by the drawings and specific embodiments, technical scheme of the present invention is described in further detail.
Fig. 2 is the structural representation of microcontroller on-line debugging circuit embodiments of the present invention, as shown in Figure 2, the microcontroller on-line debugging main circuit of the present embodiment will comprise interface protocol module 21, program performs control module 22, data-carrier store/register Read-write Catrol module 13 and breakpoint marking signal generation module 24.
Wherein, interface protocol module 21 can carry out communication by debug clock line and tune-up data line and host computer, receives tune-up data, explains the order that host computer sends, and produces debug control signals and is sent to program and performs control module 22; Related commissioning register can also be set, control other module work of in-circuit debugger, and the data message needed for host computer is sent to host computer by serial protocol.Program performs control module 22 can according to the execution of this debug control signals control program instruction, comprises functions such as realizing full speed running, operation suspension, single step, step jump.Data-carrier store/register Read-write Catrol module 13 is connected with interface protocol module 21 by data read/write bus, can the read/write data memories/registers order that sends of receiving interface protocol module 21, and the read/write function of data-carrier store/register is completed by data read/write bus.Breakpoint marking signal generation module 24 is connected with interface protocol module 21, can the breakpoint setup information that produces according to described tune-up data of receiving interface protocol module 21, and produces breakpoint marking signal according to described breakpoint setup information.Program performs control module 22 can control on-line debugging breakpoint realization according to this breakpoint marking signal, realizes the function of breakpoint.
The on-line debugging circuit of the present embodiment and the key distinction of prior art are: breakpoint marking signal generation module 24 of the prior art only includes program breakpoint signal generation unit, and the breakpoint marking signal generation module 24 of the present embodiment can comprise the break point signal generation unit of other non-program address breakpoint mode.Such as, this breakpoint marking signal generation module 24 can comprise data breakpoint signal generation unit, and this data breakpoint signal generation unit can produce data breakpoint signal; Or also can comprise mark break point signal generation unit, this mark break point signal generation unit can produce mark break point signal.When adopting the program of higher level lanquage compiling that program address breakpoint mode cannot be utilized to realize breakpoint, just according to data breakpoint signal, breakpoint can be carried out in the position of the data breakpoint matching value arranged; Or, also according to mark break point signal, breakpoint can be carried out in the position of the Status Flag matching value arranged.Thus the function of breakpoint is strengthened, various ways can be adopted to realize the breakpoint of program comparatively neatly; And relative to program address breakpoint mode single at present, the debugging breakpoints of high-level language programs more effectively can be carried out.
Wherein, can setting data break point signal generation unit separately in breakpoint marking signal generation module 24, mark break point signal generation unit also can be set separately, or, above-mentioned two break point signal generation units also can be set simultaneously.In addition, data breakpoint signal generation unit and mark break point signal generation unit are two examples wherein, it will be understood by those skilled in the art that in the program debug of reality, according to the needs of user and the practical programs that will debug, various breakpoint kind can be set neatly; Based on the combination of multiple higher level lanquage type and various microcontroller, multiple combination logical course and breakpoint implementation can be set according to actual conditions, not repeat them here.
Breakpoint marking signal generation module 24 also can on the basis of existing program breakpoint signal generation unit, increase the first break point signal generation unit of other breakpoint kinds multiple, the increase of this first break point signal generation unit can make the setting of breakpoint more flexible.
The present embodiment, for the microcontroller on-line debugging circuit shown in Fig. 2, is described a kind of feasible structure wherein.As shown in Figure 2, the breakpoint marking signal generation module 24 of this on-line debugging circuit can comprise break point signal generation unit and break point signal assembled unit.Program breakpoint signal generation unit, data breakpoint signal generation unit and mark break point signal generation unit can be comprised in break point signal generation unit.Program breakpoint signal generation unit is for generation of program breakpoint signal, and data breakpoint signal generation unit is for generation of data breakpoint signal, and mark break point signal generation unit is for generation of mark break point signal.Break point signal assembled unit can comprise breakpoint configuration register 31 and breaking point assemblage logic module 32, this breakpoint configuration register 31 is connected with interface protocol module 21, the mode of breakpoint setup information and logical combination can be received, the modes such as such as AOI from interface protocol module 21; The mode of the logical combination that breaking point assemblage logic module 32 can be arranged according to breakpoint configuration register 31 is carried out logical combination to multiple break point signals that break point signal generation unit produces and is obtained breakpoint marking signal.
Wherein, program breakpoint signal generation unit can comprise program breakpoint register 14, programmable counter 15 and the first comparer 16.Program breakpoint register 14 is one or more groups register equal with programmable counter figure place, it is connected with interface protocol module 21, host computer can pass through interface protocol module 21, the breakpoint setup information that will arrange and program breakpoint address value write-in program breakpoint register 14.The program order address value that next will perform is stored in programmable counter 15; First comparer 16 is connected with program breakpoint register 14 and programmable counter 15 respectively, the program order address value that may be used for storing in the program breakpoint address value stored in program breakpoint register 14 and programmable counter 15 compares, when the two is equal, written-out program break point signal.
Further, this program breakpoint signal generation unit can also comprise program breakpoint counter 36.This program breakpoint counter 36 can be connected with the first comparer 16 and breakpoint configuration register 31 respectively.Now, the first comparer 16, can written-out program breakpoint match mark when program breakpoint address value is worth equal with program order address, represents and has occurred a match event.Program breakpoint counter 36 can count this match event.Now, breakpoint configuration register 31 can arrange the breakpoint match number of times of various breakpoint, and host computer can be arranged it by interface protocol module 21; Program breakpoint counter 36 can when described count value equals described breakpoint match number of times, written-out program break point signal.
Data breakpoint signal generation unit can comprise data breakpoint register 37, reading and writing data bus and the second comparer 38.Data breakpoint register 37 is one or more groups register equal with read/write data bus bits, it is connected with interface protocol module 21, host computer can pass through interface protocol module 21, the breakpoint setup information that will arrange and data breakpoint matching value write data breakpoint register 37.Second comparer 38 is connected with data breakpoint register 37 and reading and writing data bus respectively, may be used at described output data breakpoint signal.
Further, this data breakpoint signal generation unit also comprises data breakpoint counter 39.This data breakpoint counter 39 can be connected with the second comparer 38 and breakpoint configuration register 31 respectively.When the data-carrier store/register of specifying is by data bus generation read/write event, second comparer 38 is when data breakpoint matching value is equal with the data that namely transmission value in described reading and writing data bus is read and write in data-carrier store/register, data breakpoint match flag can be exported, represent and occurred a match event; Data breakpoint counter 39 can count this match event, and when count value equals the breakpoint match number of times of breakpoint configuration register 31 setting, exports data breakpoint signal.
Mark break point signal generation unit can comprise mark breakpoint register 40, status register 41 and the 3rd comparer 42.Mark breakpoint register 40 is for the matching value of storage state flags, and be connected with interface protocol module 21, host computer can pass through interface protocol module 21, the breakpoint setup information that will arrange and Status Flag matching value write mark breakpoint register 40.Status flag value is stored in status register 42.3rd comparer 42 can be connected with mark breakpoint register 40 and status register 41 respectively, for when described Status Flag matching value is equal with described status flag value, and output identification break point signal.
Further, this mark break point signal generation unit can also comprise mark breakpoint counter 43.This mark breakpoint counter 43 can be connected with the 3rd comparer 42 and breakpoint configuration register 31 respectively.Now, the 3rd comparer 42, can output identification breakpoint match mark when Status Flag matching value is equal with described status flag value, represents and has occurred a match event.Mark breakpoint counter 43 may be used for counting this match event, and when count value equals the breakpoint match number of times of breakpoint configuration register 31 setting, output identification break point signal.
Breaking point assemblage logic module 32 can be connected with mark breakpoint counter 43 with above-mentioned program breakpoint counter 36, data breakpoint counter 39, according to the relevant setting of breakpoint configuration register 31, the program breakpoint signal produced, data breakpoint signal and mark break point signal carry out logical combination and obtain total breakpoint marking signal.Program performs control module 22 when full speed running, just can by judging that this signal realizes various breakpoint function.
Concrete, because the structure of user to the program that it is debugged is predictable, therefore, for according to its actual needs and known program structure, can specifically set the condition of breakpoint.Such as, user wants when A instruction performs 100 times, and the Data Matching value that this instruction comprises is when equaling a, breakpoint is carried out at this instruction address place, then it can the matching times of setting program breakpoint counter be 100, and data breakpoint matching value is set to a, carry out logical and combination therebetween, the breakpoint marking signal representing above-mentioned breakpoint condition can be obtained.For another example, carry out breakpoint when user wants that the Status Flag in B instruction is b, then it can adopt separately mark breakpoint mode, and the Status Flag matching value in mark breakpoint register is set to b.Below just illustrate, it will be understood by those skilled in the art that in actual use, the setting of various breakpoint kind can also be carried out flexibly.Owing to being provided with the break point signal generation unit of multiple types in the breakpoint marking signal generation module of the present embodiment, therefore, user can adopt breakpoint setup mode neatly according to actual needs, more for convenience.
The microcontroller on-line debugging circuit of the present embodiment, the modes such as the breakpoint of the breakpoint mated by setting data read/write and Status Flag coupling, this circuit is made to add the kind of breakpoint, enhance the function of breakpoint and debugger to the real-time monitoring capacity of microprocessor ruuning situation, realize relative to the breakpoint of program breakpoint mode single at present, more effectively can realize the breakpoint debugging method of complicated process.
Fig. 3 is the schematic flow sheet of microcontroller on-line debugging embodiment of the method for the present invention, and as shown in Figure 3, this on-line debugging method is write a Chinese character in simplified form as follows, and its concrete steps can in conjunction with see above-mentioned microcontroller on-line debugging circuit embodiments.The method can comprise:
Step 401, reception tune-up data, and produce breakpoint setup information according to described tune-up data;
Tune-up data can be received by interface protocol module, explain the order that host computer sends, and produce breakpoint setup information according to described tune-up data.
Step 402, produce at least one break point signal according to breakpoint setup information, described breakpoint setup information is the information outside described program breakpoint address value;
Concrete, breakpoint setup information can comprise data breakpoint matching value.Produce break point signal according to breakpoint setup information in this step, can comprise: when described data breakpoint matching value is equal with the transmission value in reading and writing data bus, output data breakpoint signal.
Further, breakpoint setup information can also comprise Status Flag matching value.Wherein according to breakpoint setup information produce break point signal, can also comprise: when described Status Flag matching value is equal with the status flag value stored in status register, output identification break point signal.
Described breakpoint setup information can also comprise program breakpoint address value; Wherein according to breakpoint setup information produce break point signal, can also comprise: when described program breakpoint address value is equal with the program order address value stored in programmable counter, written-out program break point signal.
Step 403, obtain breakpoint marking signal according at least one break point signal described;
Further, when the quantity of described break point signal is at least two, can also comprise: logical combination is carried out at least two described break point signals, obtains breakpoint marking signal.
In addition, before logical combination is carried out at least two described break point signals, can also comprise: the breakpoint match mark exported when Satisfying Matching Conditions break point signal generation unit counts, and when count value equals the breakpoint match number of times of breakpoint configuration register setting, export at least two described break point signals.
Concrete, when described program breakpoint address value is worth equal with program order address, written-out program breakpoint match mark; When described data breakpoint matching value is equal with the transmission value in reading and writing data bus, export data breakpoint match flag; When described Status Flag matching value is equal with the status flag value stored in status register, output identification breakpoint match mark; Described program breakpoint match flag, data breakpoint match flag and mark breakpoint match mark are counted respectively; When count value is equal with the breakpoint match number of times that breakpoint configuration register is arranged, corresponding written-out program break point signal, data breakpoint signal and mark break point signal respectively.
Step 404, control the realization of on-line debugging breakpoint according to described breakpoint marking signal, complete on-line debugging.
The microcontroller on-line debugging method of the present embodiment, by modes such as setting data breakpoint and Status Flag breakpoints, this circuit is made to add the kind of breakpoint, enhance the function of breakpoint, realize relative to the breakpoint of program breakpoint mode single at present, more effectively can realize the breakpoint debugging method of complicated process.
Embodiments provide a kind of microcontroller, the on-line debugging circuit in this microcontroller can comprise program breakpoint signal generation unit and at least one the first break point signal generation unit, breakpoint configuration register and breaking point assemblage logic module.This first break point signal generation unit can be data breakpoint signal generation unit or mark break point signal generation unit.
The embodiment of the present invention additionally provides a kind of microcontroller, and the on-line debugging circuit in this microcontroller can comprise data breakpoint signal generation unit, mark break point signal generation unit, breakpoint configuration register and breaking point assemblage logic module.
Concrete structure see the microcontroller on-line debugging circuit described in above-described embodiment, can not repeat them here.Wherein, in this microcontroller, such as, programmable counter, status register etc. can for being arranged on the module of CPU inside, program breakpoint register, program breakpoint counter and breakpoint configuration register etc. for being arranged on the module of microcontroller, CPU outside, can being connected between this module and forming the debug circuit of illustrated functional independence.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer read/write memory medium, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (14)

1. a microcontroller on-line debugging circuit, comprising:
Interface protocol module, for receiving tune-up data, and produces breakpoint setup information according to described tune-up data;
Breakpoint marking signal generation module, with described interface protocol model calling, for according to described breakpoint setup information, produces breakpoint marking signal; Comprise the break point signal generation unit for generation of break point signal, described break point signal generation unit comprises program breakpoint signal generation unit;
Program performs control module, is connected with described breakpoint marking signal generation module, for controlling the realization of on-line debugging breakpoint according to described breakpoint marking signal;
It is characterized in that, described break point signal generation unit also comprises: at least one first break point signal generation unit, and for producing described break point signal according to described breakpoint setup information, described breakpoint setup information is the information outside program breakpoint address value; Described breakpoint setup information comprises data breakpoint matching value or Status Flag matching value;
Described breakpoint marking signal generation module also comprises:
Breakpoint configuration register, with described interface protocol model calling, for receiving the mode of breakpoint setup information and logical combination from described interface protocol module;
Breaking point assemblage logic module, being connected with described break point signal generation unit and breakpoint configuration register respectively, obtaining described breakpoint marking signal for carrying out logical combination according to the mode of described logical combination to the break point signal that described break point signal generation unit produces;
When described breakpoint setup information is data breakpoint matching value, described first break point signal generation unit is data breakpoint signal generation unit, comprising:
Data breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and data breakpoint matching value from described interface protocol module;
Reading and writing data bus, for reading and writing transmission value;
Second comparer, is connected with described data breakpoint register and reading and writing data bus respectively, for when described data breakpoint matching value is equal with the transmission value in described reading and writing data bus, exports data breakpoint signal;
When described breakpoint setup information is Status Flag matching value, described first break point signal generation unit is mark break point signal generation unit, comprising:
Mark breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and Status Flag matching value from described interface protocol module;
Status register, stores status flag value;
3rd comparer, is connected with described mark breakpoint register and status register respectively, for when described Status Flag matching value is equal with described status flag value, and output identification break point signal.
2. microcontroller on-line debugging circuit according to claim 1, is characterized in that, described breakpoint configuration register, also for arranging breakpoint match number of times;
Described breakpoint marking signal generation module, also comprise counter, described counter is connected with described break point signal generation unit, breakpoint configuration register and breaking point assemblage logic module respectively, breakpoint match mark for exporting when Satisfying Matching Conditions described break point signal generation unit counts, and when count value equals described breakpoint match number of times, export break point signal to described breaking point assemblage logic module.
3. a microcontroller on-line debugging circuit, comprising:
Interface protocol module, for receiving tune-up data, and produces breakpoint setup information according to described tune-up data;
Breakpoint marking signal generation module, with described interface protocol model calling, for according to described breakpoint setup information, produces breakpoint marking signal; Described breakpoint marking signal generation module comprises the break point signal generation unit for generation of break point signal;
Program performs control module, is connected with described breakpoint marking signal generation module, for controlling the realization of on-line debugging breakpoint according to described breakpoint marking signal;
It is characterized in that, described break point signal generation unit comprises data breakpoint signal generation unit and mark break point signal generation unit;
Described data breakpoint signal generation unit, comprising:
Data breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and data breakpoint matching value from described interface protocol module;
Reading and writing data bus, for reading and writing transmission value;
Second comparer, is connected with described data breakpoint register and reading and writing data bus respectively, for when described data breakpoint matching value is equal with the transmission value in described reading and writing data bus, exports data breakpoint signal;
Described mark break point signal generation unit, comprising:
Mark breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and Status Flag matching value from described interface protocol module;
Status register, stores status flag value;
3rd comparer, is connected with described mark breakpoint register and status register respectively, for when described Status Flag matching value is equal with described status flag value, and output identification break point signal;
Described breakpoint marking signal generation module also comprises:
Breakpoint configuration register, with described interface protocol model calling, for receiving the mode of breakpoint setup information and logical combination from described interface protocol module;
Breaking point assemblage logic module, being connected with described break point signal generation unit and breakpoint configuration register respectively, obtaining described breakpoint marking signal for carrying out logical combination according to the mode of described logical combination to the break point signal that described break point signal generation unit produces.
4. microcontroller on-line debugging circuit according to claim 3, is characterized in that, described breakpoint configuration register, also for arranging breakpoint match number of times;
Described breakpoint marking signal generation module, also comprise counter, described counter is connected with described break point signal generation unit, breakpoint configuration register and breaking point assemblage logic module respectively, breakpoint match mark for exporting when Satisfying Matching Conditions described break point signal generation unit counts, and when count value equals described breakpoint match number of times, export break point signal to described breaking point assemblage logic module.
5. a microcontroller on-line debugging method, is characterized in that, comprising:
Receive tune-up data, and produce breakpoint setup information according to described tune-up data;
Produce at least one break point signal according to described breakpoint setup information, described breakpoint setup information is the information outside program breakpoint address value, and obtains breakpoint marking signal according at least one break point signal described; Described breakpoint setup information comprises data breakpoint matching value or Status Flag matching value;
Control the realization of on-line debugging breakpoint according to described breakpoint marking signal, complete on-line debugging;
When described breakpoint setup information is data breakpoint matching value, when described data breakpoint matching value is equal with the transmission value in reading and writing data bus, export data breakpoint signal;
When described breakpoint setup information is Status Flag matching value, when described Status Flag matching value is equal with the status flag value stored in status register, output identification break point signal;
And when the quantity of described break point signal is at least two, logical combination is carried out at least two described break point signals, obtains breakpoint marking signal.
6. microcontroller on-line debugging method according to claim 5, is characterized in that, when described breakpoint setup information comprises data breakpoint matching value; Describedly produce at least one break point signal according to described breakpoint setup information, comprising:
When described data breakpoint matching value is equal with the transmission value in reading and writing data bus, export data breakpoint signal.
7. the microcontroller on-line debugging method according to claim 5 or 6, is characterized in that, when described breakpoint setup information also comprises Status Flag matching value; Describedly produce at least one break point signal according to described breakpoint setup information, comprising:
When described Status Flag matching value is equal with the status flag value stored in status register, output identification break point signal.
8. microcontroller on-line debugging method according to claim 7, is characterized in that, described breakpoint setup information also comprises program breakpoint address value; Describedly produce at least one break point signal according to described breakpoint setup information, comprising:
When described program breakpoint address value is equal with the program order address value stored in programmable counter, written-out program break point signal.
9. microcontroller on-line debugging method according to claim 5, is characterized in that, when the quantity of described break point signal is at least two, also comprises:
Logical combination is carried out at least two described break point signals, obtains breakpoint marking signal.
10. microcontroller on-line debugging method according to claim 9, is characterized in that, described logical combination is carried out at least two described break point signals before, also comprise:
The breakpoint match mark exported when Satisfying Matching Conditions break point signal generation unit counts, and when count value equals the breakpoint match number of times that breakpoint configuration register arranges, exports at least two described break point signals.
11. 1 kinds of microcontrollers, comprise microcontroller on-line debugging circuit, it is characterized in that, described microcontroller on-line debugging circuit comprises:
Interface protocol module, for receiving tune-up data, and produces breakpoint setup information according to described tune-up data;
Breakpoint marking signal generation module, with described interface protocol model calling, for according to described breakpoint setup information, produces breakpoint marking signal;
Program performs control module, is connected with described breakpoint marking signal generation module, for controlling the realization of on-line debugging breakpoint according to described breakpoint marking signal; Comprise the break point signal generation unit for generation of break point signal, described break point signal generation unit comprises program breakpoint signal generation unit;
It is characterized in that, described break point signal generation unit also comprises: at least one first break point signal generation unit, and for producing described break point signal according to described breakpoint setup information, described breakpoint setup information is the information outside program breakpoint address value; Described breakpoint setup information comprises data breakpoint matching value or Status Flag matching value;
Described breakpoint marking signal generation module also comprises:
Breakpoint configuration register, with described interface protocol model calling, for receiving the mode of breakpoint setup information and logical combination from described interface protocol module;
Breaking point assemblage logic module, being connected with described break point signal generation unit and breakpoint configuration register respectively, obtaining described breakpoint marking signal for carrying out logical combination according to the mode of described logical combination to the break point signal that described break point signal generation unit produces;
When described breakpoint setup information is data breakpoint matching value, described first break point signal generation unit is data breakpoint signal generation unit, comprising:
Data breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and data breakpoint matching value from described interface protocol module;
Reading and writing data bus, for reading and writing transmission value;
Second comparer, is connected with described data breakpoint register and reading and writing data bus respectively, for when described data breakpoint matching value is equal with the transmission value in described reading and writing data bus, exports data breakpoint signal;
When described breakpoint setup information is Status Flag matching value, described first break point signal generation unit is mark break point signal generation unit, comprising:
Mark breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and Status Flag matching value from described interface protocol module;
Status register, stores status flag value;
3rd comparer, is connected with described mark breakpoint register and status register respectively, for when described Status Flag matching value is equal with described status flag value, and output identification break point signal.
12. microcontrollers according to claim 11, is characterized in that, described breakpoint configuration register, also for arranging breakpoint match number of times;
Described breakpoint marking signal generation module, also comprise counter, described counter is connected with described break point signal generation unit, breakpoint configuration register and breaking point assemblage logic module respectively, break point signal for producing described break point signal generation unit counts, and when count value equals described breakpoint match number of times, export break point signal to described breaking point assemblage logic module.
13. 1 kinds of microcontrollers, comprise microcontroller on-line debugging circuit, it is characterized in that, described microcontroller on-line debugging circuit comprises:
Interface protocol module, for receiving tune-up data, and produces breakpoint setup information according to described tune-up data;
Breakpoint marking signal generation module, with described interface protocol model calling, for according to described breakpoint setup information, produces breakpoint marking signal; Described breakpoint marking signal generation module comprises the break point signal generation unit for generation of break point signal;
Program performs control module, is connected with described breakpoint marking signal generation module, for controlling the realization of on-line debugging breakpoint according to described breakpoint marking signal;
Described break point signal generation unit comprises data breakpoint signal generation unit and mark break point signal generation unit;
Described data breakpoint signal generation unit, comprising:
Data breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and data breakpoint matching value from described interface protocol module;
Reading and writing data bus, for reading and writing transmission value;
Second comparer, is connected with described data breakpoint register and reading and writing data bus respectively, for when described data breakpoint matching value is equal with the transmission value in described reading and writing data bus, exports data breakpoint signal;
Described mark break point signal generation unit, comprising:
Mark breakpoint register, with described interface protocol model calling, for receiving breakpoint setup information and Status Flag matching value from described interface protocol module;
Status register, stores status flag value;
3rd comparer, is connected with described mark breakpoint register and status register respectively, for when described Status Flag matching value is equal with described status flag value, and output identification break point signal;
Described breakpoint marking signal generation module also comprises:
Breakpoint configuration register, with described interface protocol model calling, for receiving the mode of breakpoint setup information and logical combination from described interface protocol module;
Breaking point assemblage logic module, being connected with described break point signal generation unit and breakpoint configuration register respectively, obtaining described breakpoint marking signal for carrying out logical combination according to the mode of described logical combination to the break point signal that described break point signal generation unit produces.
14. microcontrollers according to claim 13, is characterized in that, described breakpoint configuration register, also for arranging breakpoint match number of times;
Described breakpoint marking signal generation module, also comprise counter, described counter is connected with described break point signal generation unit, breakpoint configuration register and breaking point assemblage logic module respectively, breakpoint match mark for exporting when Satisfying Matching Conditions described break point signal generation unit counts, and when count value equals described breakpoint match number of times, export break point signal to described breaking point assemblage logic module.
CN201010123200.8A 2010-03-10 2010-03-10 Microcontroller online debugging circuit and method as well as microcontroller Active CN102193860B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201010123200.8A CN102193860B (en) 2010-03-10 2010-03-10 Microcontroller online debugging circuit and method as well as microcontroller
PCT/CN2010/074120 WO2011109971A1 (en) 2010-03-10 2010-06-21 Circuit and method for microcontroller online debugging, microcontroller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010123200.8A CN102193860B (en) 2010-03-10 2010-03-10 Microcontroller online debugging circuit and method as well as microcontroller

Publications (2)

Publication Number Publication Date
CN102193860A CN102193860A (en) 2011-09-21
CN102193860B true CN102193860B (en) 2015-04-22

Family

ID=44562809

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010123200.8A Active CN102193860B (en) 2010-03-10 2010-03-10 Microcontroller online debugging circuit and method as well as microcontroller

Country Status (2)

Country Link
CN (1) CN102193860B (en)
WO (1) WO2011109971A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662847B (en) * 2012-04-23 2015-01-21 中颖电子股份有限公司 System and method for program debugging of embedded system based on flash memory application
US9419621B1 (en) 2015-09-18 2016-08-16 Freescale Semiconductor, Inc. System on chip and method of operating a system on chip
CN107305526B (en) * 2016-04-22 2023-04-11 深圳市博巨兴微电子科技有限公司 Debugger for microcontroller
CN107168867A (en) * 2017-03-22 2017-09-15 深圳市博巨兴实业发展有限公司 A kind of method for the user's debug patterns for realizing microcontroller chip
CN112540288B (en) * 2020-11-30 2023-02-21 海光信息技术股份有限公司 Method, system, device and storage medium for chip after silicon verification

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1332409A (en) * 2000-07-05 2002-01-23 先进数字芯片股份有限公司 Central processing unit capable of testing and debugging program easily
CN101142560A (en) * 2005-01-28 2008-03-12 Nxp股份有限公司 Means and method for debugging

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100369010C (en) * 2005-04-01 2008-02-13 北京同方微电子有限公司 Hardware breakpoint circuit for intelligent card simulative debugging system
US8010774B2 (en) * 2006-03-13 2011-08-30 Arm Limited Breakpointing on register access events or I/O port access events
CN101458652B (en) * 2007-12-14 2012-01-25 上海海尔集成电路有限公司 Embedded on-line emulation debugging system for microcontroller

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1332409A (en) * 2000-07-05 2002-01-23 先进数字芯片股份有限公司 Central processing unit capable of testing and debugging program easily
CN101142560A (en) * 2005-01-28 2008-03-12 Nxp股份有限公司 Means and method for debugging

Also Published As

Publication number Publication date
WO2011109971A1 (en) 2011-09-15
CN102193860A (en) 2011-09-21

Similar Documents

Publication Publication Date Title
US7225357B2 (en) SDIO card development system
CN107436762B (en) Register code file generation method and device and electronic equipment
CN107907814B (en) Method for improving mass production test efficiency of chips
CN102662835B (en) A kind of program debugging method for embedded system and embedded system
CN108519889B (en) JTAG standard-based FPGA program remote upgrading system and method
CN102193860B (en) Microcontroller online debugging circuit and method as well as microcontroller
CN101231589B (en) System and method for developing embedded software in-situ
CN111045964B (en) PCIE interface-based high-speed transmission method, storage medium and terminal
CN101206614B (en) Simulator for simulating register with specific function
CN113157508B (en) Test method, system, device, equipment and storage medium of embedded system
CN100487668C (en) Regulating technology of built-in processor
Lacamera Embedded Systems Architecture: Explore architectural concepts, pragmatic design patterns, and best practices to produce robust systems
CN102147831A (en) Logic verification method and device
CN102096725A (en) Field programmable gate array (FPGA)-based simulator
US9117018B2 (en) Method of debugging software and corresponding computer program product
CN113849433A (en) Bus controller execution method and device, bus controller, computer equipment and storage medium
CN100511179C (en) Enhancement type microprocessor piece on-chip dynamic state tracking method with special function register breakpoints
CN103207824B (en) Not by the emulator of the interference that resets under monitoring mode
CN103793263A (en) DMA transaction-level modeling method based on Power PC processor
CN104461796B (en) JTAG debugging modules and adjustment method for embedded 8051CPU
CN101329650B (en) Smart card emulator
CN117172018A (en) Singlechip on-line debugging system suitable for multiple kernels
CN100474266C (en) Debugging system used for digital signal processor and debug method thereof
CN100485637C (en) Method for realizing hardware register based on built-in applied system
CN100357909C (en) Simulator chip and simulating method thereof

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
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 200030, 15 floor, Xuhui yuan building, 1089 south two road, Shanghai, Zhongshan

Patentee after: SHANGHAI EASTSOFT MICROELECTRONICS CO., LTD.

Address before: 200030, 15 floor, Xuhui yuan building, 1089 south two road, Shanghai, Zhongshan

Patentee before: Shanghai Hair Group Integated Circuit Co., Ltd.