- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello all,
I want to transform the application code .elf file to .bin,but the IDE seems to only .flash file. how to do this ? are there some tools? thank you!Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
use nio2-elf-objcopy you will probably want something like: nios2-elf-objcopy -O binary input_file.elf output_file.bin Regards, ...DW- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by cybdenw@Apr 6 2005, 02:09 AM hi there,
use nio2-elf-objcopy
you will probably want something like:
nios2-elf-objcopy -o binary input_file.elf output_file.bin
regards,
...dw --- Quote End --- hello cybdenw I used nios2-elf-objcopy -O binary input_file.elf output_file.bin the input file .elf :409KB but the output_file.bin is 9M it seems wrong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i use the following script, it converts first
from .elf -> .flash and then from .flash(srec) -> .bin you have to adjust some settings in the script (addresses) SCRIPT: elf2bin.sh use: elf2bin <ELFFILE> <BINFILE> # ################################################################################ CONVERT NIOS ELF-FILE TO BINARY FILE SRC_FILE=$1 SRC_FILENAME=${SRC_FILE##*/} # returns the file name with the all directories removed: SRC_FILENAME_NOEXT=${SRC_FILENAME%%.*} # returns the path with all extensions removed: SRC_FILEBASE=${SRC_FILE%.*} # remove last extension # echo "SRC_FILENAME :"$SRC_FILENAME# echo "SRC_FILENAME_NOEXT :"$SRC_FILENAME_NOEXT# echo "SRC_FILEBASE :"$SRC_FILEBASE DST_FILE=$2 echo ---------------------------------------------------------------------------- echo "CONVERT ELF FILE : "$SRC_FILE echo "to BINARY FILE : "$DST_FILE # ################################################################################ COPY FILE# cp ../1DVI02_SOFTWARE/$FILE/DEBUG/$FILE.elf $FILE.elf -v # ################################################################################ CONVERT ELF->FLASH FILE # ELF2FLASH .ELF INPUT FILE ELF_FILE=$SRC_FILEBASE.elf # ELF2FLASH .FLASH OUTPUT FILE FLASH_FILE=$SRC_FILENAME_NOEXT.flash BINARY_FILE=$DST_FILE # ##################### SETTINGS FOR ELF2FLASH CONVERTER FLASHBASE=0x00000000 FLASHEND=0x007FFFFF RESETADDRESS=0x00000000 FLASH_ID=U1 # BOOTLOADER BOOTLOADER=boot_loader_cfi.srec echo ---------------------------------------------------------------------------- echo "CONVERT FILE : "$ELF_FILE echo "to : "$FLASH_FILE echo "BOOTLOADER : "$BOOTLOADER echo "FLASH ID : "$FLASH_ID echo "FLASH BASE ADD : "$FLASHBASE echo "FLASH END ADD : "$FLASHEND echo "RESET ADD : "$RESETADDRESS echo ---------------------------------------------------------------------------- elf2flash --input=$ELF_FILE --output=$FLASH_FILE --base=$FLASHBASE --end=$FLASHEND --boot=$BOOTLOADER --reset=$RESETADDRESS --flash=$FLASH_ID --verbose if [ $? != 0 ] then echo "--- !!! ERROR !!! !!! ERROR !!! !!! ERROR !!! !!! ERROR !!! ---" exit -1 fi # ################################################################################ CONVERT FLASH FILE->BINARY FILE echo ---------------------------------------------------------------------------- echo "CONVERT FILE : "$FLASH_FILE echo "to : "$BINARY_FILE nios2-elf-objcopy -I srec -O binary $FLASH_FILE $BINARY_FILE -v rm -v $FLASH_FILE ECHO "PRESS ANY KEY" read- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank u very much,I got it.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page