--- Quote Start ---
From the fpga configuration file (.sof) and the Nios firmware file (.elf) you know exactly the epcs space required.
--- Quote End ---
While this is mostly true, when using the default bootloader it's not exactly the case. While the software data
is stored right after the FPGA configuration bitstream in the EPCS/serial flash device, it is in "boot record" format, not raw binary format.
The tools will generate the "flash/SRecord" data for you using sof2flash, bin2flash, and elf2flash. You can see the size that these SRecords take on flash/epcs by running
nios2-elf-size <your_elf_flash_filename>.flash
Once you have this information, you should be able to determine where best to place your additional data.
Regards,
slacker