在默认的FPGA中如果不配置SPI的线宽,速度等,默认是1线,速度也比较慢,因此我们需要配置一下。
在xdc文件添加代码
#4线spi
set_property CFGBVS VCCO [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
#############SPI Configurate Setting###################
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
set_property CONFIG_MODE SPIx4 [current_design]
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design] #配置spi的电压为3.3v
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]#配置spi为4线的qspi模式
set_property CONFIG_MODE SPIx4 [current_design]#配置spi为4线的qspi模式
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]#配置spi时钟位50M