The standard way to burn .sof and .elf into flash is using flash programmer, it is easy and reliable. But I need to use my own NIOS code to write these two files into flash, and I see the .flash files in the /flash folder (generated by flash programmer during the programming). I extracted data portion from .flash files and write them into the flash without offset between two files. From flash read and manual comparison, I am pretty sure my own flash writing content matches what flash programmer does, the only problem is that when I power cycle the board, the FPGA didn't boot from flash automatically, my FPGA is cyclone IV, is there any extra step I missed here?
This should be fine from Nios II point of view. We have used Nios II in board update portal applications before, check this link:
You can find the software used to write the flash file to flash memory. However, this design was made for Cyclone V boards using EPCQ. In your case, no big difference between them since both are using EPCS/Q flash families.
I am checking with our configuration team regarding this case, once I get a feedback from them, I will let you know.