Getting Started with ZiLOG Nexus SDK

ZiLOG's Nexus SDK (The SDK) enables you to easily integrate your software with one or more of ZiLOG's debug tools. This document provides some help to get you started. This file and all other installed documentation may be accessed via Start > Programs > ZiLOG Nexus SDK.

NOTE: Refer to the Examples/Test Applications section below for information about pre-built utilities, which may be useful in determining whether you have working hardware.

DLLs and File Organization
Examples/Test Applications
Static DLL Usage
Dynamic DLL Usage
USB Device Driver Installation

Documentation [top]
The SDK is distributed with the following documentation:

Note that all documents may be accessed via Start > Programs > ZiLOG Nexus SDK.

DLLs and File Organization [top]
The SDK provides a DLL for each product family-debug tool pair. A look at <Nexus SDK install dir>/bin folder reveals the following DLLs:

The appropriate DLL must be loaded to support the desired product family and debug tool.

There is a set of algorithm files that provide customization for particular ZiLOG parts. These files are found in <Nexus SDK install dir>/config and contain 'algo' in the file name. Each of the DLLs requires one of the algorithm files in order to function properly. The path and name of the algorithm file is set via nxt_TargetSpec.vendorTargetSpec.pOpenParameters.

Use the following tables to select the correct algorithm file based on the ZiLOG device.

DeviceAlgorithm file

Z8 Encore!
DeviceAlgorithm file
Z8 Encore! XP 4K
Z8 Encore! XP 4K 8-pin
Z8 Encore! XP F08xA
Z8 Encore! XP F08xA 8-pin
Z8 Encore! XP F0830
Z8 Encore! 4K
Z8 Encore! 4K 8-pin
Z8 Encore! F0823
Z8 Encore! F0823 8-pin
Z8 Encore! XP F1680 F1680_eval_algo.ini
Z8 Encore! 8K F08X_eval_algo.ini
Z8 Encore! 64K F642X_eval_algo.ini
Z8 Encore! 640 F640X_eval_algo.ini
Z8 Encore! MC Z8FMC16_emul_algo.ini

DeviceAlgorithm file

The config directory also contains two non-algorithm configuration files:

These files are expected to be found in the same location as the configured algorithm file.

C language header files contining the definitions of Nexus API structs, typedefs, defines, etc. can be found at <Nexus SDK install dir>/include.

Examples/Test Applications [top]
NexusCLI, a basic command line debugging utility, provides a working example of Nexus SDK use. It can also be used to verify that you've got working hardware, DLLs, algorithms, etc. The source code and Visual Studio projects files can be found at <Nexus SDK install dir>/examples/NexusCLI. The projects are configured to build nxcli.exe in <Nexus SDK install dir>/bin, assuming it is built from the install dir).

NexusCLI (nxcli.exe) is also distributed in binary form (find it in <Nexus SDK install dir>/bin). Execute the utility using 'nxcli -h' to access usage instructions.

USB Serial Number Scanner
USB communication configuration requires the serial number for the attached USB device (USB Smart Cable, for example). The example (usbscan.cpp and related Visual Studio projects) in the folder <Nexus SDK install dir>/examples/UsbScan provides sample code showing how this can be done programatically. ZiLOG USB devices being accessed must be connected to retrieve the serial number. Note that serial number retrieval requires the use of a Globally Unique ID. Currently, all ZiLOG USB devices use the following GUID: 1A080713-89EA-43ad-BB80-D3F847AD0554.

usbscan.exe is also distributed in binary form (find it in <Nexus SDK install dir>/bin). It accepts an GUID as an optional argument, and uses the GUID listed above by default. The utility may be executed from a Command Prompt or by double-clicking it in Windows Explorer.

If no USB device serial numbers are reported, ensure that:

Ethernet Smart Cable Scanner
The Ethernet Smart Cable supports an auto-discovery mechanism to acquire IP addresses, ports and other details for available devices. The example (escscan.cpp and related Visual Studio projects) in the for folder <Nexus SDK install dir>/examples/EthernetSCScan provides sample code showing how this can be done. See the header comment in the source file for usage requirements.

escscan.exe is also distributed in binary form (find it in <Nexus SDK install dir>/bin). The utility may be executed from a Command Prompt or by double-clicking it in Windows Explorer.

Static DLL Usage [top]
In the case that your application will be associated with a single product family and debug tool pair (in other words, it will use a single DLL), you can link the DLL statically with your application by adding the appropriate library in your project's libraries/objects link list. The libraries are found in <Nexus SDK install dir>/lib and share base file name with their corresponding DLL but use '.lib' extension. The following code snippet provides a very simple example of connecting to an EZ80F91 using an Ethernet debug tool (for example, an Ethernet Smart Cable or ZPAK II):
   #include <nxapi.h>
   #include <string.h>

   int main(int argc, char* argv[])
      nxt_TargetSpec spec;
      nxt_Status status;
      const char algoFile[] = 
   	   "C:\\Program Files\\ZiLOG\\NexusSdk\\config\\eZ80F91algo.ini";
      nxt_Handle * nxHandle = 0;

      /* set up target spec */   
      spec.accessPort = NX_PORT_TYPE_OTHER;
      spec.unsolicitedPort = NX_PORT_TYPE_UNAVAILABLE;
      spec.targetEndian = NX_ENDIAN_LITTLE;
      spec.vendorTargetSpec.pOpenParameters = algoFile;
      spec.vendorTargetSpec.comminfo.type = NXV_COMM_TYPE_ETHERNET;
      strcpy(spec.vendorTargetSpec.comminfo.u.ethernet.addr, "");
      spec.vendorTargetSpec.comminfo.u.ethernet.port = 4040;

      /* open the connection */
      nxHandle = nx_Open(&spec, 0, &status);
      if (nxHandle && (status == NX_ERROR_NONE))
         /* do some stuff... */

      return 0;
The appropriate DLL will need to be available to your built executable in your application's path or via the %path% environment variable.

Dynamic DLL Usage [top]
In the case that your application needs to be more flexible relative to product family or communication protocol, the DLL can be loaded and accessed at dynamically. In short, the DLL will be loaded and unloaded using Win32 functions LoadLibrary() and FreeLibrary(), respectively. Win32 function GetProcAddress() can be used to access available (exported) methods. The NexusCLI example (<Nexus SDK install dir>/examples/NexusCLI) provides a working example of this type of DLL usage. Refer to the Examples/Test Application section for more details.

USB Device Driver Installation [top]
USB device drivers and installation instructions can be found in the distribution at <Nexus SDK install dir>\Driver Drivers\USB\.

ZiLOG Inc. Web Site:
Technical Support Channel:
Copyright © 2006 ZiLOG, Inc. All Rights Reserved.