Buy Contact NSDSP Home

nsdsp_debug_get_slave_info

This function extracts Debug Info object necessary to debug a slave core.

Syntax

debug_info_t nsdsp_debug_get_slave_info(
        nsdsp_session_t   session,
        unsigned int      core,
        unsigned int      image_a,
        unsigned int      image_b,
        unsigned int      tcy
);

Parameters

session - a reference to the Debug Session Object obtained with nsdsp_session_program_for_debug or nsdsp_start_debug_session function

core - the index of the core. Must be 1.

image_a - the id of the slave image, the id of the slave image for active partition if the slave core is partitioned.

image_b - the id of the slave image for inactive partition. Must be 0 if the slave core is not partitioned.

tcy - instruction cycle period in ns

Return

The function returns a reference to the Debug Info object, or NULL if the operation fails.

Notes

This function can only be used with multi-core dsPIC33CH devices.

The slave core ids are specified during assisted debugging setup using the NSDSP_DBG_SLAVE_IMAGE macro. The ids you have specified with the macro should be used for image_a and image_b parameters. The core images themselves must be programmed by the master core with XC16 _program_secondary() and _program_inactve_secondary() functions before you start debugging. It is up to you to make sure that the slave cores programmed by the master are the same slave cores you specify with image_a and image_b parameters.

Usually there will be only one slave image. In this case, set image_a to 1 and image_b to 0.

Example

  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);

 

Minimum library version - 163

Northern Software Home NSDSP Contact Us Purchase/View Cart

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