µVision User's GuideAbout µVision User Interface Creating Applications Debugging Debug Commands ASM ASSIGN BreakAccess BreakDisable BreakEnable BreakKill BreakList BreakSet COVERAGE COVERAGE Overview Report COVERAGE GCOV Export COVERAGE ASM Report COVERAGE MTB Import COVTOFILE DEFINE DIR Display Enter EVALuate EventRecorder EXIT FUNC Go INCLUDE IRLOG ITMLOG KILL LOAD LOG LogicAnalyze MAP MODE Ostep PerformanceAnalyze Pstep RESET SAVE SBC (only Cortex-M) SCOPE SET SIGNAL SLOG Tstep Unassemble WatchSet WatchKill TraceAccessPoint TraceDataPoint TraceDisable TraceEnable TraceHalt TraceKill TraceList TraceRun (ETM) TraceSuspend (ETM) Debug Functions Simulation Flash Programming Dialogs Utilities Command Line Example Programs Appendix
The BreakSet command sets a breakpoint for the specified expression (exp). Breakpoints are program addresses or expressions that, when true, halt execution of your target program or execute the specified command ("cmd").
Breakpoint types are categorized through the following rules:
The following breakpoint is valid:
BS WRITE time.sec /* Valid expression */
The following breakpoint is invalid, because adding two values (timer.sec and i0) does not result in a memory type:
BS WRITE time.sec + i0 /* Invalid expression */
The following example sets an execution breakpoint on the address of the main function.
The following example sets an execution breakpoint on the address of the timer0 function. The breakpoint occurs and the command "MyRegs()" is executed only after the 10th invocation of timer0. Program execution continues after the command executes.
The following example sets a conditional breakpoint on the sindex symbol. When sindex is equal to 8, program execution halts.
BS sindex == 8
The following example sets a conditional breakpoint on the save_record array. Program execution halts on the third time save_record.time.sec is greater than 5.
BS save_record.time.sec > 5, 3
The following example sets a memory access breakpoint on READ accesses of the interval.min symbol. Program execution halts when the min element of the interval structure or union is 3.
BS READ interval.min == 3
The following example sets a memory access breakpoint on WRITE accesses to the savefirst symbol. Program execution halts when savefirst is 5 and the accumulator (acc) is 0x12 after savefirst is written.
BS WRITE savefirst == 5 && acc == 0x12
For Cortex-M, the data size for the comparison is not clear by just using a constant as address expression. The example below is invalid and must be replaced with the expression in the next example.
BS WRITE 0x20000018 == 0x00000003 /* Invalid expression */
For Cortex-M, remove ambiguity using a pointer type cast to resolve the constant address.
BS WRITE * ((unsigned int*)0x20000018) == 0x00000003 /* Valid expression */
The following Cortex-M example sets an execution breakpoint on line 136 of the file STM32F10x.s. The file is specified with a relative path name. The application name is cpp_template. Program execution halts before the code on line 136 is executed.
BS \\cpp_template\../../source/RVCT/STM32F10x.s\136, 1
of your data.