google for BIN2C.ZIP, you should find it at
http://www.programmersheaven.com/zone3/cat...t1359/17063.htm (
http://www.programmersheaven.com/zone3/cat1359/17063.htm)
a small tool to generate a c-array from a binary file.
for .sof --> .rbf (binary) use I use Quartus->file->convert programming file
for .elf --> .bin I use 2 steps
first step
elf2flash --input=$ELF_FILE --output=$FLASH_FILE --base=$FLASHBASE --end=$FLASHEND --boot=$BOOTLOADER --reset=$RESETADDRESS --flash=$FLASH_ID --verbose
second step
nios2-elf-objcopy -I srec -O binary $FLASH_FILE $BINARY_FILE -v