Hello Eric,
Unfortunately still not running. Sorry for the late response, I first needed to finish certain tests up to get a better idea.
Rocketboards.org was one of my first place, I started actually with the instructions for the 10m50 Setup. Now after having read some more Intel documentation, re-reading rocketboards instructions gave me some new inspiration, though. Interesting, thank you! Anyway the 10m50/Cyclone IV FPGA Board differs quite a bit from my DE1SoC/Cyclone V SoC FPGA board. Another issue with rocketboards.org approaches - aside being often a bit outdated - sometimes they seem to explain things based rather on pre-compiled binaries, attached binaries, etc. and thus often still need additional time to "reverse engineer" what the author actually tried at that time and so on. But for sure, there is still a lot of information, so I browsed rocketboards.org. BTW where did alterawiki go? Is there still a backup online?
I understood now, I'm trying the ECPQ256 in-flash boot approach. By the above mentioned article 'NIOS II Processor Booting From Altera Serial Flash (EPCQ)'. I managed to set up a .jic file, which may flash the FPGA and EPCQ flash chip persistently. A Hello Demo (compiled against "Altera HAL" functions, e.g. alt_load) came up on the setup as a verification.
In Quartus I used "Convert Programming Files" and I setup a .jic file
- Device: cyclone V / 5CSEMA
- The .sop: my built sop file, setting properties to "Start" instead of "Block", and having the .sop file "Compressed"
- The .hex: I added the generated epcq.hex, I tried to leave it out and flash it manually with the shell tools later
- This all will be bundled in a .jic file and passed persistently with the Quartus programmer onto the board (FPGA+EPCQ256 chip)
I set up the EPCQ256 Flash (4AS) and could flash it persistently. This also needs "Active Serial" to be enabled under the "Assignments" -> "Devices". After programming the board, and a power off/on or RESET, it comes up with the flashed system (which I identify by some LED settings I added).
One of my biggest issues then was how to flash binaries, respectively the u-boot ELF binary compiled for my NIOS setup? So, there is "nios2-download", there is "quartus_pgm --nios2", there is "nios2-flash-programmer", etc, etc. Same story with conversion from e.g. u-boot in .elf to .hex or to .flash. Which tool should I take? Which format is needed? Anyway am I doing the right thing anyway?
I figured out in Quartus' NIOS 2 Eclipse IDE, under "Tools" (or CTRL+7) there is a "BSP Generator" for selection of the alt_load() functions (boot ROM), and a "Flash Programmer". This tool can be set up, and will show the commands to convert and flash an ELF file. Currently first I run a conversion of the u-boot (I hope its the file with DTB included):
$ elf2flash --input=u-boot --boot=/opt/intelFPGA/18.1std/ip/altera/nios2_ip/altera_nios2/boot_loader_cfi.srec --base=0xca000000 --end=0xcbffffff --reset=0xca080000 --verbose --output=u-boot.flash
Then I flash it via the quartus programmer or the nios2-flash-programmer, e.g.
$ quartus_pgm --nios2 --epcq --csr=0xc8081000 --base=0x0a000000 --mmu --sidp=0x0xcc081060 --debug --go u-boot.flash
As terminal application I still use nios2-terminal.
$ nios2-terminal -v
Flashing my U-boot setup to the EPCQ flash, I got a message about a missing CFI table, but I'm pretty sure about the addresses (memory map inside the "Flash Programmer"). I'll give it a try to setup a "override" file and use that for the programmer. Also with other methods (nios2-download), the nios2-terminal stays mute.
After all that I understood now, using the NIOS2 in "economy" class mode probably seems to play a role in my problem situation. I played a bit with the different NIOS2 cores in Quartus. The NIOS2 (e) does not provide great debugging features. Mainly the NIOS2 (e) does not come with an MMU thus higher virtual addresses (as in the NIOS2) templates used in u-boot) won't work. I feel I'm facing my show-stopper here. Isn't there any free license for, say, an old "classic" NIOS 2 (f) for akademic and/or no profit?