nsdsp_debug_check_for_halt
nsdsp_debug_wait_for_halt nsdsp_debug_get_pc nsdsp_debug_get_soft_bp nsdsp_debug_is_partitioned nsdsp_debug_can_swap nsdsp_debug_is_swapped nsdsp_debug_is_boot_swapped nsdsp_debug_get_flash_word nsdsp_debug_check_for_app nsdsp_debug_get_app_word nsdsp_debug_enable_exec_bp nsdsp_debug_enable_read_bp nsdsp_debug_enable_write_bp nsdsp_debug_disable_bp nsdsp_debug_enable_soft_bp nsdsp_debug_disable_soft_bp nsdsp_debug_read_ram nsdsp_debug_read_rom nsdsp_debug_read_reg nsdsp_debug_read_bp_state nsdsp_debug_read_cp0 nsdsp_debug_read_stack nsdsp_debug_check_for_data nsdsp_debug_wait_for_data nsdsp_debug_fetch_data nsdsp_debug_fetch_data_nb nsdsp_debug_fetch_word nsdsp_debug_fetch_flash_word nsdsp_debug_fetch_float nsdsp_debug_fetch_double nsdsp_debug_fetch_stack nsdsp_debug_fetch_bp_state nsdsp_debug_write_ram nsdsp_debug_write_reg nsdsp_debug_write_float_reg nsdsp_debug_write_double_regnsdsp_debug_check_for_halt
This function checks if the target device has been halted.
Syntax
int nsdsp_debug_check_for_halt(
nsdsp_session_t session
);
Parameters
session - a reference to the Debug Session Object obtained with nsdsp_session_program_for_debug or nsdsp_start_debug_session function
Return
The function returns non-zero if the device has halted, or zero otherwise.
Example
For devices with ordered halting, this function must be ordered among other fetch functions. An example of correct ordering and matching:
nsdsp_session_t sess;
unsigned int W0;
char buffer[16];
// #1
nsdsp_debug_run(sess);
// #2
nsdsp_debug_read_reg(sess,REG_PIC24_W0);
// #3
nsdsp_debug_read_ram(sess,0x1000,16);
nsdsp_session_flush(sess);
// #1 - matched to nsdsp_debug_run()
while (!nsdsp_debug_check_for_halt(sess)) {
// Doing something while waiting for the halt
}
// #2 - matched to nsdsp_debug_read_reg()
W0 = nsdsp_debug_fetch_word(sess);
// #3 - matched to nsdsp_debug_read_ram()
nsdsp_debug_fetch_data(sess,buffer,16);
The above example shows a program which lets the target device run, then, when the device halts, it reads a register and 16 bytes of memory. After everything is processed, things are retrieved in the same order as the requests were sent - first check for halt, second fetch the register value, third read the memory.
The above considerations do not apply to devices with unordered halting - check for halt can be performed at any time.
Minimum library version - 163
© 2007-2025 Northern Software Inc. All Rights Reserved.