Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

.sof to .dat & .elf to .dat

Altera_Forum
Honored Contributor II
1,346 Views

Hi all, 

How can i convert a . sof file into a comma-separated list of numbers suitable for inclusion in a C source file, like pof2dat.pl perl utility do with .pof file? and the same thing for .elf file? 

thank u
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
432 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
432 Views

Thank u very much! 

I've downloaded the file and i'm trying. 

bye
0 Kudos
Reply