Buy(Cart) Contact NSDSP Home

nsloop - NSDS Automated Programming Loop

nsloop is a command line utility which helps to automate production programming when NSDSP chips are installed on production boards. Each NSDSP has an unique serial number. nsloop monitors serial numbers of all the NSDSPs connected to the computer. As soon as a new NSDSP gets connected, nsloop launches a programming script. It passes the serial number of the newly connected NSDSP to the script through the command line. To avoid user errors, only one NSDSP is allowed to be connected to the computer at a time. If nsloop detects two or more connected NSDSPs, it will stall and wait until one of them is disconnected.

The script called by nsloop is meant to program the chip, but in addition to this it can configure the associated NSDSPs, run test programs, establish UART communications with the target device etc. In some cases, a delay may be needed at the beginning of the script to let the OS make the USB communication fully available.

With nsloop, you can simply connect your board to USB cable, wait until programming/testing is done, then disconnect it and connect another one. No need to press any buttons and very little room for the operator to make mistakes.

The nsloop utility has a single parameter, which is mandatory.

Parameter Description
script The script to be called.


Exit Code

If there is an error with supplied parameter, for example the specified script does not exist, the exit code is 1. Otherwise, nsloop never exits.


An Example

nsloop test.bat

This test.bat file may look similar to:

@echo off
echo Processing %1
nsconf -s %1 -cx0 -ci0 -cs0 -cu1 -dx0 -di1 -ds1 -du1
nsprog p -s %1 -d dsPIC30F1010 -v -i test.hex -z test.nsz

This script uses nsconf to configure the NSDSP chip as required for the target PIC. It then invokes nsprog command line programmer to program the target device. Typically, the script would also contain extra commands to run tests and make sure that the target device functions correctly.

Once the nsloop starts, it'll display the following:

D:\NSDSP>nsloop test.bat
NSLOOP 1 (C) 2015 Northern Software Inc. All Rights Reserved.

Waiting for new NSDSP to get connected.

When you see this prompt, simply connect the board with NSDSP to the USB port, and it'll be programmed immediately:

D:\NSDSP>nsloop test.bat
NSLOOP 1 (C) 2015 Northern Software Inc. All Rights Reserved.

Waiting for new NSDSP to get connected.
NSDSP100000000 connected.
Processing NSDSP100000000
NSPROG 1 (C) 2015 Northern Software Inc. All Rights Reserved.
The HEX file contains the following blocks:
0x00000000-0x00000100: 256 bytes
0x00000108-0x00000408: 768 bytes
0x01f00000-0x01f00004: 4 bytes
0x01f00008-0x01f00020: 24 bytes
Target device is dsPIC30F1010.
Connected to NSDSP100000000 Version 0100.
NSZ: 12340093
Ranges to be programmed:
code 0x00000000-0x00000240: 9 rows
code 0x00000940-0x00000980: one row
config 0x00f80000-0x00f80010: 8 words
Communications with target device established at 6000kHz.
Programming ... Done
Operation complete. Time elapsed 0.140s.
Waiting for NSDSP100000000 to be disconnected.

When you disconnect NSDSP, the loop starts over and you can connect the next board.

Northern Software Home NSDSP Contact Us Purchase/Vew Cart

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