Buy Contact NSDSP Home

nsdsp_set_debug_cores

This function is used to specify cores being debugged for multi-core devices.

Syntax

void nsdsp_set_debug_cores(
        nsdsp_t           nsdsp,
        unsigned int      cores
);

Parameters

nsdsp - a reference to the NSDSP object returned by nsdsp_connect function

cores - a combination of flags:

Flag ConstantDebugging
0x00000001DEBUG_CORE_MASTER Master core will be debugged
0x00000002DEBUG_CORE_S1 The first slave core will be debugged

Notes

This setting is very important when debugging multi-core devices because it defines all future actions.

Examples

Debugging slave core only, the slave core being programmed by the master (error checking stripped):

  hex_map_t hm;
  mcu_t mcu;
  nsdsp_session_t sess;
  nsdsp_t nsdsp;
  debug_info_t dinf;
  int tcy;

  hm = hex_map_read("your_hex_file.hex",NULL);
  nsdsp = nsdsp_connect(NULL);
  nsdsp_set_debug_cores(nsdsp,DEBUG_CORE_S1);

  sess = nsdsp_start_prog_session(nsdsp,mcu,0);
  nsdsp_session_check_id(sess,1);
  nsdsp_session_program_for_debug(sess,hm,tcy);
  dinf = nsdsp_debug_get_slave_info(sess,1,1,0,tcy);
  nsdsp_end_session(nsdsp);

  // Debugging session for the slave core
  sess = nsdsp_start_debug_session(nsdsp,dinf);

  // Debugging the slave core here

  nsdsp_end_session(nsdsp);
  nsdsp_free(nsdsp);

Debugging master and slave cores simultaneously using two NSDSP programmers, the slave core being programmed by the master (error checking stripped):

  hex_map_t hm;
  mcu_t mcu;
  nsdsp_session_t master_sess, slave_sess;
  nsdsp_t master_nsdsp, slave_nsdsp;
  debug_info_t dinf;
  int master_tcy, slave_tcy;

  hm = hex_map_read("your_hex_file.hex",NULL);
  master_nsdsp = nsdsp_connect(MASTER_SERIAL);
  slave_nsdsp = nsdsp_connect(SLAVE_SERIAL);
  nsdsp_set_debug_cores(master_nsdsp,DEBUG_CORE_MASTER | DEBUG_CORE_S1);

  master_sess = nsdsp_start_prog_session(master_nsdsp,mcu,0);
  nsdsp_session_check_id(master_sess,1);
  nsdsp_session_program_for_debug(master_sess,hm,master_tcy);

  dinf = nsdsp_debug_get_slave_info(master_sess,1,1,0,slave_tcy);
  slave_sess = nsdsp_start_debug_session(slave_nsdsp,dinf);

  // Debugging both cores simultaneously
  // master_sess is used to debug master core
  // slave_sess is used to debug slave core

  nsdsp_end_session(slave_nsdsp);
  nsdsp_free(slave_nsdsp);

  nsdsp_end_session(master_nsdsp);
  nsdsp_free(master_nsdsp);

 

Minimum library version - 163

Northern Software Home NSDSP Contact Us Purchase/View Cart

© 2007-2026 Northern Software Inc. All Rights Reserved.