作者:ShownSun
工作室:時沿科技
文章目錄
- FPGA燒寫SPI FLASH
-
- 方法一
- 方法二
- SPI flash的限制
- BPI FLASH的限制
FPGA燒寫SPI FLASH
方法一
1.點選setting,選擇bitstream部分,将bin_file打鈎,點選OK
2.點選generate bitstream,生成bit檔案與bin檔案
3.點選open hardware manager,連接配接闆子
4.選中xc7k325t,右擊選擇add configuration memory device
5.選擇開發闆上的flash晶片,點選ok
6.添加bin檔案,點選ok即可燒錄代碼到flash
方法二
1.在synthesis之後添加必要的的flash限制指令,依次執行implentation與generate bitstream,生成bit檔案
2.通過Tcl Console進入bit所在的目錄(在runs裡面的impl中),輸入cd + 目錄位置
3.輸入指令:
write_cfgmem -format mcs -interface spix4 -size 128 -loadbit "up 0 E:/x.bit" -file x.mcs
write_cfgmem -size 16 -interface spix1 -format mcs -force -loadbit "up 0 ./top.bit" top.mcs
write_cfgmem -size 128 -interface spix4 -format mcs -force -loadbit "up 0 ./system_top.bit" system_top.mcs
4.選中xc7k325t,右擊選擇add configuration memory device
5.選擇開發闆上的flash晶片,點選ok
6.添加mcs與prm檔案,點選ok即可燒錄代碼到flash
SPI flash的限制
以下為針對博蘭銳思主機闆M7的N25Q128A13BSF40E SPI flash進行的限制
set_property CFGBVS VCCO [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property BITSTREAM.GENERAL.COMPRESS true [current_design]
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
set_property BITSTREAM.CONFIG.SPI_FALL_EDGE Yes [current_design]
注意:
CFGBVS為VCCO 或者GND
CONFIG_VOLTAGE為 1.8/2.4/2.5/3.3
BPI FLASH的限制
以下為針對VC707的 PC28F00AG18FE BPI flash進行的限制
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]
set_property BITSTREAM.CONFIG.BPI_SYNC_MODE Type1 [current_design]
set_property BITSTREAM.CONFIG.EXTMASTERCCLK_EN div-1 [current_design]
set_property BITSTREAM.GENERAL.COMPRESS TRUE [current_design]
set_property BITSTREAM.CONFIG.UNUSEDPIN Pullup [current_design]
set_property CONFIG_MODE BPI16 [current_design]
set_property CFGBVS GND [current_design]
set_property CONFIG_VOLTAGE 1.8 [current_design]