Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi LiangYi,
> When programming epcs device as above, is --relocate parameter only used in the last > one nios2-flash-programmer command? The documentation for the --relocate option is vague. The user guide does not even mention it, and the --help option only states:<div class='quotetop'>QUOTE </div> --- Quote Start --- The --relocate option is used with EPCS serial configuration devices. If data has already been programmed into the EPCS device, it will be relocated at a higher address to make room for the new data being programmed.[/b] --- Quote End --- However, my observations and some script hacking indicate that only non-configuration data is actually relocated. Since the application (u-boot) data is programmed immediately after the configuration data, it needs to be relocated when you write new FPGA configuration data (sof) to the the epcs device (to account for changes in the size of the sof data). Basically, I use the --relocate parameter only when programming a new sof to the epcs -- and I have never had a problem -- the existing u-boot data in the epcs is always where it needs to be :-) > Why the text says > QUOTE > "The register base is currently at offset 0x600 from the memory base." An "epcs controller" is simply ASMI + on chip memory + boot code. The on chip memory that contains the boot code comes first (lower addresses) and the ASMI registers follow. The last I checked, the size of the epcs on chip memory is 512 bytes (0x200) ... so the offset of the ASMI registers should be 0x200. Perhaps this bug just got lucky with some address bus aliasing ;-) > I try to set offset=0x110,# define CFG_NIOS_EPCSBASE 0x00400110(my epcs base=0x00400000). If you're using Nios II 5.0, don't do that. An offset of 0x200 should be correct -- try it ;-) > When run ==>epcs info, it display > QUOTE > ==> epcs info > epcs: device not found. Correct -- it did not find the device because the offset is not correct. > I retry offset=0x200, it runs OK. Yep ... as above. > I change as you say, but have no effect on u-boot boot-up message. Until you can successfully write your environment to flash you will get the warning message. Also, I tried the cfi_flash.c that I sent you on two different boards (EP1C20 and PCI-5441) and it works ok for me. However, both boards use 8-bit devices and do not implement data cache. If you have a data cache, I don't think cfi_flash.c will work -- it's currently not coded to use the ld/st io instructions. Regards, --Scott