Main Content


Program FPGA and set corresponding device tree from processor on SoC board

Since R2022a



    programFPGA(p,bitFile,dtbFile) programs the FPGA on your SoC device with the bitstream specified by bitFile and sets the device tree for the processor specified by dtbFile.


    collapse all

    Create a hardware processor object to connect to a Xilinx® SoC board. You can use the object to program your FPGA on-board the SoC board at the MATLAB® command-line and to create an fpga object that connects to the FPGA through the processor on the SoC board.

    Create a Xilinx processor hardware object and connect to the processor on-board the Xilinx SoC board.​

    p = xilinxsoc('', 'root', 'root');

    Program the FPGA and set the corresponding device tree from processor on the SoC board by using the xilinxsoc object function programFPGA.

    programFPGA(p, "myBitstream.bit", "myDeviceTree.dtb");

    For more information on device trees, see Generate Device Tree for IP Core.

    Connect to the FPGA on-board the SoC board by using the fpga function. Use the processor hardware object p as an input to the fpga function.

    f = fpga(p);

    Input Arguments

    collapse all

    Hardware processor object that represents the connection from MATLAB to the processor on a specific SoC hardware board, specified as a xilinxsoc object or intelsoc object.

    Path to the bitstream file used to program the FPGA. This file must be present on the host computer.​

    Example: "myBitstream.bit"

    Devicetree blob file used to configure the processor. If the file is present on the host computer at the specified path, it is copied from the host computer to the SoC board. If the file is not present on the host computer, it must be present in the SD card folder /mnt on the SoC board.

    The device tree must contain nodes corresponding to resources in the bitstream that need to be accessed from the processor. For more information, see Generate Device Tree for IP Core.

    Example: "myDeviceTree.dtb"

    Version History

    Introduced in R2022a

    See Also