Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12602 Discussions

DE0-Nano-SoC Custom Design Preloader to Use With Alter Monitor Program

Honored Contributor II



I am trying to export HPS I2C controller pins to the GPIO header on the DE0-Nano-Soc board but I am having some trouble with that. 


Things I have done and their results are as follows: 



1. I modified the QSYS file and exported the I2C0 signals to FPGA. Then connected the these I2C signals to the user I/Os. 


2. Compiled the design successfully 


3. Generated and compiled preloader for the new qsys design following the instructions: 



4. I found that the preloader file used by the Monitor Program (IDE) is of 'srec' format while the SoC EDS tool has generated a binary file. So I converted the binary to srec using 'srec_cat' program and gave an offset of '0xffff0000' as I saw in the original srec file. 



5. I replaced the sof, socinfo and srec files used by the monitor program with the newly generated ones. 



6. When I download the program to the board the sof file is successfully downloaded but the hps is not configured correctly and error is returned as: 



">>Downloading preloader......>>Setting vector base address register to: 0xffff0000 

Timed out while waiting for preloader to finish 

Preloader failed to run. HPS components may not have been configured. 

Possible causes for the failure: 

1. Linux SD card is inserted and Linux is running. 

2. FPGA-side components are accessing HPS memory." 


(SD card is plugged out so definitely no Linux is running) 




7. If I use the old preloader file (one that came pre-compiled with the altera monitor program) with the new sof file then I don't get this error but the user I/o pins are at floating voltage level around 2v. 



8. I notice one difference in the terminal when I run original preloader and new preloader as: 



original preloader: 

>>CPU0 halted at 0x2fa4. 

>>Resetting HPS. 

>>Downloading preloader..... 

>>Program loaded. PC set to program entry (0xFFFF0000) 

>>Setting vector base address register to: 0xffff0000 

>>Running preloader.. 




new preloader: 

>>CPU0 halted at 0x2fa8. 

>>Resetting HPS. 

>>Downloading preloader......>>Setting vector base address register to: 0xffff0000 

Timed out while waiting for preloader to finish 



I have added the colors here to the text to make the red line prominent which is 'Program loaded' that is only seen with the old preloader but not with the new preloader. 



9. I opened up both the preloader files in text editor and saw the difference that beginning line for old preloader is 'S315' while for the new preloader is 'S325'. I am attaching both the preloader files to this email. 


Can anyone share how to make a preloader to run with altera monitor program? 


Thank you. 


Best regards, 

Shaji Baig 


0 Kudos
0 Replies