Cart Contact NSDSP Home

nsdsp_session_verify

This function verifies the data on the target device

Syntax

int nsdsp_session_verify(
        nsdsp_session_t   session,
        hex_map_t         hex_map
);

Parameters

session - a reference to the Session Object

hex_map - a Hex Map object containing data to be verified. Only the ranges contained in the Hex Map object will be read and verified.

Return

The function returns non-zero if reading succeeds, or zero otherwise. The mismatch between data on the device and the data in the Hex Map is considered failure. If verification fails, you can use nsdsp_get_error to retrieve the error message.

Notes

After successful completion, the type of the session changes to idle or SPI depending on the nsdsp_reset_after_prog setting. If the operation fails, the session becomes idle.

Example

int VerifyDevice(char* DeviceName, char* HexFileName) {
  hex_map_t hm;
  mcu_t mcu;
  nsdsp_t nsdsp;
  nsdsp_session_t sess;
  int ret;

  ret = 0;
  hm = hex_map_read(HexFileName,NULL);
  if (hm) {
    mcu = mcu_create(DeviceName);
    if (mcu) {
      nsdsp = nsdsp_connect(NULL);
      if (nsdsp) {
        sess = nsdsp_start_prog_session(nsdsp,mcu,0);
        if (sess) {
          ret = nsdsp_session_verify(sess,hm);
        }
        nsdsp_free(nsdsp);
      }
      mcu_free(mcu);
    }
    hex_map_free(hm);
  }
  return ret;
}

 

Supported session types: program

Minimum library version - 163

Northern Software Home NSDSP Contact Us Purchase/View Cart

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