Wiki

This version (12 Jan 2021 13:17) was approved by Dan Hotoleanu.

AD9656 Bare Metal Quick Start Guide

Xilinx Platform

This guide provides some quick instructions on how to setup the AD9656 on the ZCU102 carrier board.

Downloads

Make

Building no OS on Linux

Prerequisites

Before generating the binaries, it is required to define some paths that are mandatory when using the provided Makefile. Those paths give access to certain utilities and compilers that come with the carrier's SDK and are used in the building process.

The following example presents the usage of the environment scripts.

Supposing the SDK is installed in /tools directory, the folders would be organized in a similar structure:

tools
├── intelFPGA
│   └── 18.1
└── Xilinx
    ├── DocNav
    ├── Downloads
    ├── SDK
    │   ├── 2017.4
    │   └── 2018.3
    ├── Vivado
    │   ├── 2017.4
    │   └── 2018.3
    └── xic

When adding the SDK's utilities path to the PATH envvar, the following scripts come in handy:

Intel

sergiu@analog:~$ cd no-OS/tools/scripts/platform/intel/
sergiu@analog:~/no-OS/tools/scripts/platform/intel$ source environment.sh /tools/intelFPGA/ 18.1

Xilinx

sergiu@analog:~$ cd no-OS/tools/scripts/platform/xilinx/
sergiu@analog:~/no-OS/tools/scripts/platform/xilinx$ source environment.sh /tools/Xilinx/ 2017.4

or

sergiu@analog:~/no-OS/tools/scripts/platform/xilinx$ source environment.sh /tools/Xilinx/ 2018.3
Compiling the sources

Go in the project directory that should be built.

sergiu@analog:~$ cd no-OS/projects/adrv9009/
sergiu@analog:~/no-OS/projects/adrv9009$ ls
Makefile  profiles  src  src.mk

Copy the generated hardware files (hdf/sof & sopcinfo) in the project folder and run make.

Intel

sergiu@analog:~/no-OS/projects/adrv9009$ ls
Makefile  profiles  src  src.mk  system_bd.sopcinfo  adrv9009_a10gx.sof	
sergiu@analog:~/no-OS/projects/adrv9009$ make

...

Xilinx

sergiu@analog:~/no-OS/projects/adrv9009$ ls
Makefile  profiles  src  src.mk system_top.hdf
sergiu@analog:~/no-OS/projects/adrv9009$ make

...

Now, after the project has been succesfully compiled, the output folder will look like the following:

sergiu@analog:~/no-OS/projects/adrv9009$ tree build -L 1
build
├── app
├── bsp
├── obj
├── release.elf
└── tmp

Additionaly, after the .elf file has been generated, the software can be uploaded to the board:

sergiu@analog:~/no-OS/projects/adrv9009$ make run

...
14 Apr 2020 18:12 · Antoniu Miclaus

Building no-OS on Windows

Prerequisites

Before generating the binaries, it is required to define some paths that are mandatory when using the provided Makefile. Those paths give access to certain utilities and compilers that come with the carrier's SDK and are used in the building process.

The following example displays the usage of the environment scripts.

Supposing the SDK is installed on C:\ drive, the folders would be organized in a similar structure:

C:\
├── intelFPGA
│   └── 18.1
└── Xilinx
    ├── DocNav
    ├── Downloads
    ├── SDK
    │   ├── 2017.4
    │   └── 2018.3
    ├── Vivado
    │   ├── 2017.4
    │   └── 2018.3
    └── xic

When adding the SDK's utilities path to the PATH envvar, the following scripts come in handy:

  • Run powershell as administrator

Intel

PS C:\> cd .\no-OS\tools\scripts\platform\intel\
PS C:\no-OS\tools\scripts\platform\altera> .\environment.bat C:\intelFpga 18.1

Xilinx

PS C:\> cd .\no-OS\tools\scripts\platform\xilinx\
PS C:\no-OS\tools\scripts\platform\xilinx> .\environment.bat  C:\Xilinx 2017.4

or

PS C:\no-OS\tools\scripts\platform\xilinx> .\environment.bat  C:\Xilinx 2018.3
  • After setting the environment variables, open another shell instance
Compiling the sources

Go in the project directory that should be built.

PS C:\> cd .\no-OS\projects\adrv9009\
PS C:\no-OS\projects\adrv9009> Get-ChildItem -name
Makefile
profiles
src
src.mk

Copy the generated hardware files (hdf/sof & sopcinfo) in the project folder and run make.

Intel

PS C:\no-OS\projects\adrv9009> Get-ChildItem -name
profiles
src
adrv9009_a10gx.sof
Makefile
settings
src.mk
system_bd.sopcinfo
PS C:\no-OS\projects\adrv9009> make

...

Xilinx

PS C:\no-OS\projects\adrv9009> Get-ChildItem -name
Makefile
profiles
src
src.mk
system_top.hdf
PS C:\no-OS\projects\adrv9009> make

...

Now, after the project has been succesfully compiled, the output folder will look like the following:

PS C:\no-OS\projects\adrv9009> Get-ChildItem .\build\ -name
app
bsp
obj
tmp
release.elf

Additionaly, after the .elf file has been generated, the software can be uploaded to the board:

PS C:\no-OS\projects\adrv9009> make run

...
14 Apr 2020 18:23 · Antoniu Miclaus

Build no-OS with GNU make

This guide provides some quick instructions on how to build and run the no-OS on almost all of the supported platforms.

Be sure you are using the latest release version and you have the corresponding branches for both HDL and no-OS(Release notes).

Building the HDL

ADI does not distribute the bit/elf files of these projects. They must be built from the sources. The HDL User Guide provides detailed information and steps to build the HDL project on your desired carrier. The build flow is developed around GNU make. You may use a Windows or Linux OS, but do NOT seek OS- specific support. The prerequisite to the building process is that you are able to run 'quartus', 'vivado' and 'make' all from a shell (Cygwin or Linux).

Building the HDL is as simple as running make on your desired project and carrier.

hdl/projects/daq3/kcu105> make
hdl/projects/daq3/zc706> make
For Intel nios2 based processor projects you have to turn off the MMU (Memory Management Unit used for Linux OS) when building the HDL.
hdl/projects/daq3/a10gx> make MMU=0

We strongly recommend having a clone of no-Os and HDL in the same folder:

  ~/github/hdl/
  ~/github/no-OS/

In every project folder, you can find a separate subfolder for each supported carrier. In each carrier folder, there is a Makefile which points to the bit files and HDL deliverables (system_top.hdf/project_name.sof) and other makefiles (*.mk) containing the software dependencies.

Building the software

Change your current directory to your targeted project and run make:

  [~] cd fmcdaq2/zc706 
  [~] make

See Troubleshooting section for guideline how to solve make related issues.

Running the software

Make sure that the FPGA is powered on and connected to the PC and then run the command:

  [~] make run

The make run will downloads the bitstream on the FPGA and after that program the board with the elf file.

The software is started before the memory debugger disconnects.

Evaluating the result

After the software has been run on the FPGA, run the command:

  [~] make capture

By default, the software captures (in case of ADC based projects) the data received from the device in the RAM.

  rx_xfer.start_address = *_MEM_BASEADDR + OFFSET;
  rx_xfer.no_of_samples = value;
  dmac_start_transaction(ad_core_dma);

These values differ depending on the architecture and device.

The Makefiles have these parameters initialized with default values:

The number of samples is specified in the project's common Makefile. (ex: fmcadc4)

The script will write a capture_chx.csv file for every channel.
In the case of an RF device which has I and Q data for each channel, the number of capture_chx.csv files will double.

For example, for fmcomms2(AD9361: 2RF channels):

fmcomms2
channel1 data I capture_ch1.csv
data Q capture_ch2.csv
channel2 data I capture_ch3.csv
data Q capture_ch4.csv

Clean the workspace

  [~] make clean

Troubleshooting

  make: *** No rule to make target `../../../hdl/projects/daq2/vc707/daq2_vc707.sdk/system_top.hdf', needed by `hw/system_top.bit'.  Stop.

The HDL deliverables cannot be found. Maybe the targeted HDL project is not built, or the defined path is not valid. Make sure, that you build the HDL before running the no-OS or specify the location of the HDL deliverables explicitly.

  • Specify HDL location:

For Xilinx

  [~] make M_HDF_FILE=/<path_to_hdf>/system_top.hdf

For Intel

  [~] make M_SOPCINFO_FILE=/<path_to_sopcinfo>/system_bd.sopcinfo

Understanding/Modifying things

The best place to start in the no-OS main function in “project/project_name.c”. It shows how individual components of a data path chain are initialized and programmed for the application. After you have the default setup working, feel free to add your own customization routines and/or signal processing functions to either HDL or no-OS.

Navigation - Build no-OS with GNU make

13 Mar 2018 16:39 · Andrei Grozav

GUI

  • Open Xilinx Software Development Kit (XSDK) and provide the workspace location.
  • Create a new Application Project: go to File → New → Application Project

Creating a new application project

  • Create a new Hardware Platform: click New from the Target Hardware section

Creating a new hardware platform

Import hardware description file

  • Give a name to the project and to the board support package and click Next

Application project settings

  • Select the Empty Application templeta and click Finish

Choose application template

  • The new Empty Application project should look like:

Empty application project

Some applications (e.g. FMCOMMSx), when a Microblaze processor is used, requires an increased HEAP size for dynamic memory allocation. Make sure the HEAP size is at least 0x100000.
  • Copy the source code files into the src directory
  • Make sure you uncomment the the required carrier vendor and CPU architecture from the app_config.h (or config.h) header file.
  • Example for choosing the Altera carrier in the app_config.h header file:
//#define XILINX
#define ALTERA
  • If there are multiple folders present in in the src one, include all the paths of the folders: go to the settings of the project and in the C/C++ Build → Settings → Tool Settings → gcc compiler → Directories section and add the paths of all the folders.
  • The SDK should automatically build the projects and the Console window will display the result of the build. If the build is not done automatically select the Project → Build Automatically menu option.
  • At this point the software project setup is complete, the FPGA can be programmed and the software can be downloaded into the system. You can program the FPGA by clicking on Xilinx Tools → Program FPGA
  • After the FPGA was programmed, we need to create a new Run configuration, by selecting RunRun Configurations…, in the Run Configuration windows select the Xilinx C/C++ application (System Debugger) and click at the New Configuration button at the upper left corner.

Create new run configuration

  • If your target carrier has a Zync SoC, make sure, that you specify the Initialization file, and select the Run ps7_init and Run ps7_post_config options.

Define Zynq initialization file

  • At the Application tab define your current project name and application executable. (.elf)

Define Zynq initialization file

  • The output of the example program can be viewed in the SDK console by enabling the Connect STDIO Console option and setting the baud rate of the UART port to 115200.

Define Zynq initialization file

  • As an alternative a UART terminal can be used to capture the output of the example program. The number of used UART port depends on the computer's configuration. The following settings must be used in the UART terminal:
  • Baud Rate: 115200bps
  • Data: 8 bit
  • Parity: None
  • Stop bits: 1 bit
  • Flow Control: none
  • When the run configuration is done, the software can be started by clicking the Run button.
  • Your new bare metal application should run
27 Feb 2015 14:57 · Istvan Csomortani

More information

resources/eval/user-guides/ad9656/software/baremetal.txt · Last modified: 12 Jan 2021 13:14 by Dan Hotoleanu