Forum Discussion
Altera_Forum
Honored Contributor
17 years agoYou 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.