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_data
This function returns the amount of data received from NSDSP programmer and ready to be fetched.
Syntax
int nsdsp_debug_check_for_data(
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 the amount of available data in bytes.
Notes
This example for dsPIC33 reads breakpoints state, three registers, and stack return address. While the request is processed, the example uses nsdsp_debug_check_for_data function to check for completion in a loop.
// Build the request
Outstanding = 0;
Outstanding += nsdsp_debug_read_bp_state(sess);
Outstanding += nsdsp_debug_read_reg(sess,REG_PIC24_W0);
Outstanding += nsdsp_debug_read_reg(sess,REG_PIC24_W1);
Outstanding += nsdsp_debug_read_reg(sess,REG_PIC24_W2);
Outstanding += nsdsp_debug_read_stack(sess,0);
Outstanding += nsdsp_debug_read_stack(sess,1);
// Transfer the request
nsdsp_session_flush(sess);
while (nsdsp_debug_check_for_data(sess) < Outstanding) {
// Do something while waiting
}
// Fetch the data in the same order as in the request
BPState = nsdsp_debug_fetch_bp_state(sess);
W0 = nsdsp_debug_fetch_word(sess);
W1 = nsdsp_debug_fetch_word(sess);
W2 = nsdsp_debug_fetch_word(sess);
// Get RetAddr in two lines to ensure correct fetching order
RetAddr = nsdsp_debug_fetch_stack(sess) << 16;
RetAddr |= (nsdsp_debug_fetch_stack(sess) & 0xfffe);
This function is different from nsdsp_session_check_for_data. Do not use nsdsp_session_check_for_data when debugging.
Minimum library version - 163
© 2007-2025 Northern Software Inc. All Rights Reserved.