It's 2022, and the problem persists (Quartus 21.1.1) - I just ran into it as well and spent some time root causing it.
Short story: Make sure you include a "System ID Peripheral" (SIDP) in your Nios2 platform design!
Long story:
- Assuming you have a Qsys (Platform Designer) already that shows this problem.
- Open "Nios2 Software Build Tools for Eclipse" from Quartus -> Tools, aka. eclipse-nios2 from the command line.
- Create a new run configuration (Run -> Run Configurations -> Nios2 Hardware) and configure its "Target Connection -> Refresh Connections" to make sure it detects your attached development board.
- Hit "System ID Properties"
- If you do have a SIDP in your design:
- Expected system ID base address: 0x1234 (whatever address you gave it in your design)
- If you don't have a SIDP in your design:
- Expected system ID base address: Not Found - does that start to ring a bell?
- Close that "System ID Properties" window
- If you hit "Run" now, the following happens under the covers (this is on a LInux system, but I'm fairly certain the same applies to Windows since it's driven by application logic in the eclipse-nios2 Java app):
- If you do have a SIDP in your design:
- eclipse-nios2 calls nios2-download
- /bin/bash /home/quartus/../nios2eds/bin/nios2-download --cable=USB-Blaster on localhost [1-2] --device=1 --instance=0 --go --sidp=0x1234 --id=0xabc --timestamp=1234567890 /home/work/NIOS/software/NIOS_test/NIOS_test.elf
- nios2-download calls nios2-elf-objcopy
- /bin/bash /home/quartus/../nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/bin/nios2-elf-objcopy /home/work/NIOS/software/NIOS_test/NIOS_test.elf -O srec /home/work/NIOS/software/NIOS_test/NIOS_test.elf.srec
- So far so good, that works as expected and the software download succeeds.
- If you don't have a SIDP in your design:
- Note that you'll probably have to check "Target Connection -> System ID Checks -> Ignore mismatched system ID" and "... -> Ignore mismatched system timestamp" in order to "Run" the configuration at all.
- eclipse-nios2 calls nios2-download
- /bin/bash /home/quartus/../nios2eds/bin/nios2-download --cable=USB-Blaster on localhost [1-2] --device=1 --instance=0 --stop --accept-bad-sysid --sidp=Not Found
- That is a bogus command line. The SIDP is set to "Not" and "Found" is taken as an .elf file that has to be sent to the board.
- nios2-download calls nios2-elf-objcopy
- /bin/bash /home/quartus/../nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/bin/nios2-elf-objcopy ./Found -O srec ./Found.srec
- nios2-elf-objcopy obviously can't find the "Found" file, prints the error message we've all seen flash by
nios2-elf-objcopy: './Found': No such file
./Found.srec: Unable to open input file
rm: cannot remove './Found.srec': No such file or directory
and exits with an error exit code.
Considering the age of this thread, that bug has been around for at least 11 years now, still unfixed!