Forum Discussion

VinayGB's avatar
VinayGB
Icon for New Contributor rankNew Contributor
5 years ago
Solved

.elf.srec not found

Quartus 20.1; Cyclone A7 device I have created a hello world project from template and BSP project using .sopc file. After creation, project there was a problem with build nios2-elf-g++.exe: er...
  • MViss4's avatar
    MViss4
    5 years ago

    I came across the same problem in Quartus Prime Pro 19.4, while colleagues not. The difference for me
    might be I installed WSL2 but have set WSL 1 active.
    Workaround: as described added in my Makefile:

    # 1. During debug
    # -"wslpath: /mnt/d/Project/project.elf.srec: No such file or directory"
    # -"rm: cannot remove '/mnt/d/Project/project.elf.srec': No such file or directory"
    # -"Reading symbols from D:\Project\project.elf...(no debugging symbols found)...done."
    # 2. During build after debug was failed
    # -"nios2-elf-objdump.exe --disassemble --syms --all-header --source project.elf >project.objdump"
    # -"nios2-elf-objdump.exe: can't disassemble for architecture UNKNOWN!"
    #
    # When startin a debug session the project.elf.srec is generated this failes, and as a result the content of project.elf is overwritten with the content of this srec file
    # Causing the 'no debugging symbols found'/'can't disassemble for architecture UNKNOWN!' (hence the file is essientially a srec file with an .elf extension)
    # by manually making an project.elf.srec file this can be overcomed
    BUILD_PRE_PROCESS := touch $(ELF).srec