Buy Contact NSDSP Home

Programming Sessions

Programming sessions are used to program, read, or verify target devices. They use canned algorithms provided by NSDSP. Each session can be used for only one operation. Once the operation is performed, the session is no longer usable.

Before invoking the main operation, you can optionally verify the device id. If checking the device id fails, the library can automatically lower programming speed until it manages to get a correct id

Programming

For programming, you need to have a Hex Map Object which contains a memory map of the target device. The most common method is to read a HEX file. Optionally, you can modify the Hex Map that you have read. Or, you can create your own Hex Map. It must be fully filled before you can program the target device.

Programming always includes full erase and optional verification.

The pseudo-code for programming may look like this:

  NSDSP.create(serial)
  Session = NSDSP.startProgSession(mcu, readOnly = false)
  Session.checkId(adjustRate = true)

  Session.program(hexMap, verify = true)

  NSDSP.endSession
  NSDSP.free

Bulk Erase

Bulk Erase removes all the programming from the chip. After the bulk erase the state of the chip is the same as when it was received from factory.

The pseudo-code for bulk erase may look like this:

  NSDSP.create(serial)
  Session = NSDSP.startProgSEssion(mcu, readOnly = false)
  Session.checkId(adjustRate = true)

  Session.erase

  NSDSP.endSession
  NSDSP.free

Verification

For verification, you need a Hex Map Object to verify against. For each Hex block in the Hex Map, the library will read data from the target and will fill the block with the data. If you need partial verification, you can delete from the Hex Map all the blocks you don't want to verify.

The pseudo-code for verification may look like this:

  NSDSP.create(serial)
  Session = NSDSP.startProgSession(mcu, readOnly = true)
  Session.checkId(adjustRate = true)

  if (Session.verify(hexMap)) {
    // Verification succeeded
  } else {
    // Verification failed
  }

  NSDSP.endSession
  NSDSP.free

Reading

For reading, you need to supply a Hex Map Object. The blocks within the Hex Map will be filled with the data read from the chip. Only addresses and length of Hex blocks matter. All the contents will be destroyed. If you do not want to destroy the contents of your Hex Map, create a copy and use it for reading.

The pseudo-code for reading may look like this:

  NSDSP.create(serial)
  Session = NSDSP.startProgSession(mcu, readOnly = true)
  Session.checkId(adjustRate = true)

  Session.read(hexMap)

  NSDSP.endSession
  NSDSP.free

Programming for Debug

Programming for debug is a special operation. The chip programmed for debug will not run without the debugger. For details, see debugging

Northern Software Home NSDSP Contact Us Purchase/View Cart

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