Ethernut 3 NPL Version
Querying The Current Version
Ethernut 3 contains a programmable logic chip, which can be upgraded by software. Use the qrynpl tool to retrieve the NPL version currently implemented on your board.
- Unpack the archive.
- Move the file qrynpl.bin to the directory used by your TFTP server to keep downloadable images. The Ethernut 3.0 Hardware User's Manual explains the bootloading in more detail. Make sure that you have a TFTP daemon and a terminal emulator (115.2 kBaud 8,n,1) running. The Ethernut Board should be connected to the PC via Ethernet and RS232.
-
Reset the Ethernut board and press the space bar until the
BootMon message appears:
Most entries will be left unchanged by simply pressing enter. Specify qrynpl.bin as the name of the TFTP image.
BootMon 1.0.2 MAC address (000698300035):
IP address (192.168.192.35): Net mask (255.255.255.0): Default route (0.0.0.0): TFTP IP (192.168.192.222): TFTP Image (xsvfexec.bin): qrynpl.bin
-
The bootloader will download
and run the code. -
On the terminal window something like this should appear:
QueryNPL 1.0 running on Nut/OS 4.1.1.0 Nut Programmable Logic Version 5
- If your NPL version is older, run the upgrade described in the next chapter.
Upgrading The Logic
The logic can be re-programmed by uploading the XSFV Ecxecutor Application including the new logic programming file.
To enable Ethernut to program its logic, remove it from the
power supply and configure the jumper settings.
- Download enut30dnpl5.zip and unpack it. Move the file enut30dnpl5.bin to the TFTP directory.
-
Apply power to the Ethernut board and press the space bar until the
BootMon message appears. Change the name of the TFTP Image
to enut30dnpl5.bin.
BootMon 1.0.2 MAC address (000698300035): IP address (192.168.192.35): Net mask (255.255.255.0): Default route (0.0.0.0): TFTP IP (192.168.192.222): TFTP Image (xsvfexec.bin): enut30dnpl5.bin
-
After downloading and starting the Executor, the following
will appear in the terminal emulator:
Do not touch anything until
100 XSVF-Executor 1.1.2 on Nut/OS 4.1.1.0
appears a few seconds later. In addition the green LED on the Ethernut Board should go on.199 OK
You may now upload and run qrynpl again to verify, that the upgrade has been successful.
Recovering From Failures
If something went wrong, the CPLD may have been misprogrammed and the board will not work anymore. In this case follow these instructions to re-awake the board.
NPL Builds
While many developers start with the graphical interface of the Xilinx ISE, we will present a way to run everything on the command line. During the development this seems much more convenient than clicking a number of buttons over and over again. After each change to the Verilog code, we simply enter
make cleanfollowed by
make installand then press the reset button on the Ethernut to update the CPLD.
The archive enut30npl-20071207.zip contains all the source code needed to create and upload your own Verilog code to Ethernut 3.
Step 1: Create Build and Application Directories
If not already done, run the Nut/OS Configurator to create a system and a sample directory for Ethernut 3. Follow the instruction given in the Nut/OS Software Manual.
Step 2: Download and Install the Xilinx ISE Webpack
You can download a free copy of the ISE Webpack for Windows or Linux from the Xilinx Download Center. We used version 9.2i SP4.
Step 3: Download and Install enut30npl
Download and unpack enut30npl-20071207.zip, which contains the following directories:
-
nut
Move the contents into your source directory within the Nut/OS installation directory. This will add new Makedefs and Makerules. -
nutapp
Move the contents to the application sample directory, which you created in step 1. This will add two more applications. One is called xsvfexec and enables the Ethernut 3 CPU to re-program the CPLD. The second one, npl30e, contains the Verilog source code, that will be translated by the Xilinx Webpack to an XSVF file. This file is then used to build a UROM file system image, which in turn is compiled and linked together with the xsvfexec application.
Step 4: Build and Upload the XSVF
Open a command line window and change to the npl30e directory in your application tree. Make sure, that the Xilinx, Nut/OS and compiler binaries are reachable. On Windows you may enter something like
set XILINX=C:\Xilinx92i set PATH=C:\ethernut-4.4.0\nut\tools\win32;C:\Programme\yagarto\bin;%XILINX%\bin\nt;%PATH%Your drive and path information may differ, of course.
Now type
make installIf successful, you will end up with binary named npl30e.bin, which can be uploaded the same way we used for enut30dnpl5.bin (see above).
For reference, here's the complete output of the build process:
C:\ethernut-4.4.0\nutapp-enut30e-gcc\npl30e>make install arm-elf-gcc -c -mcpu=arm7tdmi -Os -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=../xsvfe xec/xsvfexec.lst -DETHERNUT3 -DXSVFNAME="\"UROM:npl30e.xsvf\"" -I../../nutbld-enut30e-gcc/include -I../../nut/include ../xsvfexec/ xsvfexec.c -o ../xsvfexec/xsvfexec.o arm-elf-gcc -c -mcpu=arm7tdmi -Os -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=../xsvfe xec/tapsm.lst -DETHERNUT3 -DXSVFNAME="\"UROM:npl30e.xsvf\"" -I../../nutbld-enut30e-gcc/include -I../../nut/include ../xsvfexec/tap sm.c -o ../xsvfexec/tapsm.o arm-elf-gcc -c -mcpu=arm7tdmi -Os -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=../xsvfe xec/host.lst -DETHERNUT3 -DXSVFNAME="\"UROM:npl30e.xsvf\"" -I../../nutbld-enut30e-gcc/include -I../../nut/include ../xsvfexec/host .c -o ../xsvfexec/host.o echo verilog work "npl30e.v" > npl30e.prj echo run > xst.scr echo -ifn npl30e.prj >> xst.scr echo -ifmt mixed >> xst.scr echo -ofn npl30e >> xst.scr echo -p xc9500xl >> xst.scr echo -top npl30e >> xst.scr echo -opt_level 2 >> xst.scr echo -opt_mode SPEED >> xst.scr echo setPreference -pref UserLevel:NOVICE > impact.scr echo setPreference -pref MessageLevel:DETAILED >> impact.scr echo setPreference -pref ConcurrentMode:FALSE >> impact.scr echo setPreference -pref UseHighz:FALSE >> impact.scr echo setPreference -pref ConfigOnFailure:STOP >> impact.scr echo setPreference -pref StartupCLock:AUTO_CORRECTION >> impact.scr echo setPreference -pref AutoSignature:FALSE >> impact.scr echo setPreference -pref svfUseTime:FALSE >> impact.scr echo setMode -bsfile >> impact.scr echo setCable -port xsvf -file npl30e.xsvf >> impact.scr echo addDevice -position 1 -file npl30e.jed >> impact.scr echo program -e -v -p 1 >> impact.scr echo quit >> impact.scr xst -intstyle silent -ifn xst.scr -ofn xst.log ngdbuild -intstyle silent -quiet -aul -uc npl30e.ucf -p xc95144xl-10-TQ144 npl30e.ngc npl30e.ngd Command Line: ngdbuild -intstyle silent -quiet -aul -uc npl30e.ucf -p xc95144xl-10-TQ144 npl30e.ngc npl30e.ngd Reading NGO file "C:/ethernut-4.4.0/nutapp-enut30e-gcc/npl30e/npl30e.ngc" ... Applying constraints in "npl30e.ucf" to the design... Checking timing specifications ... Checking expanded design ... Partition Implementation Status ------------------------------- No Partitions were found in this design. ------------------------------- NGDBUILD Design Results Summary: Number of errors: 0 Number of warnings: 0 Writing NGD file "npl30e.ngd" ... Writing NGDBUILD log file "npl30e.bld"... NGDBUILD done. cpldfit -p xc95144xl-10-TQ144 -ofmt verilog -exhaust -log cpldfit.log -power auto npl30e.ngd Release 9.2.03i - CPLD Optimizer/Partitioner J.39 Copyright (c) 1995-2007 Xilinx, Inc. All rights reserved. INFO:Cpld:994 - Exhaustive fitting is trying pterm limit: 25 and input limit: 54 Considering device XC95144XL-10-TQ144. Flattening design.. Multi-level logic optimization... Timespec optimization Timing optimization.............................................................. Timespec driven global resource optimization Timing driven global resource optimization General global resource optimization........ Re-checking device resources ... Mapping a total of 118 equations into 8 function blocks.............................................. Power/Slew optimization....... Design npl30e has been optimized and fit into device XC95144XL-10-TQ144. hprep6 -intstyle silent -s IEEE1149 -i npl30e.vm6 impact -batch impact.scr Release 9.2.03i - iMPACT J.39 Copyright (c) 1995-2007 Xilinx, Inc. All rights reserved. Preference Table Name Setting StartupClock Auto_Correction AutoSignature False KeepSVF False ConcurrentMode False UseHighz False ConfigOnFailure Stop UserLevel Novice MessageLevel Detailed svfUseTime false SpiByteSwap Auto_Correction WARNING:iMPACT:2635 - BSFILE mode no longer exists. Please use BS mode. '1': Loading file 'npl30e.jed' ... done. INFO:iMPACT:1777 - Reading C:/Xilinx92i/xc9500xl/data/xc95144xl.bsd... INFO:iMPACT:501 - '1': Added Device xc95144xl successfully. ---------------------------------------------------------------------- ---------------------------------------------------------------------- '1': Erasing device... '1': Erasure completed successfully. '1': Programming device... done. '1': Putting device in ISP mode...done. '1': Putting device in ISP mode...done. '1': Verifying device...done. '1': Verification completed successfully. '1': Putting device in ISP mode...done. '1': Programming completed successfully. Elapsed time = 0 sec. mkdir urom cp npl30e.xsvf urom/npl30e.xsvf crurom -r -ourom.c urom arm-elf-gcc -c -mcpu=arm7tdmi -Os -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=urom.lst -DETHERNUT3 -DXSVFNAME="\"UROM:npl30e.xsvf\"" -I../../nutbld-enut30e-gcc/include -I../../nut/include urom.c -o urom.o arm-elf-gcc ../xsvfexec/xsvfexec.o ../xsvfexec/tapsm.o ../xsvfexec/host.o urom.o -mcpu=arm7tdmi -nostartfiles -T../../nut/arch/arm/l dscripts/at91_ram.ld -Wl,-Map=npl30e.map,--cref,--no-warn-mismatch -L../../nutbld-enut30e-gcc/lib -Wl,--start-group ../../nutbld-enu t30e-gcc/lib/nutinit.o -lnutfs -lnutcrt -lnutos -lnutdev -lnutarch -Wl,--end-group -o npl30e.elf arm-elf-objcopy -O ihex npl30e.elf npl30e.hex arm-elf-objcopy -O binary npl30e.elf npl30e.bin cp npl30e.hex ../../nut/bin/arm7tdmi/npl30e.hex cp npl30e.bin ../../nut/bin/arm7tdmi/npl30e.bin rm npl30e.jed npl30e.vm6 npl30e.elf npl30e.ngc npl30e.ngd