EPCSGuide

The EPCS series of configuration devices provided by Altera can be used for much more than just configuring the FPGA. Given their relatively high cost, it would only make sense to use these devices to their fullest extent. This guide will address what you can do with remaining space on an on-board EPCS device, with a specific focus on uClinux applications. The three primary applications of interest will be configuring the FPGA, booting application code or a kernel, and finally, creating and mounting read/write filesystems.

  

The Devices

  

The EPCS devices currently come in 4 flavors; EPCS1, EPCS4, EPCS16 and EPCS64. These translate to 1,4,16 and 64 MBit Flash devices respectively. Basically, they are just re-branded SPI Flash devices with minor changes in Silicon ID Codes (to prevent the user from replacing an EPCS device with a cheaper SPI device). Typically, the EPCS16 and 64 devices are needed to do anything useful beyond configuring the FPGA itself.

  

Since they are essentially SPI Flash devices, their physical interface simply consists of the signal set: MISO, MOSI, SSn and CLK. To use these devices, Alteras EPCS Controller must be used; this controller is essentially an SPI Controller, with the first 256 words being ‘boot-rom’. The actual registers themselves, and their functionality, are defined in Alteras SPI Controller Manual. The EPCS controller manual does not address functionality of the registers, as they are ‘protected’.

  

Applications

  

This section will address the various applications of EPCS configuration devices. These applications may be combined in any order (use of all is recommended!). As a note, most of the applications involve use of the NIOS SDK Shell (not the IDE), so now is a good time to become familiar with it if you aren’t already.

  

  

Configuring the FPGA

  

The primary purpose of the EPCS device is to configure the FPGA with SRAM configuration data. This translates to downloading the ‘hardware’ image onto the FPGA on powerup. When the FPGA is powered up, the MSEL pins determine how the FPGA is configured (refer to the appropriate FPGA datasheet for more info). IF the MSEL pins indicate a configuration attempt via an EPCS Device, the EPCS device will load the appropriate hardware image if present. This is the goal of this task; to load the EPCS device with configuration data.

  

Configuration data is specified in the form of an SOF file that is typically downloaded to the FPGA while developing, using the Quartus programmer. Once a design is in a stable state to be loaded upon powerup, the following should be done inside the SDK Shell:

  

· sof2flash --input=<SOF File> --output=<SOF SREC File> --epcs –-verbose –-offset=0x0

This step converts the SOF File to an SREC file which can be programmed to the EPCS Device.

Note: An SREC file is simply a text file that specifies binary data and where it should be loaded. 0x0 is the first address of the EPCS Device.

·Now that an SREC file is generated, it can be downloaded to the EPCS device. In order to do this, you must find the base address of the EPCS Component using SOPC Builder. Then, use the following command to download the SREC file:

nios2-flash-programmer –debug –-base=<base addr in hex> --epcs <srec file>

Note: When this is invoked, it should also tell you where the actual registers for the EPCS component were found. As mentioned before, the base address for the SOPC component IS NOT the base address for the registers, because there are 256 words of boot-rom. The base address for the registers (register base) is where the SPI Controller registers reside. This number should be recorded for later use.

Power cycle your board, and check to see if it was programmed successfully.

  

Booting an application

  

If a NIOS Processor is present in your design, it would be desirable to boot application code upon powerup as well. Altera provides bootloading code that simplify the boot process. The following process can be used to boot simple application code, or boot something as complicated as a uClinux kernel, as will be described shortly.

  

·Whenever an application is built, whether in the NIOS IDE or using the uClinux toolchain, an ELF binary is generated that can be directly downloaded to RAM. This is typically done using:

nios2-download –g <elf file>; nios2-terminal

·This process will convert that ELF file to another SREC file. The difference here is that this SREC file will contain, in the header, boot-copying code to instruct the NIOS processor to copy the contents of the EPCS device to RAM, and then execute. This effectively copies your ELF file from the EPCS device to RAM, and then executes it as if you were downloading directly to RAM. Note: It is important that you specify the reset address of the NIOS Processor, in the SOPC Builder, to be the EPCS Device. Otherwise, your processor will not execute code from the EPCS Chip.

· To convert the ELF File to a downloadable SREC file, with a boot-copier, execute:

elf2flash –-input=<elf executable> --output=<ELF SREC File> --location=<offset into EPCS Device> --epcs –-boot=<path to boot copier>

·If you wish to configure the FPGA as well, insert the line:

-–after <sof SREC file>

Remove the –-location tag

o This positions the ELF SREC file after the configuration data so they can both co-exist on the same device.

o The boot copier for EPCS is typically located in <$SOPC_KIT_NIOS2>/components/altera_nios2/boot_loader_epcs.srec

·Download to the EPCS Device using:

o nios2-flash-programmer -–epcs -–debug -–base=<base addr> <ELF SREC File>

·Power-cycle your board and start the NIOS2 terminal; the application should now boot.

  

Booting uClinux

  

The previous method can be used to boot uClinux as well; the generated kernel is simply an ELF executable that can be downloaded in a similar fashion. It is recommended that a compressed kernel be generated by usingmake zImage. Note the location of the zImage file, and then execute the previous commands using the path to the zImage file as the ELF binary. Power-cycle the board, and it should configure the FPGA as well as boot the compressed kernel automatically!

  

It is highly recommended that an Initramfs filesystem be compiled in with the kernel. Refer to the uClinux guide for this, as it will not be discussed in this document. By using an initramfs filesystem, a kernel along with a root filesystem can be booted directly from the EPCS device (and then RAM), allowing for quicker access times.

  

Tag page
Viewing 1 of 1 comments: view all
Nice story about this.
Great Nice Pictures
causes back pain knee high shoes lizlange maternity fishing boats sale flu incubation period remedies sore throat cost breast implants muscle weight gain surgery breast reduction girls party ideas women laptop bags car brake parts continuing nursing education cost breast augmentation protein whey powder baby slings carriers bed bugs pictures bedding duvet covers phone pay as you go outdoor swing sets discount dinnerware sets coffee espresso machines salton yogurt maker hair color pictures pictures of haircuts asvab practice test herpes photos easy cooking recipes toy dog breeds herpes simplex 1 personalized dog tags stress fracture foot occupational therapy schools frontline plus cats fleas on humans physical therapy salary scabies pictures pictures of shingles what is blood pressure ibuprofen side effects pictures of ringworm gendongan bayi kain cukin ring sling pouch sling perlengkapan bayi selendang bayi nursing cover selendang baby perlengkapan bayi baru lahir bayi bayi lucu foto bayi parish vintage ebooks download tv series download manga free download make money online health information cell phone review disorders anxiety psat practice test blood preasure smart water filter filter pur water weight loss effects blood pressure side effects socks over knee socks dress Hot News Today Jual Beli Make Money Celebrity Gossip Kesehatan Alternatif Gosip Selebritis celebrity photos celebrity news hot celebrities celebrity blog kesehatan info kesehatan kesehatan kerja pelayanan kesehatan indonesia artis foto artis gambar artis selebriti iklan iklan gratis jual online handphone daily news breaking news local news online news food dehydrator tray massage chair ijoy homedics massage shiatsu evening gown dress evening wedding dress dry face skin gold toe sock window coverings blinds blinds for windows lip gloss cosmetics folding table chairs women high heels stockings high heels treatment of pain chlorine generation makeup lighted mirror pain management specialist lawn pest control garden pest control joint pain causes
Posted 16:09, 20 Jul 2010
Viewing 1 of 1 comments: view all
You must login to post a comment.
SourceForge.net