OpenWiFi - How to use ZYNQ SDR in Linux mode

Attention

You are not allowed to download any native file from the SDR boards. The source files are available at openwifi github repository.

Supported hardware in the testbed

Two types of ZYNQ SDR (i.e. ZEDzynqSDR and zc706zynqSDR) in w-iLab.t can be used for Openwifi experiments. The zcu102zynqSDRs are for now restricted for internal usage, but will be made available in the future. For details of the hardware configuration please refer to Hardware Info ZYNQ SDR

Gentleman’s agreement

It takes time to recover the rootfs system of the ZYNQ SDR, and every user has the right to modify it. So let’s use gentleman’s agreement, in order to avoid frequently flashing the SD card.

  1. Make a copy of the user space openwifi folder, modify scripts in your own folder.
  2. If you need different kernel moduels in /lib/modules, try create a symbolic link instead of directly overwrite the original modules eg, ln -s /path/to/your/ko/folder /lib/modules/$(uname -r), remove the link before deactivating the experiment.

Please note that these are best effort measures, take back up of files on your SD card before experiment is terminated, the SD card are not meant for permanat or personal storage.

Boot Linux

The following steps describe how to run an experiment using the ZYNQ SDR in Linux mode from JTAG, it applies to users using openwifi compiled with Vivado 2018.3. If your openwifi image is compiled by Vivado 2017.4, please boot according to section Boot Linux (Depreciated) instead of this section. To boot with Vivado 2018.3 generated openwifi image, please download openwifijtagfiles_v2.0.zip to continue.

  1. Make a reservation of either a zc706zynqSDR or a ZEDzynqSDR, and its corresponding host machine. For details of which ZYNQ SDR is attached to which host, please refer to Hardware Info ZYNQ SDR.
  2. Start a jFED experiment with one SDR and its corresponding host, eg apuV4 and zc706zyncSDR2. Do draw a link between the two nodes, assign 192.168.10.1/24 on the host side and 192.168.10.122 on the SDR side. But do not specify any image for the nodes, in this case the default image will be used.
  3. After the experiment is started, reboot the ZYNQ SDR by right click on the node in jFed, select reboot and then select reboot OS.
  4. Log into the host and establish serial connection to the board using minicom. Please refer to Establish serial connection for minicom port setup. After you opened serial connection, return to this tutorial to continue. Pay special attention that ZEDzynqSDR requires additional steps.
  5. Upload openwifijtagfiles_v2.0.zip to the host node, unzip it, you will get the directory openwifijtagfiles_v2.0.
  6. Open an terminal and ssh to the host node, in the ssh terminal, cd openwifijtagfiles_v2.0 ; source /share/xilinx/Vivado/2017.4/settings64.sh and then execute xsdb. - please note that this Vivado is only used to download bitstream, it is not the same as the Vivado used to compile openwifi. - if you experience runtime error similar to the one listed below, it may be caused by environment varialbe settings, try unset LC_PAPER; unset LC_ADDRESS ; unset LC_MONETARY; unset LC_NUMERIC ; unset LC_TELEPHONE ; unset LC_IDENTIFICATION ; unset LC_MEASUREMENT ; unset LC_TIME; unset LC_NAME ;
Got $RDI_APPROOT: /share/xilinx/Vivado/2017.4
terminate called after throwing an instance of 'std::runtime_error'
what():  locale::facet::_S_create_c_locale name not valid
/share/xilinx/Vivado/2017.4/bin/loader: line 194:  6199 Aborted
  1. In the xsdb console,
    • If you are using ZEDzynqSDR, execute set board zed_fmcs2, if you are using zc706zynqSDR, execute set board zc706_fmcs2
    • After the board variable is set, execute source dow_all_cfg.tcl, after this step, get ready to interrupt uboot auto start in serial console by hitting any key, when you are ready, execute in xsdb console con.
      • If you see error such as *no targets found with "name =~"APU*"". available targets:*, please reboot the ZYNQ SDR board follow Reboot ZYNQ SDR, wait a while and then execute the tcl script again.
      • The tcl script will download all necessary files to boot, including FPGA bitstream, devicetree, kernel image, first and second stage bootloaders. We do not rely on BOOT partition of the SD card any more.
  2. When u-boot autoboot is stopped, execute disconnect in xsdb console, and execute bootm 0x3000000 - 0x2a00000 in serial console.
  3. Wait and see… after this command normally linux should be booted. Give an IP address of eth0 on the board by executing eg ifconfig eth0 192.168.10.122/24, be consistent with the link setup in your jFed experiment. You may now also log into the board via ssh, as explained in Initial configuration of OpenWiFi.

Initial configuration of OpenWiFi

Log in to the board

Do ifconfig on the host node, usually you will see an interface with the IP assigned in your jFED experiment, a sample output is shown below.

rename4   Link encap:Ethernet  HWaddr 0c:c4:7a:74:08:56
          inet addr:192.168.10.1  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::ec4:7aff:fe74:856/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:665 errors:0 dropped:0 overruns:0 frame:0
          TX packets:549 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:123464 (123.4 KB)  TX bytes:46267 (46.2 KB)

The interface name can vary, the ip address depends on the link configuration in jFed experiment. However if you don’t see such an interface, it means something went wrong with the jFed experiment, check your experiment configuration, either reactivate the experiment or report a bug in jFed.

If you have such an interface, try to log into the ZYNQ SDR, the default password is openwifi, however it might be a different one (different image or changed by other users), just set a new password with passwd command in serial console if you cannot log in.

ssh root@192.168.10.122 (password: openwifi)

Load openwifi drivers

Please download rootfs_files.zip to continue.

  1. Copy rootfs_files.zip to the board, unzip it, you will see two directories inside, adi-linux-mod contains the standard linux modules and user_space contains the user space scripts and modules for openwifi drivers.
  2. Log into the ZYNQ SDR, copy modules and create a symbolic link by executing cd /path/to/rootfs_files/ ; rm /lib/modules/$(uname -r); ln -s $(pwd)/adi-linux-mod /lib/modules/$(uname -r).
  3. Insert linux module mac80211 by executing depmod ; modprobe mac80211.
  4. Copy driver files to the user space directory by executing cd /path/to/rootfs_files/user_space ; cp ./drv32/* . -rf;.
  5. Compile sdrctl tool by executing cd /path/to/rootfs_files/user_space/sdrctl_src ; make ; cp sdrctl ../ ;.
  6. Stop the network manger before loading the driver by executing service network-manager stop.
  7. Load the driver by executing cd /path/to/rootfs_files/user_space/ ; ./wgd.sh.
  8. After this step, ifconfig -a should give an interface named sdr0, use ifconfig sdr0 up to bring it up. If you do not see sdr0, please check dmesg to see what is wrong.

Miscellaneous

  1. Antenna selection
    • By default openwifi uses rx1 tx1 antenna, it is possible that you need to manually select antenna, please refer to the Hardware Info ZYNQ SDR to determine which antennas you need.
    • For instance to select rx1 tx2, you need to run cd /path/to/rootfs_files/user_space/ ; ./set_ant.sh rx1 tx2. You need to run this after ./wgd.sh, as the setting will be overwritten each time you load the sdr module.
  2. Some additional information is available at quick start section of Openwifi, take a look if you want to have internet access to the board.
  3. Take care to match user space, driver, linux kernel and FPGA. The files provided in this tutorial (rootfs_files.zip, openwifijtagfiles_v2.0.zip) are compiled based on commit number eccec29 in openwifi master branch.
  4. Openwifi receiver uses Xilinx Viterbi core under evaluation license, this core will be disabled after a while. You will observe no SSID reported by iw sdr0 scan command, or if you observe the interupt you see the rx interrupt no longer changes (the 298 number in the sample command and results below). Then you need to power cycle the board and reboot ZYNQ SDR follow Reboot ZYNQ SDR.
root@analog:~# cat /proc/interrupts | grep sdr
     53:        298          0     GIC-0  62 Edge      sdr,rx_pkt_intr

Experiment 1: openwifi NIC as client and connect to an AP

Read this tutorial first: Access point and client. The nodes selected below are examples, they can be replaced by other nodes that supports openwifi in the testbed.

1 . Configure wlan0 in apuV4 as AP.
You need to set
hw_mode=a
channel=36

for hostapd, because currently the openwifi NIC sdr0 supports only OFDM. Use hostapd /root/hostapd.conf -dd to see more debug information.

2 . operate openwifi NIC sdr0 in zc706.

Run: iwlist sdr0 scan

You should see AP information like:

Cell 01 - Address: 04:F0:21:11:E5:55
          Channel:36
          Frequency:5.18 GHz (Channel 36)
          Quality=41/70  Signal level=-69 dBm
          Encryption key:off
          ESSID:"iperfAP"
          Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                    36 Mb/s; 48 Mb/s; 54 Mb/s
          Mode:Master
          Extra:tsf=00000000019c80dc
          Extra: Last beacon: 10ms ago
          IE: Unknown: 000769706572664150
          IE: Unknown: 01088C129824B048606C
          IE: Unknown: 030124
          IE: Unknown: 7F080000000000000040
          IE: Unknown: AF00

Then:

iwconfig sdr0 mode managed
iwconfig sdr0 essid iperfAP
ifconfig sdr0 192.168.1.10/24 up
ping 192.168.1.1

Experiment 2: openwifi communicate with commercial wifi card in ad-hoc mode

You need a commercial wifi card that support IBSS mode. To check the wifi card capability (mode, rate, etc), you can use iw list command. Please make sure they have Wi-Fi card AR9462 or AR93xx. Please avoid nodes with Wi-Fi card AR928X (ZOTAC) , QCA988x or QCA986x/988x (APU).

1 . Start ad-hoc mode of DSS node, for example dssK5 or dssJ5 :

($xxx means a parameter you should specify. The ad-hoc network SSID will be "ad-hoc-test")
($nic_name, the network interface name when you run ifconfig)
($ch_number, Wi-Fi channel number, such as 1, 6, 11)
($ip_addr, IP address you want)

sudo ip link set $nic_name down
sudo iwconfig $nic_name mode ad-hoc
sudo iwconfig $nic_name essid 'ad-hoc-test'
sudo ip link set $nic_name up
sudo iwconfig $nic_name channel $ch_number
sudo ifconfig $nic_name $ip_addr netmask 255.255.255.0
ifconfig
iwconfig $nic_name

(Now you should see … ESSID “ad-hoc-test” … Cell: xx:yy:zz…)

2 . Start ad-hoc mode of node 2 (openwifi or ZOTAC), and let it join the “ad-hoc-test” network:

($cell should be xx:yy:zz... you saw in node 1)
sudo ip link set $nic_name down
sudo iwconfig $nic_name mode ad-hoc
sudo iwconfig $nic_name essid 'ad-hoc-test'
sudo ip link set $nic_name up
sudo iwconfig $nic_name channel $ch_number
sudo iwconfig $nic_name ap $cell
sudo ifconfig $nic_name $ip_addr netmask 255.255.255.0
ifconfig
iwconfig $nic_name

Experiment 3: openwifi communicate with commercial wifi card in infrastructure mode

  1. Start openwifi AP, execute the following on the SDR board
cd /path/to/rootfs_files/user_space; ./fosdem.sh
.... (a lot of output but at the end you should see something like below)
Configuration file: hostapd-openwifi.conf
sdr0: interface state UNINITIALIZED->COUNTRY_UPDATE
Using interface sdr0 with hwaddr 66:55:44:33:22:d6 and ssid "openwifi"
sdr0: interface state COUNTRY_UPDATE->ENABLED
sdr0: AP-ENABLED
  1. Create configuration file for wpa_supplicant on the commercial Wi-Fi node
nano wpa_client_cfg.conf
network={
     ssid="openwifi"
     key_mgmt=NONE
}
  1. Associate commercial Wi-Fi interface to AP and request IP (execute cmds below on commercial Wi-Fi node)
sudo wpa_supplicant -i wlan0 -c wpa_client_cfg.conf &
sudo dhclient wlan0
  1. Now you should be able to ping the openwifi AP (192.168.13.1).

Advanced topics

Restore rootfs if SD card is corrupted

Follow instructions below if there is no usable rootfs.

  1. Download a recent openwifi image file from this link, make sure you extract the file and get an image file with .img extension, will refer to it as openwifi-xxxx.img in this tutorial.
  2. The first steps (up till step 6) are the same as the normal procedure explained in the section Boot Linux.
  3. In the 7th step, first set board variable according to your board type in the xsdb console, the rest of this step is replaced by source xsdb_dow_bs_fsbl.tcl, after this step, execute con, interrupt uboot auto start process, and execute bootm 0x3000000 0x2000000 0x2a00000 in the serial console, this will launch linux from the ramdisk.
  4. After linux is booted, in the serial console, give the eth0 an IP address by executing ifconfig eth0 192.168.10.122, replace the IP address according to your jFed experiment link setup if necessary.
  5. Find out if you have an interface in the host that has the IP assigned in your jFed experiment, as explained in Initial configuration of OpenWiFi. Make sure you can ssh to the board using user name root and password root. If this is not the case, somethign went wrong with the jFed experiment, either reactivate the experiment or report a bug in jFed.
  6. In the host, go to the directory where you store the SD card image and execute the following command, replace the board IP accordingly. This command will take more than half an hour, so be patient.
dd bs=4M if=openwifi-xxxx.img | ssh root@192.168.10.122 dd of=/dev/mmcblk0
  1. Wait until the command completes, it is possible that you need to do some preparation in the BOOT partition of the SD card. To do so, mount the partition by executing mkdir /sdcard ; mount /dev/mmcblk0p1 /sdcard/ ;. Copy files as explained in the quick start section of Openwifi. After that, execute umount /sdcard ; poweroff, reboot the board follow Reboot ZYNQ SDR.

Use an Openwifi image without an SD card

It takes time to flash the complete SD card image, therefore sometimes there is a needed to partially update the SD card based on an existing Openwifi image. Or you may want to create a new openwifi image based on an existing one.

The steps below describes how to mount an openwifi image and make changes to it. The procedure is only tested on a Linux machine.

  1. Download a recent openwifi image from this link, referred to as openwifi.img.
  2. Make new directories as mounting point of the two partitions, mkdir sdcard_mnt; cd sdcard_mnt;  mkdir rootfs; mkdir BOOT
  3. Find out necessary info to mount the image by executing sudo fdisk -l openwifi.img, sample output see below
Disk 2019_R1-2020_02_04.img: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00096174

Device                  Boot   Start      End  Sectors  Size Id Type
2019_R1-2020_02_04.img1         8192  2105343  2097152    1G  b W95 FAT32
2019_R1-2020_02_04.img2      2105344 15501311 13395968  6.4G 83 Linux
2019_R1-2020_02_04.img3         4096     6143     2048    1M a2 unknown

4. The above output shows that BOOT partition starts at sector 8192, whereas the Linux rootfs starts at sector 2105344. The mount command’s offset option takes bytes as input, not sector, therefore the offset is the starting sector multiplied by the block size (in sample output, block size is 512 bytes). In additon to offset, we also need to specify size limit, this s calculated as sectors of the partition multipled by block size, take the BOOT artition as example, the size limit is 2097152*512=1073741824. Based on the sample output, the following commands are executed to mount the two partitions, take care to replace the offset accordingly:

sudo mount -o loop,offset=4194304,sizelimit=1073741824 openwifi.img sdcard_mnt/BOOT/
sudo mount -o loop,offset=1077936128,sizelimit=6858735616 openwifi.img sdcard_mnt/rootfs
  1. After the above command, your can make changes to the image or copy files from the partitions as a normal SD card. The only difference is that it needs root permision to write files.
  2. Unmount the disk umount sdcard_mnt/BOOT ; umount sdcard_mnt/rootfs

Update driver

If you need to update driver, please follow https://github.com/open-sdr/openwifi#update-driver to compile the driver on your local machine, this requires Xilinx SDK installed. After driver is compiled, first use scp to copy it to the host node, and then from the host node to the SDR. Take care to place the drivers in the directory that contains the wgd.sh script.

Upate FPGA or Linux kernel

If you need a different version of FPGA bitstreaam or Linux kernel, simply download openwifijtagfiles_v2.0.zip, unzip it and replace the files in boards/BOARD_NAME, where BOARD_NAME can be zc706_fmcs2 or zed_fmcs2.

An easy way to get all necessary files is to follow Build image from scratch. If you do not have an SD card, mount the image file from analog devices as explained in Use an Openwifi image without an SD card.

SDR TX time slicing

For SDR TX, there are 4 queues available. Users may reserve some queues to send traffic to certain MAC addresses, and control the time share of those queues to form custom network slicing mechnisms.

By default, if no mac address is set, then all traffic are mapped according to Linux’s queue priority algorithm.
  • In the driver sdr.c file, search DO your idea here, there is a piece of code in openwifi_tx function that defines a linux priority to FPGA queue mapping.
  • If no slice configuration is defined, the default strategy of Linux is applied, you may refer to http://csie.nqu.edu.tw/smallko/ns2_old/crosslayer_video.htm for some more explanation.
  • If any slice’s target MAC address is configured, the default strategy will be over written in the following way: all traffic going to the target MAC address will be going through the queue specified by user; traffic not going to the target MAC address is redirect to queue 2.
  • If needed, feel free to adapt this part to enable more sophisticated traffic sheduling (eg, management frames and data frames separated to different queues).

If a slice’s target MAC address is configured, the percentage of time share when a slice is allowed to send packets to that address is calculated as following:

time_share = (end-start)/slice_total

In this formular, end and start define how long the slice is allowed to send, slice_total is the total cycle time, it controls how long to wait until the slice can send traffic again.

From implementation point of view, each queue has a timer. slice_total is the parameter used to control the upper bound of a queue’s timer, so it counts from 0 to slice_total again and again. When the timer value is between start and end, packets for the target MAC address of that slice are sent.

As an example, commands below will assign slice0 98% of air time for traffic going to 6c:fd:b9:4c:b1:c1, and 2% air time for traffic going to 6c:fd:b9:4c:b1:c2.

# set target slice index
./sdrctl dev sdr0 set slice_idx 0
# set SDR tx slice0 target MAC address (assume it is 6c:fd:b9:4c:b1:c1)
./sdrctl dev sdr0 set addr b94cb1c1
# set SDR tx slice0 cycle length in us
./sdrctl dev sdr0 set slice_total 49999
# set SDR tx slice0 start time in us
./sdrctl dev sdr0 set slice_start 1000
# set SDR tx slice0 end time in us
./sdrctl dev sdr0 set slice_end  49999

# select slice 1 for configuration
./sdrctl dev sdr0 set slice_idx 1
# set slice 1 target MAC address (assume it is 6c:fd:b9:4c:b1:c2)
./sdrctl dev sdr0 set addr b94cb1c2
# set SDR tx slice1 cycle length in us
./sdrctl dev sdr0 set slice_total 49999
# set SDR tx slice1 start and end time
./sdrctl dev sdr0 set slice_start 0
./sdrctl dev sdr0 set slice_end 999

# after all slices are configured, use command below to reset timer of all slices
./sdrctl dev sdr0 set slice_idx 4

The last command synchornizes all timers of all slices, it is important to issue this command each time after new configurations are applied.

The example configuration give the same value to slice_total of slice0 and slice1, and the start and end parameters of the two slices ensures that the time share of the slices are non-overlapping.

Users may define more sophisticated configuration (eg, overlapping the time share of multiple slices entirely or partially, or having invidual slices to have different slice_total, thus different cycle length). If slices do have overlapping time share, then by nature packets in slices with lower index have higher priority (eg, slice0 has higher priority than slice3).

To configure more slices, simply select the slice index using parameter slice_idx and repeat the set commands for MAC address addr, total cycle time slice_total, the start and end time.

To confirm the configurations are successful, just replace “set” to “get” in the example above to get the values.

Connecting multiple Openwifi boards in one jFed experiment

If for some reason you need multiple ZYNQ SDR and their Ethernet ports end up in the same subnet in your jFed experiment, you may need to configure the MAC address of the eth0 port. The reason is that the defautl MAC is set by uboot, which is the same for all boards right now. In order to change the MAC of eth0 of the ZYNQ SDR, please run the following in the serial console:

ifconfig eth0 down
ifconfig eth0 hw ether 00:0a:35:00:01:21
ifconfig eth0 up

Openwifi to Openwifi connection

Openwifi board has no external power amplifier. It is quite easy to establish link between openwifi board and regular nodes with commercial Wi-Fi card in the testbed, however the connection is unstable between two openwifi boards. In order to have a connection, special patch directional antennas are installed between zc706zynqSDR2 and zc706zynqSDR4, please refer to Hardware Info ZYNQ SDR for more details.

Depreciated

WARNING This section will soon be obsolete, it is still useful for people who runs Openwifi image compiled by Vivado 2017.4. The reason is we now download everything from jtag interface, updating BOOT partion is no longer needed.

Boot Linux (Depreciated)

The following steps describe how to run an experiment using the ZYNQ SDR in Linux mode from JTAG. Please download openwifijtagfiles.zip to continue.

  1. Make a reservation of either a zc706zynqSDR or a ZEDzynqSDR, and its corresponding host machine, for details refer to Hardware Info ZYNQ SDR.
  2. Start a jFED experiment with one SDR and its corresponding host, eg apuV4 and zc706zyncSDR2. Do draw a link between the two nodes, assign 192.168.10.1/24 on the host side and 192.168.10.122 on the SDR side. But do not specify any image for the nodes, in this case the default image will be used.
  3. After the experiment is started, reboot the ZYNQ SDR by right click on the node in jFed, select reboot and then select reboot OS.
  4. Log into the host and establish serial connection to the board using minicom. Please refer to Establish serial connection, for the details of minicom port setup. After you opened serial connection, return to this tutorial to continue. Pay special attention that ZEDzynqSDR requires additional steps.
  5. Upload openwifijtagfiles.zip to the host node, unzip it, you will get the directory openwifijtagfiles
  6. In the ssh terminal, cd openwifijtagfiles ; source /share/xilinx/Vivado/2017.4/settings64.sh and then execute xsdb. If you experience runtime error similar to the one listed below, it may be caused by environment varialbe settings, try unset LC_PAPER; unset LC_ADDRESS ; unset LC_MONETARY; unset LC_NUMERIC ; unset LC_TELEPHONE ; unset LC_IDENTIFICATION ; unset LC_MEASUREMENT ; unset LC_TIME; unset LC_NAME ;
Got $RDI_APPROOT: /share/xilinx/Vivado/2017.4
terminate called after throwing an instance of 'std::runtime_error'
what():  locale::facet::_S_create_c_locale name not valid
/share/xilinx/Vivado/2017.4/bin/loader: line 194:  6199 Aborted
  1. In the xsdb console,
    • if you are using ZEDzynqSDR, execute set board zed_fmcs2, if you are using zc706zynqSDR, execute set board zc706_fmcs2
    • After the board variable is set, execute source dow_fsblonly.tcl, after this step, get ready to interrupt uboot auto start in serial console by hitting any key, when you are ready, execute in xsdb console con.
      • If you don’t have u-boot running and see messages such as Unable to open file BOOT.BIN, please refer to the subject Restore rootfs if SD card is corrupted in Advanced Topics.
      • Please note that the first stage boot loader (fsbl) in the zip file is compiled based on openwifi-v1.1.0, if you are using a different openwifi version, you might need to recompile the fsbl, using the build_boot_bin.sh script.
      • Please note that the fsbl will use whatever FPGA bitstream that is available on the SD card, refer to ‘Update Bitstream` if you would like to run a different FPGA bitstream.
      • If you see error such as *no targets found with "name =~"APU*"". available targets:*, please reboot the zc706 board follow Reboot ZYNQ SDR, wait a while and then execute the tcl script again.
  2. When u-boot autoboot is stopped, execute disconnect in xsdb console, and execute run uenvboot in serial console.
  3. Wait and see… after this command normally linux should be booted. Give an IP address of eth0 on the board by executing eg ifconfig eth0 192.168.10.122/24, be consistent with the link setup in your jFed experiment. You may now also log into the board via ssh, as explained in Initial configuration of OpenWiFi.

Update the BOOT partition of the SD card (Depreciated)

If you need to update files on the BOOT partition of the SD card, please follow the steps below

  1. Boot linux on ZYNQ SDR as explained in section Boot Linux (Depreciated), make sure you have network connection to the board, log into the board, and mount the boot partition by mkdir /sdcard ; mount /dev/mmcblk0p1 /sdcard/
  2. Copy files to the BOOT partition using scp, usually only three files matter: BOOT.BIN, devicetree.dtb and uImage: scp /path/to/BOOT/files root@192.168.10.122:/sdcard, here 192.168.10.122 is the ip of the ZYNQ SDR eth0 interface.
  3. You can get those files by mounting an existing Openwifi image(see section Use an Openwifi image without an SD card) and follow the Quick start section of Openwifi github.
  4. After making update to the BOOT partition on the SD card, very important, execute umount /sdcard on ZYNQ SDR
  5. Execute shutdown now on the board and then power cycle the board in jFed follow Reboot ZYNQ SDR.
  6. Boot the board with normal procedure as explained in the Boot Linux (Depreciated) session to use the new configuration.

Update FPGA Bitstream (Depreciated)

If you need to update FPGA bitstream, you will need to copy a new BOOT.BIN file to the SD card’s BOOT partition.

However, there is an extra complexity, in the testbed we use JTAG to boot the BOARD, and we need to generate a modified first stage boot loader to match the BOOT.BIN file. The steps below explains how to do so, and use the new boot loader.

Please download openwifijtagfiles.zip on both your local machine and on the host node of ZYNQ SDR in the testbed to continue.

  1. Generate files on your local machine:
    • Make sure you have the version of Xilinx SDK required by openwifi installed, setup the enviornment by running source /Your/Path/To/SDK/20xx.x/settings64.sh.
    • Get the system.hdf from openwifi-hw repository, nevigate to https://github.com/open-sdr/openwifi-hw/tree/master/boards/, click on the board name (eg, zc706_fmcs2 or zed_fmcs2), and then negivate to sdk/system_top_hw_platform_0 to find system.hdf.
    • Get the u-boot.elf file from the target board directory in https://github.com/open-sdr/openwifi/tree/master/kernel_boot/boards
    • Decompress the openwifijtagfiles.zip, and cd openwifijtagfiles, compile fsbl.elf by executing ./build_boot_bin.sh /path/to/system.hdf /path/to/u-boot.elf, take care to use the correct system.hdf and u-boot.elf for your board. You will find the BOOT.BIN and fsbl.elf in openwifijtagfiles/output_boot_bin directory
  2. Copy fsbl.elf from your local machine to the host node of ZYNQ SDR, scp fsbl.elf apuXX.wilabt.ilabt.imec.be:/PATH/To/openwifijtagfiles/boards/BOARD_NAME, replace the node name, and BOARD_NAME accordingly.
  3. Write the new BOOT.BIN to the BOOT partition of SD card on ZYNQ SDR. This can be done by steps explained in section Update the BOOT partition of the SD card (Depreciated).
  4. Power cycle the ZYNQ SDR board, first execute shutdown now on the board and then power cycle the board in jFed follow Reboot ZYNQ SDR.
  5. Boot the board with normal procedure as explained in the Boot Linux (Depreciated) session to use the new configuration.