beautypg.com

Combining factory recovery image files, Combining factory recovery image files –5 – Altera Embedded Systems Development Kit, Cyclone III Edition User Manual

Page 73

background image

11–5

Development Board Version 1.0.

Altera Corporation

Altera Embedded Systems Development Kit, Cyclone III Edition

July 2010

Combining factory recovery image files

project directory. You need to run the following command from the
application selector software project directory to create ext_flash.flash if
it does not already exist:

make flash

--base=0x10000000

Combining
factory recovery
image files

Once you’ve created flash (or srec) files for all the sections of the factory
recovery image, you can combine them all into one file using the cat
command:

cat app_selector_boot_code.srec catalog.flash

appsel_hw.flash ext_flash.flash PFL_option_bits.flash

> temp_restore.flash

PFL:

http://www.altera.com/literature/an/an386.pdf?GSA_pos=2&WT.oss
_r=1&WT.oss=PFL%20option%20bit

However, you are still not done. Some of the individual files we combined
contained non-data records in them. Some non-data records, such as S0
records cannot appear anywhere in an SREC file except for the beginning,
so you want to remove all the non-data records from the final factory
recovery image. Data record types, are S1, S2, and S3, so you want to
remove all the other types of records (S0, S5, S7, S8, and S9).You can use
the command sed to perform this task. Use the following command to
remove all non-data records from the new factory recovery image file:

sed '/^S[05789]/ d' temp_restore.flash >

restore_cycloneIII_3c120.flash

You can now restore the Altera Embedded Systems Development Kit
board to its factory state by running the command

nios2-flash-programmer --base=0x10000000

restore_cycloneIII_3c120.flash