Altera_Forum
Honored Contributor
21 years agoMultiple .sof and .flash images in Flash Mem
I have a custom board where we have a flash device connected to a single FPGA and then multiple other FPGAs resident.
The FPGA hooked to flash will boot from flash upon power up. Thus, there is at the base of flash an image that gets copied in with the custom boot loader and executed on the this FPGA as the controller. This controller, after being told what to do, will copy from different locations in flash .sof and .flash files for use on the other FPGAs resident on the board. Creating the flash image for the controller is no big deal. The problem is using the existing Altera tools to create images that reside in different locations of flash WITHOUT a boot loader strapped on. elf2flash doesn't allow me to state the flash address to program the code to bin2flash does but doing an objcopy on the .elf file to make it binary increases the size of the file 16x and then running bin2flash so I can relocate the image increases it another 2.5x (leaving me with a huge flash file to wait for during a download...not likely) running objcopy with the --change-address option works at relocating the image but the elf2flash script wont let me not add in a boot loader (because --reset=0x0 --base=0x0 and the code is supposed to run out of SDRAM as defined in my SOPC Builder...remember this is on a different FPGA from the controller but stored in a single flash device attached only to the controller) nios2-srec2flash doesn't work because it asks me for a nios1 style cpu_sdk directory on the nios1 we got around this by taking the output elf, running srec2flash on it, carving out the boot loader with a perl script and then running nios-run on the resultant file. that was easy because the boot loader code was very easy to parse through after srec2flash was done and srec2flash allowed me to relocate the code. any ideas?