Post Go back to editing

Compiling API

Has anyone had any luck compiling the AD9371 (Mykonos) API? I am trying to compile the API from on the SD card that came with our eval board and a Xilinx Zynq eval board. We have also tried it under the image that is posted at

  • can you please help us in understanding your setup and errors seen?

    1. which compiler are you using?
    2. what is the platform?
    3. are you integrating the API into a project?
    4. what are the errors that you are getting?
  • I am using the SD card that came with our AD9371 eval board and a Xilinx Zynq ZC706 eval board. Attached is a screenshot showing the system info.

    Currently I am trying to use the c files generated by the eval software (v2.0.42) to configure the AD9371. After it is configured, we can use Matlab/Python/etc to interface with it throught the DLL. So at this point, I have downloaded the API (v3518, and added the eval sw generated files to it (as outlined in the preliminary user guide UG-992).

    The default system is missing needed headers and then conflicts arise when we do bring those headers in from another kernal that we are developing for this particular eval board. Eventually we get to the point of missing a dependecy that we can't find anywhere and is probably an Xilinx specific one. The compiler is gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3. We are seeing similar problems under both the Linux distro that came with our board and the Linux distro posted on the wiki (

    I would rather not go into specific details about errors at this point because I'm more just trying to figure out if anyone has built the API on the defualt SD image (either the delivered or downloaded one).

  • 1) What is the tool chain are you using for building the API code?

    You can build it on windows using Xilinx SDK by creating an eclipse C project ( File-> New -> Application project) or on Linux distro using tool chain which come along Linux SDK.

    2) You should get most of Xilinx specific dependencies with this. 

    3) API code provide function skeletons in 'common.c' , which you need to fill with your board and fpga specific implementation. 

    4) Default implementation stand good for  Xilinx Zynq ZC706 eval board and you can use it as it is as you are using same board. You still need to provide fpga specific implementation. 

    4) Once you are able to do so, please share compilation error log. We can go through them error by error to find out a resolution.

  • We initially were using the CMake under Linux with gcc/g++. Again, this was trying to compile the API directly on the SD card that shipped with our eval baord. We tried compiling using the Xilinx SDK under Windows and still have the same problems.

    The error log is simple in that included dependencies cannot be found. It starts with simplying not being able to find spi.h, then device.h, and eventually ends at fpga_axi.h. This is only if we pull in spi.h, device.h, etc. from another Linux build. These files are not found on the SD cards that came with the devices or the posted SD card images.

    Here is another post looking for the fpga_axi.h file

  • These are platform and fpga specific files which you need to implement according to your specific fpga platform.

    Please refer following posts for more details.

  • Thank you for the links. As described there, iIt makes sense that the portions are platform specific; however, we are using the Xilinx zc706 evaluation platform. You say in  "Files you mentioned, (spi.h, logging.h, timer.h, fpgi_axi.h) are platform specific files, available on Xilinx zc706. You will need them only if you use Xilinx zc706 evaluation platform." Since we are on the zc706, how do we use/find/get these files?

  • Hello,

    I am following up to see if there is any suggestions on how we can compile the API for the Xilinx zc706 as described in earlier messages.

  • 'spi.h' is basically header file for our implementation of spi functionality using spidev interface. It implements following functions which you can also implement using spidev interface.


    int32_t HAL_initSpi( uint8_t chipSelectIndex, uint8_t spiMode);
    int HAL_closeSpi();
    int HAL_spiSSenable(uint8_t chipSelectIndex);

    int HAL_spiWrite(const unsigned char *txbuf, uint32_t n_tx);
    int HAL_spiRead(unsigned char *txbuf, uint8_t n_tx, unsigned char *readdata);

    Similar way 'logging.h' is our logging implementation and provide following functions.

    void HAL_openLogFile(const char *filename);

    void HAL_writeToLogFile(const char *msg, ...);

    void HAL_closeLogFile(void);

    void HAL_flushLogFile(void);

    'timer.h' declares following timer specific functions we implement.

    void HAL_storeCurrentTime(void);

    void HAL_getElapsedTime_ms(double *elapsedTime_ms);

    void HAL_setTimeout_ms(uint32_t timeOut_ms);

    void HAL_setTimeout_us(uint32_t timeOut_us);

    uint8_t HAL_hasTimeoutExpired(void);

    'fpgi_axi.h' declares following function for reading from and writing to fpga pl space.

    int32_t fpgaAxiReadWrite(char *uiod, uint32_t map_size, uint32_t count, uint32_t offset, uint8_t rw, uint32_t *data);

    You can mmap fpga memory via (/dev/uioX)interface do a read/write.

    You can use these header files as a hint for required functions which need to be implemented.

    Hope this help.

  • Hi,

    I'm facing the same issue.Have you got these "fpga specific files" and how?