<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.ethernut.de/nutwiki/index.php?action=history&amp;feed=atom&amp;title=Documents%2FNPL_Exec_Project</id>
		<title>Documents/NPL Exec Project - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.ethernut.de/nutwiki/index.php?action=history&amp;feed=atom&amp;title=Documents%2FNPL_Exec_Project"/>
		<link rel="alternate" type="text/html" href="http://www.ethernut.de/nutwiki/index.php?title=Documents/NPL_Exec_Project&amp;action=history"/>
		<updated>2026-04-29T00:23:43Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://www.ethernut.de/nutwiki/index.php?title=Documents/NPL_Exec_Project&amp;diff=339&amp;oldid=prev</id>
		<title>Harald: Created page with &quot;&lt;div id=&quot;content&quot;&gt;  = NPL Tutorial - Step 5 =  Previous Contents  Next == Using The XSVF Executor ==  The XSVF Executor...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.ethernut.de/nutwiki/index.php?title=Documents/NPL_Exec_Project&amp;diff=339&amp;oldid=prev"/>
				<updated>2017-07-13T07:43:43Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div id=&amp;quot;content&amp;quot;&amp;gt;  = NPL Tutorial - Step 5 =  &lt;a href=&quot;/nutwiki/index.php?title=Npl-verilog.html&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Npl-verilog.html (page does not exist)&quot;&gt;Previous&lt;/a&gt; &lt;a href=&quot;/nutwiki/index.php?title=Npl.html&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Npl.html (page does not exist)&quot;&gt;Contents&lt;/a&gt;  &lt;a href=&quot;/nutwiki/index.php?title=Npl-trouble.html&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Npl-trouble.html (page does not exist)&quot;&gt;Next&lt;/a&gt; == Using The XSVF Executor ==  The XSVF Executor...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div id=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NPL Tutorial - Step 5 =&lt;br /&gt;
&lt;br /&gt;
[[npl-verilog.html|Previous]] [[npl.html|Contents]]  [[npl-trouble.html|Next]]&lt;br /&gt;
== Using The XSVF Executor ==&lt;br /&gt;
&lt;br /&gt;
The XSVF Executor is a Nut/OS applications, which uses the UROM file system to store, retrieve and execute a CPLD programming file. In fact the application doesn't have write access to the UROM file system, because it is read-only. Instead the files are included into the application code image when compiling and linking the project.&lt;br /&gt;
&lt;br /&gt;
It is assumed, that you have downloaded and installed Nut/OS, build the libraries and created the sample application tree. Now download the XSVF Executor, unpack it and move the xsvfexec subdirectory into the application sample tree.&lt;br /&gt;
&lt;br /&gt;
Next, move the file named npltut01.xsvf, which we created in a previous step, to the directory xsvfexec/cpld. Make sure its name is enut30d.xsvf.&lt;br /&gt;
&lt;br /&gt;
Open a command line and change to the xsvfexec directory within the application tree. If not done already, add the Nut/OS tools directory and the GCC bin directory to your path. On Windows use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ c:&lt;br /&gt;
$ cd \ethernut-4.1.1\nutapp-30d-ram\xsvfexec&lt;br /&gt;
$ SET PATH=C:\ethernut-4.1.1\nut\tools\win32;C:\Programs\GNUARM\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Probably you will have installed Nut/OS in a different location and need to modify the shwon commands accordingly. The corresponding Linux commands are similar, but typically do not require to add any additional path.&lt;br /&gt;
Now we build this Nut/OS application like any other with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ make clean&lt;br /&gt;
$ make&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The last command should produce something like&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arm-elf-gcc -c -mcpu=arm7tdmi -O0 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes &lt;br /&gt;
    -fverbose-asm -Wa,-ahlms=xsvfexec.lst -DETHERNUT3 -Ic:/ethernut-4.1.1/nutbld-30d-ram/include  &lt;br /&gt;
    -Ic:/ethernut-4.1.1/nut/include  xsvfexec.c -o xsvfexec.o&lt;br /&gt;
arm-elf-gcc -c -mcpu=arm7tdmi -O0 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes &lt;br /&gt;
    -fverbose-asm -Wa,-ahlms=tapsm.lst -DETHERNUT3 -Ic:/ethernut-4.1.1/nutbld-30d-ram/include  &lt;br /&gt;
    -Ic:/ethernut-4.1.1/nut/include  tapsm.c -o tapsm.o&lt;br /&gt;
arm-elf-gcc -c -mcpu=arm7tdmi -O0 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes &lt;br /&gt;
    -fverbose-asm -Wa,-ahlms=host.lst -DETHERNUT3 -Ic:/ethernut-4.1.1/nutbld-30d-ram/include  &lt;br /&gt;
    -Ic:/ethernut-4.1.1/nut/include  host.c -o host.o&lt;br /&gt;
crurom -r -ourom.c cpld&lt;br /&gt;
arm-elf-gcc -c -mcpu=arm7tdmi -O0 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes &lt;br /&gt;
    -fverbose-asm -Wa,-ahlms=urom.lst -DETHERNUT3 -Ic:/ethernut-4.1.1/nutbld-30d-ram/include  &lt;br /&gt;
    -Ic:/ethernut-4.1.1/nut/include  urom.c -o urom.o&lt;br /&gt;
arm-elf-gcc xsvfexec.o tapsm.o host.o urom.o -mcpu=arm7tdmi -nostartfiles &lt;br /&gt;
    -Tc:/ethernut-4.1.1/nut/arch/arm/ldscripts/at91_ram.ld -Wl,-Map=xsvfexec.map,--cref,--no-warn-mismatch &lt;br /&gt;
    -Lc:/ethernut-4.1.1/nutbld-30d-ram/lib c:/ethernut-4.1.1/nutbld-30d-ram/lib/nutinit.o -lnutfs  &lt;br /&gt;
    -lnutcrt -lnutos -lnutarch -lnutdev  -o xsvfexec.elf&lt;br /&gt;
arm-elf-objcopy -O ihex xsvfexec.elf xsvfexec.hex&lt;br /&gt;
arm-elf-objcopy -O binary xsvfexec.elf xsvfexec.bin&lt;br /&gt;
rm xsvfexec.elf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
A notable line is the one that calls crurom. This tiny utility is part of the NUT/OS installation and converts all files located in subdirectory cpld to a C source code file, which is then compiled in the next step. Remember, that our CPLD programming file npltut01.xsvf has been placed in this directory and the crurom utility will convert its contents to be included into the UROM file system. The XSVF Executor is then able to read this contents with normal file I/O functions. If that is all Greek to you, don't worry. At least the XSVF Executor will know, what to program into the CPLD. :-)&lt;br /&gt;
The resulting file we are interested in is the raw binary image of our application, named xsvfexec.bin. If we enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ make install&lt;br /&gt;
cp xsvfexec.hex c:/ethernut-4.1.1/nut/bin/arm7tdmi/xsvfexec.hex&lt;br /&gt;
cp xsvfexec.bin c:/ethernut-4.1.1/nut/bin/arm7tdmi/xsvfexec.bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
then the binary image, along with the unused hex file, will be moved to the binary target directory. At the time of this writing the default installation keeps this directory in the source tree, which is not nice really.&lt;br /&gt;
Now use the bootloader as explained in the Ethernut 3 Hardware Manual. Windows users will prefer TFTP32D to transfer the image to the Ethernut 3 RAM. Make sure to have set up everything as described in the Ethernut 3 Hardware Manual with the TFTP server and the terminal emulator running on your PC. Now press the reset button on the Ethernut Board and the space bar in your terminal emulator, where the BootMon bootloader will prompt you for the configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;BootMon 1.0.2&lt;br /&gt;
&lt;br /&gt;
MAC address (000698300035):&lt;br /&gt;
IP address (192.168.192.35):&lt;br /&gt;
Net mask (255.255.255.0):&lt;br /&gt;
Default route (0.0.0.0):&lt;br /&gt;
TFTP IP (192.168.192.222):&lt;br /&gt;
TFTP Image (httpserv.bin): xsvfexec.bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Change the name of the TFTP Image, so that BootMon will load the XSVF Executor. If you followed these instruction, then the&lt;br /&gt;
[[File:../../img/npl-exec-tftp.png|Executor Upload]]&lt;br /&gt;
Soon after the TFTP upload finished, the XSVF Executor banner will appear in the terminal emulator window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;100 XSVF-Executor 1.1.2 on Nut/OS 4.1.1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Now the board is in an extremly critical phase and you should keep your hands off until the message.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;199 OK&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
appears in the terminal window.&lt;br /&gt;
Your's doesn't? It shows the following message instead?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;402 ERROR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
OK, it '''should''' display this error. I mislead you for a good reason. You are probably very excited to burn your first Verilog code into a CPLD and ready to make fatal errors. Calm down, think about further actions twice and then modify the jumper settings on your Ethernut. Stop! Switch off the power supply first, please.&lt;br /&gt;
Here are the required jumpering to enable the CPU to control the CPLD JTAG lines.&lt;br /&gt;
&lt;br /&gt;
[[File:../../img/s-jtag-prog-xc95.png|Executor Upload]]&lt;br /&gt;
After pwoering up your board with this jumper configuration, BootMon will load the XSVF Executor again, which should then report&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;coding&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;199 OK&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Additionally you notice, that the green User LED is now on.&lt;br /&gt;
'''Congratulations!'''&lt;br /&gt;
&lt;br /&gt;
You should not forget to set the jumpers back to the default. Otherwise other applications may toggle the port bits used for CPLD programming with undetermined results.&lt;br /&gt;
&lt;br /&gt;
[[npl-verilog.html|Previous]] [[npl.html|Contents]]  [[npl-trouble.html|Next]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Harald</name></author>	</entry>

	</feed>