Ok, I have found the solution, so I describe it here. Finally will be a compact description about the how to.
But first about the Altera support. Here is the thread, shame...
Q: Was the same as the post here, how to boot form CFI, etc.
A: The linker sections such as .text, .rodata, .heap and .etc should be mapped to volatile region of system memory, and not to the flash memory.
Q: If the reset vector points to ext_flash, how can be the .text in volatile region?
A: When the reset vector is set to non-volatile memory such as ext_flash, a CFI boot loader provided by Altera will be automatically included. During the conversion of .elf to .flash (elf2flash in flash programming), it will pack the application code in the boot record, and then creates a .flash file containing the boot loader and the boot record. During flash programming, it downloads this boot record to your CFI flash memory (ext_flash). The boot loader is located at Altera installation directory, e.g.
d:\altera\11.0\nios2eds\components\altera_nios2 Therefore, on the next power cycle of the board, the Nios II processor will reset itself from ext_flash and the boot loader executes, reads the boot record and then copies the application code to volatile memory (the memory where you assign to the .text linker section). After copying is complete, the boot loader reads the entry point of the application code from the boot record. The boot loader executes the jump to that address, and the application software begins executing.
(So the guy states that is not possible to run from flash, instead it will run in some RAM)
Q: This is not good for me. I want the application to run in ext_flash. How can I do that?
A: Nope
Q: the suggestion you wrote seems does not work. If I set the .text segment to other than EXT_FLASH I egt an error message in flash programmer: elf2flash: Boot copier overlaps data in flash.
Any clue?
A: There are extra cares need to be taken if you are booting and running from same memory i.e. ext_flash because the application's .text section is not copied. I encourage you to refer to pg. 52 - Booting and Running From Flash Memory for the care and setting that you need.
http://www.altera.com/literature/hb/nios2/edh_ed51002.pdf The error is probably you have other sections that are still assigned to ext_flash. To avoid this error, please assign all the .text to memory other than ext_flash.
And here the matter, the solution comes, in the pdf he suggests. Well here are the steps how to run from CFI, etc.
1. Create your NIOS system, add CFI and EPCS stufds.
do not forget to set the reset vector to the cfi flash. 2. Assemble your hardware in Quartusimodo. Generate the .sof file. Program it,
do not convert to jic, or pof or whatever. 3. Load NIOS EDS (Eclipse), write your software. Generate the system and here:
- set the .text to CFI flash
- set the .rodata (optional) to CFI flash.
- all the others should stay in volatile memory, onchip, sdram, etc.
-
in the pdf file above, on the page# 53, the table 2-2 gives the solution.
4. Invoke the Flash programmer. If you see the USB Blaster (or eq. loader) then OK, if you do not, then go back to Quartusimodo and program again the sof file.
5. Menu, hit "New", choose a the "BSP setting file" and seek for the file <your projectdir\software\blablablabla_bsp>\settings.bsp. If you really installed CFI and EPCS then you will get TWO tabs. One for EPCS one for CFI.
6. Choose EPCS, click add, and search for your sof file (your hardware). Note, if your HW is final, so you modify only the SW from now,
you need to flash the epcs only once. That will be burned forever (up to the next HW design change).
7. Choose the CFI tab, seek for the elf file, typically in <your projectdir\software\blablablabla>\whatever.elf. You do not need to modify anything.
8. If you like, you can set in the Options menu erase before flash, etc.
9. Hit START button, ...and wait for the strike back. :-P
10. Cycle the power and voila: the system will boot.
Note that: IS faster to flash your HW compilation from NIOS EDS than in the Quartusimodo (convert to JIC, etc).
What I hate very much in the Altera's techsup and literature stocking, that if there is any problem:
1. MySupport does not understand the question.
2. If understands, then answers stupidity.
3. If is not able the answer any useful then the client has to hunt for some info on the web. This is a real scatter-gather job, because several informations dealing with the same problem circle are cut into small slices into 12448781214 pdf files. Very hard to find the necessary information, almost impossible.
I am loosing my hair.