概述
在nios2-flash-override。txt文件下加入下面表述
[EPCS-EF4016] #W25QJV(Eon-lead-free)
sector_size = 65536;
sector_count = 64;
在altera_avalon_epcs_flash_controller.c文件下加入下面代码
else if((flash->silicon_id & 0xFFFFFF) == 0xEF4016) /* W25Q */
{
flash->dev.region_info[0].region_size = 32 * 1024 * 1024 / 8;
flash->dev.region_info[0].number_of_blocks = 64;
flash->dev.region_info[0].block_size = 65536;
}
就可以用nios进行烧写。
不能直接烧写JIC文件,因为ID不兼容。
器件选择改成auto。
最近剛好在做一片AlteraCyclone II 的FPGA board.
正感到Altera 的Configuration Device 好貴的時候.
無意間在網站上發現其替代方案.
沒想到ST 的M25P10-A, M25P40, M25P16 和 M25P64正好可以替代Altera 的EPCS1, EPCS4, EPCS16 和 EPCS64.
真是不錯, 等我的FPGA 板做好後, 買幾顆ST的Serial Flash 來試試看.
網路上原始資料如下:
http://fpgaforum.blogspot.com/2006/03/any-replacement-for-altera-epcs_19.html
Sunday, March 19, 2006
Any Replacement for Altera EPCS Devices?
I know there are already many websites which claim that Altera SerialConfiguration Devices, a.k.a. EPCS devices, can be replaced by some lower costdevices. This post is just to give you more confidence on the availability ofother cheaper configuration solution for Cyclone series and Stratix II FPGAs.
Altera introduced EPCS devices at the same time the Cyclone device isannounced. Traditionally, the cost of the configuration devices (EPC family)for the Altera FPGAs are quite expensive, compared with the cost of the FPGAs.Most of the FPGA users want almost zero cost for the FPGA configurationsolution since the configuration device is mostly a combination of a simplecontroller and a non-volatile memory that stores the configuration bitstream.Therefore, when the so-called "cheapest FPGA family", Cyclone FPGAwas launched by Altera, Altera also took the initiative to provide a costefficient configuration solution for the Cyclone FPGA. The traditionalconfiguration solution for Altera FPGAs prior to Cyclone FPGA requires a simplecontroller to load the configuration bitstream from a non-volatile memory andwrite to the FPGAs during configuration. This kind of configuration methodolgyis called passive configuration. The passive configuration can be either inserial form or parallel form, depending on the available configuration modes ofthe selected FPGAs. Active Serial configuration was first available in AlteraCyclone FPGA family. During the active serial configuration, the FPGA willwrite out the Read Bytes instruction to the EPCS device and then continuouslyread the data out from the serial flash from the address 0x000000 until theFPGA is configured. The smart approach greatly reduces the configuration costby putting the simple controller in the FPGA itself. That means, theconfiguration cost is only left with the non-volatile memory only. As a result,the SPI serial flash is chosen to store the configuration bitstream as it islow cost, low pin count and easy to control from the FPGA.
Nonetheless, engineers are usually very calculative people. The EPCS pricelist, if you check from the Digikey website, looks attractive at the firstglance due to the sudden price drop on the configuration solution for an AlteraFPGA. As time goes by, engineers realize that the EPCS device is none but avery standard serial flash. And, a standard serial flash should cost much lowerthan an EPCS device with the same memory capacity. I grab some data from theDigikey website. For an example, an EPCS1 device costs USD$3.50 but a ST’sM25P10-A serial flash from ST costs as low as USD$1.10, which is a hugedifference! Imagine if you are just targeting the Altera smallest Cyclonedevice with slowest speed grade, EP1C3T100C8 (costs USD$10.70 quoted byDigikey), you will be paying too much for the configuration solution withEPCS1. Don’t you agree? M25P10 can equally do the job well at lower cost. Whynot? Don’t bother whether they are exactly the same die or not. Both devicescommands and timing specifications meet the active configuration controller(embedded inside Cyclone FPGA) requirement. Even the Quartus II programmer toolrecognizes ST’s M25P10-A, M25P40, M25P16 and M25P64, as EPCS1, EPCS4, EPCS16and EPCS64, accordingly. Perhaps there are still other cheaper alternative thanST’s M25P family.
In fact, the serial flash can do even more other than the configurationsolution. You can use it to store the general-purpose data! You will alwaysfind out that the serial flash always has more than enough to store theconfiguration bitstream, especially if you turn on the configuration bitstreamcompression in the Quartus II software tool. So, don’t waste the rest of thememory in the serial flash, furthermore, they are non-volatile memory, which isoften useful to keep some serial numbers, identification numbers, calibrationdata, tracking numbers, etc. And, themicroprocessor program data! For anexample, you can save the NIOS II ELF file in the serial flash and boot fromthe serial flash after power-up. For that reason, you may need to choose aserial flash with a bigger density, to store not only the configuration data,as well as the microprocessor program data. That way, you don’t need to sourceanother flash device to store the microprocessor data. How big the serialflash required is determined by the code size of your program. Sometimes,instead of using an EPCS4 device just to store the configuration bitstream, Iwill choose an EPCS16 replacement (USD$ 16.25 from Digikey), ST’s M25P16(USD$ 4.56 from Digikey) to be my Cyclone, Cyclone II or Straitx II FPGAconfiguration solution as well as the storage for my NIOS II ELF file, not tomention some general-purpose user data.
//
Disclaimer: The information on this post is for informational purpose only. Theauthor reserves the right not to be responsible for the topicality,correctness, completeness or quality of the information provided. Liability claimsregarding damage caused by the use of any information provided, including anykind of information which is incomplete or incorrect, will therefore berejected.
posted by fpgaforum @ 6:12 AM
当然还有别的方案 比如下文:
Connecting Spansion SPI Serial Flash to Configure Altera FPGAs
Spansion S25FLxxx devices work fine.
Just note that the Flash Programmer utility in the Nios-IDE will bomb out whenyou try to use non Altera devices.
You need to add a file to your Nios installation that provides the FlashProgrammer with the Silicon ID's of the Spansion parts.
file name = nios2-flash-override.txt
location = ../nios2eds/bin
cut and paste the following into a .txt file, and save as above.
[EPCS-202011] # EPCS1N (lead-free)
sector_size = 32768
sector_count = 4
[EPCS-202013] # EPCS4N (lead-free)
sector_size = 65536
sector_count = 8
[EPCS-202015] # EPCS16N (lead-free)
sector_size = 65536
sector_count = 32
[EPCS-202017] # EPCS64N (lead-free)
sector_size = 65536
sector_count = 128
[EPCS-010212] # EPCS4N (Spansion-lead-free)
sector_size = 65536
sector_count = 8
[EPCS-010214] # EPCS16N (Spansion lead-free)
sector_size = 65536
sector_count = 32
[EPCS-010216] # EPCS64N (Spansion-lead-free)
sector_size = 65536
sector_count = 128
The new ST device M25PX32 works fine too (this is a 32 Mbits device with 75 MHzSPI and dual I/O feature which double SPI rate).
Priced by our distributor at 0.8 USD for 1000 pieces.
Dual I/O feature is interesting to speed up code downloading from FLASH to RAMat boot time.
You have to add the following section in your nios2-flash-override.txt file:
[EPCS-207116] # FLASH ST-M25PX32
sector_size = 65536
sector_count = 64
最后
以上就是高兴钻石为你收集整理的flash代替epcs的全部内容,希望文章能够帮你解决flash代替epcs所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复