40
5
5
.
.
4
4
R
R
e
e
s
s
t
t
o
o
r
r
i
i
n
n
g
g
t
t
h
h
e
e
F
F
a
a
c
c
t
t
o
o
r
r
y
y
I
I
m
m
a
a
g
g
e
e
This section describes some details about the operation of restoring the Application Selector factory
image.
Combining factory recovery binary files
In the factory settings, you need to program Application Selector binary files to EPCS. Before
programming, you should combine application selector software binary file and hardware binary
file together by executing the instructions below:
Copy both the tPad_Selector.sof and tPad_Selector.elf files into a common directory relying on
your choice. This directory is where you will convert the files
On your host PC, launch a Nios II Command Shell from
Start
->
Programs
->
Altera
->
Nios
II <version #> EDS
->
Nios II Command Shell
From the command shell navigate to where your SOF file is located and create your hardware
binary file using the following command commands listed below
Convert tPad_Selector.sof file into tPad_Selector
_HW
.flash file
sof2flash --epcs –input=tPad_Selector.sof --output= tPad_Selector_HW.flash
Convert .flash file into .bin file
nios2-elf-objcopy –I srec –O binary tPad_Selector
_HW
.flash tPad_Selector
_HW
.bin
From the command shell navigate to where your ELF file is located and create your software
bin image using the following command commands listed below
Convert tPad_Selector.elf into tPad_Selector
_SW
.flash
elf2flash –epcs --after=tPad_Selector_HW.flash --input=tPad_Selector.elf
--output=tPad_Selector
_SW
.flash
Convert tPad_Selector
_SW
.flash into tPad_Selector
_SW
.bin
nios2-elf-objcopy –I srec –O binary tPad_Selector
_SW
.flash tPad_Selector_SW.bin
Combine tPad_Selector
_HW
.bin and tPad_Selector_SW.bin using the following command
cat tPad_Selector
_HW
.bin tPad_Selector
_SW
.bin > tPad_Selector.bin
The generated tPad_Selector.bin is our target binary file