Hi,
Check doc “Developing Nios II software” chapter “Boot Configuration Options” and check that you set correctly (bsp editor):
hal.linker.allow_code_at_reset
hal.linker.enable_alt_load
hal.linker.enable_alt_load_copy_rwdata
hal.linker.enable_alt_load_copy_exceptions
hal.linker.enable_alt_load_copy_rodata
Also check that you write nios code at the right addr. Default bootloader is looking for a .sof at addr_0 and the nios code must be placed just after this 1st sof.
What is exactly your booting process? If you are using "booting from flash and running from onchip memory" I would suggest "Booting and Running From FPGA Memory", at least to test nios booting.
Then you can init you onchip memory with an .hex file containing your Nios code.
With this method you don't have to manage bootloaders or nios download from flash. Each .sof image you have on Flash has it own nios and you just have to select a sof file with remote update ip.
hope it helps.
Regards.
ps: do you use Altera EPCS-L? I don't have any A10 board yet but I think I will try S25FS256S or equivalent for ASx4
script example for hex file:# convert nios from .elf to .hex
echo "***************************************"
echo "* .ELF to .HEX *"
elf2hex --base=0x00 --end=0x3FFFFF --width=32 --little-endian-mem --no-zero-fill --input=project_name.elf --output=onchip.hex --verbose# copy .hex file to fpga folder
echo "***************************************"
echo "* CP *"
cp onchip.hex ../../
cd ../..# update fpga programming files with new nios
echo "***************************************"
echo "* Update output files *"
quartus_cdb BDFTOP -c BDF_TOP --update_mif
quartus_asm --read_settings_files=off --write_settings_files=off BDFTOP -c BDF_TOP
echo "* END *"
echo "***************************************"