# Getting Started with XSDK This directory is reserved for XSDK projects. ## What is XSDK XSDK is a development tool made by Xilinx to create the files necessary to boot the hardware and software on the FPGA. It includes a test editor based in eclipse so the tools should feel vaguely familiar. [XSDK documentation webpage](https://www.xilinx.com/products/design-tools/embedded-software/sdk.html) ## Setup XSDK, being based on Eclipse, is rather fragile, so do yourself a favor and read this section so things get setup correctly. 1. When you first open eclipse, select this directory, `xsdk_workspace`, as your workspace (see what we did there?). 2. When you get to your workbench, your project pane should be empty. To add these projects, right-click on the project pane, and click on something like "import projects". 1. Select "Import Existing Projects" (wherever that is) 2. And then select the xsdk_workspace as the folder where you want to import projects. Add them all. 3. If things are going swimmingly, then you should be able to build everything and be off on your merry embedded endeavors. ## XSDK Basics ## Creating a BOOT.bin file The `boot.bin` file is the file that the ZYBO board used on the quad uses to produce the hardware platform and run the software for our program to run. In a standalone application(no operating system) this should be on only file placed on the SD-card. #### What to Do Before To correctly make a boot.bin file (using no operating system) you must have the following: - Hardware `.bit` file - Output of hardware toolset (ISE for now) - Path: - Project `.elf` file - Be sure to confirm project is built in XSDK - Path: - Boot loader `.elf` file - The current boot loader is a default a standalone for the Zybo board - Be sure to confirm project is built in XSDK - Path: NOTE: None of the `.elf` files are on GIT to reduce clutter #### Creating a BOOT file In order to correctly create the boot file you must have all the above files updated. Within XSDK: 1. Build -> Create Boot Image 2. Select `\*.bif` path: __//TODO__ 3. Click add 4. Select `zybo_fsbl.elf` __//TODO__ 5. Confirm bootloader is checked and __//TODO__ 6. Click add 7. Select `MicroCART\quad\xsdk_workspace\sytem_hw_platform\system.bit` 8. __//TODO__ 9. Click add 10. Select `real_quad.elf`__//TODO__ 11. __//TODO__ 12. Copy Boot.bin file at __//TODO__ to SD Card 13. Plus SD card into quad and power on board If anything here is unclear there is a deeper explanation in [Xilinx: how to create a Boot Image](https://www.xilinx.com/support/documentation/sw_manuals/xilinx14_7/SDK_Doc/tasks/sdk_t_create_zynq_boot_image.htm) ## XSDK Quirks The Xilinx SDK has a few quirks that are important to watch out for: 1. From the [documentation](https://www.xilinx.com/support/documentation/sw_manuals/xilinx14_7/SDK_Doc/tasks/sdk_t_tcf_limitations_faq.htm), 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. 2. After doing a `git pull` or `git checkout`, refresh the files by right-clicking on the project in the sidebar and clicking "Refresh" 3. 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.