Running an Application
To run an application on the PYNQ robot you need to get source code, or program it, then compile the program and run it. The starting image has a few example applications pre-installed in the folder
/home/student/pynq-io-library/applications/
For example, an application called buttons-ledbar.
Start a terminal within Visual Studio Code, MobaXTerm, or using SSH and login.
Change to the application folder with:
Listing the directory contents:
reveals the source source file main.c and the file Makefile that (somewhat cryptically) tells the compiler how to build the application.
Note that this application also uses source code from the folder /home/student/pynq-io-library/applications/lib/ledbar/.
Compile the source code and build an executable as follows:
If successful, it will show the following:
student@pynq:~/pynq-io-library/applications/buttons-ledbar$ make
(DEP) ../lib/ledbar/ledbar.d
(DEP) main.d
(OBJ) main.o
(OBJ) ../lib/ledbar/ledbar.o
(EXE) main
It has compiled all source files and built an executable file called main, which can be run with:
Don't forget the ./ at the beginning, otherwise it won't work.
It it works, congratulations! Otherwise, check all the steps carefully and if it still doesn't work, get help.
Now proceed by checking the source code file, main.c and see how the behavior is coded.
You can open it in Visual Studio Code, or MobaXTerm, or if you are using SSH, you can use the simple editor nano: