Quadcopter
The quad/
directory contains all code that programs the quadcopter. This
includes any C libraries we have written, any HDL to program the Zybo on
the quad, and the XSDK main project that runs on the Zybo.
Brief Intro
The main quad application is located at src/quad_app/
.
To run this application on the Zybo, we need to implement the hardware drivers,
and provide a main
function. This is done in xsdk_workspace/real_quad/src
.
We can also run this application on our own laptops for testing. We call this
implementation the "virtual quad". This is done in src/virt_quad
.
Building
Primarily Libraries and Executables
To build the libraries and executables:
make
You can also build each library individually inside their respective project directories:
cd src/<project> && make
NOTE: All build artifacts will be placed in lib
or bin
(depending on
whether it is a library or executable, respectively)
XSDK Project (embedded project that runs on the Zybo)
To build the XSDK project, use the XSDK IDE. Refer to the Xilinx How-to
for more instructions. Be sure to select the xsdk_workspace
directory in the
quad directory as your "workspace."
Testing
Automated Tests
Write tests! It makes automating things so much easier.
Run the unit and functional tests:
make test
And glad to hear you are interested in writing your own unit tests! Look at the
README and examples in our simple testing library at src/test
.
Manually testing the hardware interface
Of course, we cannot run automated tests on code that needs the Zybo. But we have manual tests that you can use to test each specific driver in the hardware interface.
Look in xsdk_workspace/real_quad/src/hw_impl_zybo_tests.c
for instructions.
Ideally, you would run these tests from the XSDK IDE.
Sections
Quad Application
Quad App on the Zybo (Real Quad)
Quad App on Unix (Virtual Quad)
Other Documents
Zybo Pinout Assignments
How to use Xilinx software tools
XSDK FYIs
Definitely first read the Xilinx How-To.
The XIlinx SDK has a few quirks that are important to watch out for:
- From the documentation, if you abort program execution while at a breakpoint inside an interrupt handler, when re-running the program, interrupts don’t fire. You have to do a hard reset of the board (cycle power) to have interrupts work again.
- After doing a
git pull
orgit checkout
, refresh the files by right-clicking on the project in the sidebar and clicking "Refresh" - The project does not detect changes in header files, so if you modify a
.h
file, you should do a clean before re-building, otherwise you may experience unexpected behavior. We got into the habit of always doing a clean before a build whenever creating code that will be put on the quadcopter.