Altera_Forum
Honored Contributor
10 years agoNios II EPCS booting problem
Hi,
I am using DE0 nano and trying to boot Nios II from EPCS configuration device. I am following the procedure mentioned on this link (http://www.alterawiki.com/wiki/epcs_bootloaders). The issue I am facing is that When I us Nios EDS to compile My small C test code and use that *.elf file the Nios II won't boot. However if I use Altera Monitor tool to compile the same code the Nios II boots perfectly. The steps I am following are: 1- Add a separate on-chip memory of 1024 bytes (In addition to Main memory used by your application, either On-chip or SRRAM) in QSYS. Call it "boot_rom". 2- Set "Reset Vector" and "Exception Vector" offsets of Nios II to point at boot_rom. 3- Use "asm_bootloader" folder for boot loader code. 4- Edit "my_boot_loader_standalone.S" as follows: a- Set Application code offset in EPCS memory --- ># define SOFTWARE_OFFSET 0x1c0000 b- Set EPCS Controller Base address defined in QSYS ----># define EPCS_FLASH_CONTROLLER_0_BASE 0x10800 5- Compile boot loader in Nios Command Shell by typing ----> make CODE_BASE=0x0 6- Copy "my_boot_loader_standalone.hex" to your project directory (Where *.qpf file exists) 7- Open QSYS and set the path for *.hex memory initialization file created earlier in boot_rom properties. Remove ".hex" from the file path and hit finish. 6- Generate QSYS and Compile the Quartus project to obtain *.sof file. 7- Obtain *.elf by compiling the application source code (Using Nios EDS / Command Shell / Altera Monitor Tool) 8- Edit "Boot_loader_script.s" as follows and copy it to the folder where *.elf file exists. a-Assign "--change-addresses=" to the hex value of SOFTWARE_OFFSET in step-4. b-Properly assign the correct *.elf file path 9- Run "Boot_loader_script.s" in Command Shell to obtain Intel-HEX version of the ELF file. 10- Now open "Convert Programming File" tool in Quartus II and generate *.jic file a- Set the JIC file name b- Select EPCS configuration device c- Select Flash loader ---> Your FPGA part number d- Add SOF file and Force the start address to 0x0 c- Add HEX file with Absolute addressing 11- open Quartus programmer and program the generated JIC file in your board. Power cycle The screen shots of my Nios II BSP editor are attached. Can someone please let me know if I am missing anything ? I have also noticed that the size of *.hex generated from EDS and Altera Monitor tool are very different, and EDS is generating a lot bigger file for the same C-code. Thanks