Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21602 Discussions

EPCS configuration image update

Altera_Forum
Honored Contributor II
1,287 Views

Hi 

 

 

My problem is to update the configuration image in the EPCS. 

 

I want to send a new configuration image as *.srec (with lenght 16) over ethernet to my Nios II on the FPGA and store it on the ram. From there burn it over the EPCS controller in the EPCS device. 

The whole flow work, but the burned configuration image not work. 

Is it necessary to include the epcs boot loader from altera in the *.srec file? 

 

I generate the *.srec with the following commands: 

 

sof2flash --offset=0x1000000 --epcs --compress --input=$(PROJECT).sof --output=tmp.srec 

nios2-elf-objcopy -I srec -O srec --srec-len 16 tmp.srec $(PROJECT).srec 

 

Is this wrong? 

Or is it important to generate the *.srec from the pof file? 

 

Thanks for your help
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
359 Views

You cannot store the srec contents in the flash. Look at the srec file. It has a format, and it's necessary interpret the file and extract the data from him (http://en.wikipedia.org/wiki/s-record (http://en.wikipedia.org/wiki/s-record)). You have to store the binary data in the flash. 

Other detail. When you use the --epcs, the srec file will be created with address 0x0, to be booted by the epcs, when you turn on the board. You can't use the --offset with --epcs.  

 

2 ways: 1 - The nios interpret the srec file, extract the binary data and store it in the flash. (not good idea) 

2 - (better idea) Change yours commands: 

sof2flash --epcs --compress --input=$(PROJECT).sof --output=tmp.srec  

nios2-elf-objcopy -I srec -O binary tmp.srec $(PROJECT).bin 

 

O binary file doesn't contain address information, only the pure bitstream file, ready to be stored in any address of the epcs flash. The --epcs is necessary because the bytes of the bitstream needs to be inverted, to be correctly loaded by the epcs. Compare 2 srecs files (one with --epcs and other with --address=0x0), and you will note that the bits of the bytes will be swapped. 

 

I hope i have helped. 

 

Sorry for my bad english, i'm a brazillian begginer english student.
0 Kudos
Reply