Making GUI for Atlys board by Visual C++ programing and Visual Studio !

133 views
Skip to first unread message

majid amk

unread,
Jan 17, 2014, 8:24:31 PM1/17/14
to fpgalin...@googlegroups.com
Hi all,

Thank you for your great support and effort. I have already used the FPGALinke solution for my Altys board and successfully tested it !

Now, I am making a GUI by MFC VC++ programing and I really need to develop it for implementing my VHDL algorithm
on this board for monitoring on the PC side. Has anyone ever tried this before? and do you think that it would be possible?
Any advice, help or start points would be greatly appreciated !!

Chris McClelland

unread,
Jan 17, 2014, 9:41:56 PM1/17/14
to fpgalin...@googlegroups.com

MFC is just a class-library; code that uses MFC is still just plain old C++, which will link with libfpgalink.dll just fine. You could just take the flcli code, rename it main.cpp and start adding MFC stuff to it.

Chris

--
You received this message because you are subscribed to the "FPGALink Users" mailgroup (see http://www.makestuff.eu/wordpress/software/fpgalink/).
 
To post to this group, send email to fpgalin...@googlegroups.com
To unsubscribe from this group, send email to
fpgalink-user...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fpgalink-users?hl=en
 
---
You received this message because you are subscribed to the Google Groups "FPGALink Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fpgalink-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

majid amk

unread,
Sep 23, 2014, 5:54:25 AM9/23/14
to fpgalin...@googlegroups.com
Hi,
Would you please provide me some links for downloading libfpgalink.dll, libfpgalink.lib, and required USB driver
for my board which is Digilent Atlys fpga board. I couldn't find them as I searched enough on FPGALink today.

Thanks,

Chris McClelland

unread,
Sep 23, 2014, 6:10:26 AM9/23/14
to fpgalin...@googlegroups.com
Hi Majid,

I don't supply binary builds of the FPGALink DLLs, I only supply the
source code. You can work through the quick-start for Atlys which is
linked at the bottom of the (new) homepage:

https://github.com/makestuff/libfpgalink/wiki/FPGALink

This will guide you through the process of building the host-side DLLs
and tools, and the cksum VHDL example. If you prefer Verilog you can
choose to build the Verilog edition of the cksum example instead.

Chris
> --
> You received this message because you are subscribed to the "FPGALink Users"
> mailgroup (see http://www.makestuff.eu/wordpress/software/fpgalink/).
>
> To post to this group, send email to fpgalin...@googlegroups.com
> To unsubscribe from this group, send email to
> fpgalink-user...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/fpgalink-users?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "FPGALink Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fpgalink-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

majid amk

unread,
Sep 23, 2014, 9:01:04 AM9/23/14
to fpgalin...@googlegroups.com
Thanks Chris,

I am doing the quick-start but on windows which is 7 and 32-bit operating system.
i am always facing a problem for step 6 :

6) Launch the new desktop shortcut & continue at the shell-prompt

When I lunch the shortcut I can't type or past anything because the shell-prompt will close immediately!
Any solution please!? I have Visual Studio 2010 and also ISE 14.2 instilled also.

Chris McClelland

unread,
Sep 23, 2014, 9:22:50 AM9/23/14
to fpgalin...@googlegroups.com
So right-click the shortcut, choose "Properties", select the text in
the "Target:" box and paste it into Notepad. Remove the "%comspec% /c"
from the beginning and then replace all occurrences of "&&" with a
newline. You'll end up with something like this (don't use this; this
is from my PC and will probably be different from yours; I put this
here for illustration only):

set HOSTTYPE=x64
set PATH=C:\Python27\;C:\Xilinx\14.7\ISE_DS\ISE\bin\nt64;%PATH%
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86
set MACHINE=x86
C:\makestuff\msys\bin\bash.exe --login

Now start a new DOS box and enter each line in turn. This will help
you track down the error. If one of the commands cannot be found, find
out where that command actually is on your PC and fix it in the
shortcut's Target box. Also, let me know what you did because it's
possible I need to update the installer.

Chris

majid amk

unread,
Sep 23, 2014, 10:50:29 AM9/23/14
to fpgalin...@googlegroups.com
1. Here is mine:

%comspec% /c set HOSTTYPE=x86&&set PATH=C:\Python27\;C:\Xilinx\14.2\ISE_DS\ISE\bin\nt;%PATH%&&"c:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86&&set MACHINE=x86&&C:\makestuff\msys\bin\bash.exe --login

2. After editing it into a Notepad:

set HOSTTYPE=x86
set PATH=C:\Python27\;C:\Xilinx\14.2\ISE_DS\ISE\bin\nt;%PATH%
"c:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

set MACHINE=x86
C:\makestuff\msys\bin\bash.exe --login

3. I instilled DosBox 0.74 (I am not sure whether you mean this tool from mentioning "new DOS box" or not!) and started to enter each edited lines. After entering the third line which is:   "c:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
I got this Error:    Illegal command: "c:\Program.

majid amk

unread,
Sep 23, 2014, 11:10:17 AM9/23/14
to fpgalin...@googlegroups.com
Sorry!
Please ignore my last message. I entered those lines into  run.exe shell and then started to run the shortcut and it is working I think!!
I had a mistak lik:  C:\makestuff\makestuff  also in the rout. :)

majid amk

unread,
Sep 23, 2014, 11:25:41 PM9/23/14
to fpgalin...@googlegroups.com
Hi,

Before using MFC to end up with a GUI by Microsoft Visual Studio 2010 first I created a
console win32 project and added the following files to my project to debug and understand each functions:
https://github.com/makestuff/libfpgalink/tree/20140524/examples/c

I also used   "-v 1d50:602b:0002 -p J:D0D2D3D4:fpga.xsvf "  as my command arguments:
The first two functions called "flInitialise()" and "flOpen" both are working and return FL_SUCCESS.

In the "main.c" file I faced "FL_FILE_ERR" error for the following code line (which is line number 187):           
status = flProgram(handle, progConfig, NULL, &error);

As it is mentioned in the doc:  FL_FILE_ERR if the programming file is unreadable or an unexpected format.
I have copied "fpga.xsvf" in my project beside *.exe file and other places also but, still "flProgram" faction return this
 error as status (status=FL_FILE_ERR ).  Any idea please to continue until read and write data successfully!?

Chris McClelland

unread,
Sep 24, 2014, 3:58:39 AM9/24/14
to fpgalin...@googlegroups.com
The FL_FILE_ERR token specifies only a broad category of error. There
will be a more specific human-readable error in the "error" string
after the failing function returns. It will have been printed to
stderr[1]. What does it say?

Is the behaviour different if you build the C example from the
command-line rather than from the Visual Studio IDE (i.e click the
console link on your desktop and do cd libs/libfpgalink/examples/c;
make deps)?

Chris

[1]https://github.com/makestuff/libfpgalink/blob/20140524/examples/c/main.c#L273

majid amk

unread,
Sep 28, 2014, 5:22:31 PM9/28/14
to fpgalin...@googlegroups.com
Hello again Chris!

Sorry for the late replay!

For both comandline and Visual Studio IDE, I ended up with the following message:
(Please see attached .jpg files)

Attempting to open connection to FPGALinke device 1d50:602b:0002...
Executing programing configuration "J:D0D2D3D4:fpga.xsvf on FPGALink device 1d50:602b:0002...
flProgram(): flLoadXsvfAndConvertToCsvf(): bufAppendFromBinaryFile(): No such file or directory.
Command-line.jpg
Visual Studio 2010.jpg

Chris McClelland

unread,
Sep 28, 2014, 7:35:36 PM9/28/14
to fpgalin...@googlegroups.com
Well, the obvious question: "is there a file called fpga.xsvf in the
current directory?"

majid amk

unread,
Sep 28, 2014, 8:44:56 PM9/28/14
to fpgalin...@googlegroups.com
For camand-line project the answer is No!
While for the Visual Studio project is Yes!

I copied "fpga.xsvf" in the comand-line project folder now which is located in:    C:\makestuff\libs\libfpgalink\examples\c\msvc.x86\rel
And the board got programed now (only for Comand-line method) !

But still the problem is remained for my main project which is created be visual studio.
In the Visual Studio project folder I had copied "fpga.xsvf" before beside *.exe file and still nothing changed and couldn't program it.
The directory of this project is:         D:\0_My_ATLYS_Board\FPGALink\GUIApplicationDesign\App1\App11\Debug

Now we can say the behavior different if I build the C example from the
command-line rather than from the Visual Studio IDE !!


Chris McClelland

unread,
Sep 29, 2014, 5:48:28 AM9/29/14
to fpgalin...@googlegroups.com
Every process has the notion of a current directory, whether it is
started from the command-line, or from Visual Studio. That is the
directory where the process's file I/O is done (in the absence of any
explicit instructions to change the current directory). You probably
need to spend time learning these fundamentals before tackling an
FPGALink-based project.

http://en.wikipedia.org/wiki/Working_directory
Reply all
Reply to author
Forward
0 new messages