VEEK-MT2 User Manual
51
www.terasic.com
July 4, 2016
Copy both the .SOF and .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 commands
Convert .sof file into .flash file
sof2flash --input=”your example.sof” --output= “your example
_HW
.flash” –epcs --verbose
Convert .elf file into .flash file
elf2flash --base=0x08800000 --end=0x08ffffff --reset=0x08800000 --input=” your example.elf”
--output=” your example SW.flash” --boot=boot_loader_cfi.srec
Convert .flash file into .binary file
nios2-elf-objcopy –I srec –O binary “your example
_HW
.flash” “your example
_HW
.bin”
From the command shell navigate to where your ELF file is located and create your software binary
file using the following command
nios2-elf-objcopy –O binary “your example.elf” “your example
_SW
.bin ”
Create a new subdirectory and name it what you would like the title of your application to be shown
as in the application selector
Using an SD card reader, copy the directory onto an SD Card into a directory named
“Application_Selector”. The directory structure on the SD Card should look like this:
Application_Selector\<Name of Application>\{<elf_name>_SW.bin;<sof_name>_HW.bin}
Place the SD card in the VEEK-MT2, and switch on the power. The Application Selector will start
up, and you will now see your application appear as one of the selections
Note:
(1).
You may not need a CFI Flash controller when your design does not contain a Nios II processor or
you store your software code within the on-chip memory and use the .hex initialization file.
(2).
If you would like to use other memories such as SRAM or SDRAM as the program memory, you
may need to perform two steps to convert your .elf file into .bin file to make the software properly
run on VEEK-MT2. The commands seem to look like this:
elf2flash --base=flash_base_address --end=flash_end_address --reset=flash_base_address
--input="<your software name>.elf" --output="<your software name>.flash"
--boot="$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_cfi.srec"
nios2-elf-objcopy –I srec –O binary <your software name>.flash <your software name>_SW.bin
(3).
You may pad a --compress option for saving binary image space because the Cyclone IV E series
support the decompress feature while loading hardware image from EPCS device.
(4).
The command will use the default HAL boot loader and link it to the .text section.
(5).
You can also use the tool „bin_demo_batch‟ to convert your sof and elf to bin. Copy ”your
example.sof” and “your example.elf” to the bin_demo_batch folder, rename them to test.sof, test.elf,
execute the test.bat, then the final test_HW.bin and test_SW.bin are your target files.
Содержание VEEK-MT2
Страница 1: ...1 ...