nsdsp_session_program_for_debug
nsdsp_session_verify nsdsp_session_read nsdsp_session_set_timeout nsdsp_session_get_timeout nsdsp_session_check_for_data nsdsp_session_wait_for_data nsdsp_session_fetch_data nsdsp_session_fetch_data_nb nsdsp_session_flush nsdsp_session_send_uart nsdsp_session_send_spi nsdsp_session_receive_spi nsdsp_session_set_cke nsdsp_session_set_smp nsdsp_session_set_mclr nsdsp_session_set_hvp nsdsp_session_set_pgm nsdsp_session_set_pgcd nsdsp_session_set_red_led nsdsp_session_set_green_led nsdsp_session_short_delay nsdsp_session_delay_us nsdsp_session_delay_msnsdsp_session_program_for_debug
This function programs the target device for debug
Syntax
int nsdsp_session_program_for_debug(
nsdsp_session_t session,
hex_map_t hex_map,
int tcy
);
Parameters
session - a reference to the Session Object
hex_map - a Hex Map object containing data to be programmed on the device
tcy - instruction cycle period in ns
Return
The function returns non-zero if programming succeeds, or zero otherwise. If programming fails, you can use nsdsp_get_error to retrieve the error message.
Notes
After programming, the type of the session changes to debug (or idle in case of failure). The session can then be used for debugging.
Example
hex_map_t hm;
mcu_t mcu;
nsdsp_session_t sess;
nsdsp_t nsdsp;
int tcy;
hm = hex_map_read("your_hex_file.hex",NULL);
nsdsp = nsdsp_connect(NULL);
sess = nsdsp_start_prog_session(nsdsp, mcu, 0);
nsdsp_session_check_id(sess,1);
if (nsdsp_session_program_for_debug(sess, hm, tcy)) {
// The type of the session has changed to debug
if (nsdsp_debug_wait_for_halt(sess)) {
printf("Halted at %08x\n",nsdsp_debug_get_pc(sess));
// Debug here
}
}
nsdsp_end_session(nsdsp);
nsdsp_free(nsdsp);
Supported session types: program
Minimum library version - 163
© 2007-2025 Northern Software Inc. All Rights Reserved.