Everything
2.11 Stop Programs (Break)

This section describes how to stop the program in execution.

CS+ can stop the program in execution at the arbitrary position by using the following functions.

(1)

Forced break function

Stops the program forcibly.

(2)

Hardware break function

The debug tool consecutively checks the break condition while the program is in execution and stops the program when the condition is met. This function is implemented using the debug tool resources.

There are two types of Hardware Break event: "execution type" which stops the program at the arbitrary position; and "access type" which stops the program when an arbitrary variable and so on is accessed with the specified type.

Remark 1.

[E1][E20][Full-spec emulator]
Hardware break events (execution type) are of two types: pre-execution breaks, where the break occurs before execution of the instruction at the specified address and post-execution breaks, where the break occurs after execution of the instruction. In CS+, when hardware break events are specified, the resources of the pre-execution breaks are the first to be used. If those resources have been used up, the resources of the post-execution breaks are used (see "2.19.7.1 Restrictions on the numbers of valid events and channels").

Remark 2.

[Simulator]
When hardware break events (execution type) are specified, the breaks in the program occur before execution of the instructions at the specified addresses (pre-execution breaks).

(3)

Software break function [Full-spec emulator][E1][E20]

Temporarily replaces the instruction code for a specified address with a break instruction and stops the program when this instruction is executed.

If a Software Break event is set, the program will break before executing instruction at the specified address ("before execution" break).

Caution

Since an instruction code is replaced by the break instruction, setting or deleting a software break event is followed by programming of the memory at the timing described below.

-

When the program execution is started (including the start of execution via [Ignore break and go] from the [Debug] menu)

-

When the debug tool is disconnected from CS+

Caution 1.

If a forced break is performed while in standby mode (HALT/STOP/IDLE), the current PC position will indicate the address of the next instruction after the standby mode instruction.
This behavior differs depending on the debug tool used.

-

[Full-spec emulator][E1][E20]
The forced break will release standby mode.

-

[Simulator]
The forced break will not release standby mode.
It will appear that standby mode has been released. Check the CPU status on the Main window's statusbar to see if standby mode has been released.

Caution 2.

[Full-spec emulator][E1][E20]
Do not decrease the voltage of the target system during a break. A reset that is generated by the low-voltage detector (LVI) or by power-on-clear (POC) during a break causes an incorrect operation of CS+ or communication errors.
A break during emulation of power supply off also causes communication errors.

Remark 1.

For "program execution control" or "event occurrence" for a microcontroller that supports multi-core, see also to "Select a Core (PE)".

Remark 2.

When the program in execution is stopped, a statement of the cause of the break appears on the Statusbar in the Main window.