USB Ethernet AXI Manager
Access on-board memory locations from MATLAB® or Simulink® using Ethernet over a universal serial bus (USB) interface. To run AXI manager over a USB Ethernet interface, follow these instructions.
Note
AXI manager supports the USB Ethernet interface for the AMD® Zynq® devices only.
Set up hardware board
Copy the compatible secure digital (SD) card image files for the hardware board to an SD card drive path. You can use the Hardware Setup tool or the
copyImageToHostSDCardPath
orloadImageToTargetSDCardPath
function to perform this step.Set the jumpers on the hardware board to configure the USB interface in peripheral mode.
Connect the USB cable between the host computer and the target board.
Set up host computer
Windows® only — Install the USB Ethernet drivers.
Configure the IP address of the USB Ethernet or RNDIS gadget in the host computer after the SD card is booted on the hardware board.
Perform AXI manager read and write operations
Use the
loadBitstream
function to load the BIT and DTB files based on your FPGA design.Create an
aximanager
object. Specify theInterface
property as'USBEthernet'
.Perform write and read operations.
The setup steps are automated in the Hardware Setup tool. See Guided Hardware Setup.
Complete Hardware Checklist
Confirm that you have all required hardware and accessories to complete the hardware setup.
USB 3.0 or USB 2.0 cable — Use a USB 3.0 or USB 2.0 cable based on the type of USB cable your hardware board supports. This connection is necessary for transmitting data, such as a programming file, from the host computer to the hardware board. It is also necessary for sending and receiving signals to and from the hardware board.
Note
If you use a USB 2.0 cable for a board that supports USB 3.0, the cable throughputs lesser data.
SD card reader and writable SD card with a capacity of 4 GB or larger — If the host machine does not have an integrated card reader, use an external USB SD card reader.
Supported hardware — You must have a supported hardware board. For the list of supported boards and interfaces, see Supported FPGA Devices for FPGA Verification. Do not connect or turn on the device until you are prompted at a later step.
Power supply adapter, if the board requires one.
Copy Image to SD Card in Host Computer
Copy the compatible SD card image files for the hardware board to an SD card drive path. This SD card image is included with the support package. The image includes the embedded software and the FPGA programming file necessary for using the hardware board as an I/O peripheral. If you have already copied the SD card with the required image, skip this step.
Insert a 4 GB or larger SD card into the card reader on the host computer. The card must be in FAT32 format.
Note
Unlock the SD card before downloading the firmware image to the card. Keep the card unlocked while the card is in the board card reader.
Use the
copyImageToHostSDCardPath
function to copy the board-specific SD card image files to the specified SD card drive location in the host computer. The SD card image files contain a bootloader and supported operating system information. This function also copies the server daemon for handling the AXI manager host commands on the target hardware board.If you use the Hardware Setup tool to set up your hardware board, this step is automated. See Select a Drive and Load Firmware.
This example copies a default SD card image to the
G:
drive location on the host computer for the ZCU102 board. Specify the IP address of the USB Ethernet gadget on the hardware board in dotted quad format followed byusb0/
. This example sets the IP address of the USB Ethernet gadget on the ZCU102 board to 192.168.3.2.copyImageToHostSDCardPath('ZCU102','G:', ... 'DeviceAddress','usb0/192.168.3.2');
Update SD Card Image in Hardware Board (Optional)
If you have already copied the SD card image files by using the process in Copy Image to SD Card in Host Computer, skip this step.
Use the loadImageToTargetSDCardPath
function to update the SD card image
onto the hardware board. Before proceeding with this step, ensure that the SD card
is inserted in the target hardware board SD card location and that an Ethernet
connection is established between the host computer and the target hardware board.
This function uses the processing system (PS) Ethernet connection to load the SD
card image files.
The loadImageToTargetSDCardPath
function updates the existing
board-specific SD card image files on the hardware board. You might need to wait for
at least 20 seconds for the SD card to update.
This example copies a default SD card image to the target hardware board SD card
location for the ZCU102 board with the default PS Ethernet IP address 192.168.0.2.
Specify the IP address of the USB Ethernet gadget on the hardware board in dotted
quad format followed by usb0/
. This example sets the IP address
of the USB Ethernet gadget on the ZCU102 board to 192.168.3.2.
loadImageToTargetSDCardPath('ZCU102', ... 'DeviceAddress','usb0/192.168.3.2');
This example copies a default SD card image to the target hardware board SD card location for the ZCU102 board with the PS Ethernet IP address 192.168.5.2. The example sets the IP address of the USB Ethernet gadget on the hardware board to 192.168.3.2.
loadImageToTargetSDCardPath('ZCU102', ... 'DeviceAddress',{'192.168.5.2','usb0/192.168.3.2'});
Set Jumper Switches
Set the jumpers on the hardware board to configure the USB cable in peripheral mode. Make sure that the board is turned off. The jumper settings are different for each board. To learn more about the settings, see the board documentation.
For example, set these jumper settings for the ZCU102 board.
Set Jumpers on ZCU102
Set SW6 and other jumpers to the values in this table. The SW6 jumper settings make sure that the board starts up from the SD card.
SW6 Switch | SW6 Switch Position |
---|---|
1 | Up |
2 | Down |
3 | Down |
4 | Down |
Set the J7, J113, J110, and J109 jumpers to the values in this table. These settings set up the hardware board so that it can communicate with the host computer over a USB Ethernet interface.
Jumper | Jumper Position |
---|---|
J7 | Off |
J113 | 1-2 |
J110 | 1-2 |
J109 | No jumper |
To know the jumper settings for the other supported boards, see Set Jumpers.
Install USB Ethernet Drivers
This step is required only for the Windows operating system.
You must install the USB Ethernet drivers before you use AXI manager with a USB Ethernet connection. To install the drivers, in the Hardware Setup tool, on the Install Drivers screen, click Install Driver. The installation process might require system administrator privileges.
Configure USB on Host Computer
You must configure the host computer so that it can communicate with the hardware board. After you boot the SD card on the target hardware board, the board appears as the MathWorks® USB Ethernet or RNDIS gadget on the host computer.
If you use the Hardware Setup tool, select the USB Ethernet or RNDIS gadget that you want to connect to the hardware board. For more information, see Configure USB on Host Computer. If you have already configured the USB Ethernet gadget, skip this step.
Note
The guided setup supports the USB configuration on the Windows operating system only. For the Linux® operating system, you must configure the USB Ethernet gadget manually.
By default, the RNDIS gadget on the host computer fetches the IP address from the dynamic host configuration protocol (DHCP) service running on the hardware board. To manually configure the host computer, follow the steps for your specific operating system.
Configure Windows
Follow these instructions for Windows 7 or later.
From the Start menu, click Control Panel.
Set View by to
Category
.Click Network and Internet.
Click Network and Sharing Center.
On the left pane, click Change adapter settings.
Right-click the USB Ethernet connection that is connected to the hardware board and select Properties.
On the Networking tab of the Properties dialog box, clear all options except Internet Protocol Version 4 (TCP/IPv4). Other services, particularly antivirus software, can cause intermittent connection problems with the hardware board.
Double-click Internet Protocol Version 4 (TCP/IPv4).
On the General tab, select Use the following IP address.
The default IP address of the hardware board is
192.168.1.2
. The host network connection must be on the same subnet as the hardware board. To meet this requirement, make sure to assign a compatible IP address to the host network connection. Set the host network IP address to 192.168.1.x
, wherex
is either 1 or an integer in the range [3, 255].If the first three octets of the IP address field are not 192.168.1, then your hardware board is on another subnet. Enter the same subnet number in the IP address.
Leave the subnet mask set to the default value of
255.255.255.0
.Click OK.
Configure Linux
Set the host USB Ethernet interface to have a static IP address. This configuration enables communication with the hardware board. The default IP address of the hardware board is 192.168.1.2. The host network connection must be on the same subnet as the hardware board. To meet this requirement, you must assign a compatible IP address to the host network connection.
Set the host network IP address to 192.168.1.
x
, wherex
is either 1 or an integer in the range [3, 255]. Set this value by using theifconfig
command. For example, enter this command in the shell.% sudo ifconfig usbZ 192.168.1.4 netmask 255.255.255.0
In this syntax,
usb
is the name of the host USB port (usually usb0, usb1, and so on). To use theZ
sudo
command, you might have to enter a password.Confirm the changes by entering this command in the shell.
% ifconfig usbZ
usb
is the name of the host USB port you set in the previous step.Z
Load Bitstream File to Hardware Board
Use the loadBitstream
function only if you have a new FPGA design to load on
the target hardware board. Otherwise, skip this step.
This function loads the custom FPGA bitstream file and its corresponding device tree blob (DTB) file to the target hardware board. You might need to wait for at least 20 seconds for the target hardware board to reflect your changes.
This example loads a custom FPGA bitstream and its corresponding DTB file to the ZCU102 board with a USB Ethernet IP address that is different from the default value.
loadBitstream('ZCU102','design.bit', ... 'devicetree.dtb', ... 'DeviceAddress','192.168.3.2');
When the program is running on your hardware board, you can communicate with the board.
To access the board from MATLAB, create an aximanager
object and use the readmemory
and writememory
object functions to read and write
memory-mapped locations on the board.
To access the board from Simulink, create a Simulink model and include AXI Manager Write and AXI Manager Read in it. Configure the blocks to read and write memory-mapped locations on the board. For more information, see Use Simulink to Access FPGA Locations.