Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20811 Discussions

Booting from On-Chip Memory

Altera_Forum
Honored Contributor II
953 Views

Hello, 

Booting from On-Chip Memory On Stand Alone mode.  

Created a NIOS Processor with Reset Vector Pointing to On-Chip Memory Whose base address is 0x04004000 and end address is 0x040067ff. 

 

On-Chip Mem is initialized with boot_rom.hex 

 

I have a written a Counter LED Code has follows 

 

 

# include <stdio.h> 

# include <unistd.h> 

# include "system.h" 

# include "alt_types.h" 

# include "altera_avalon_pio_regs.h" 

 

int main (void) __attribute__ ((weak, alias ("alt_main"))); 

 

int alt_main(void) 

int data=0; 

while(1) 

//3 bit Counter 

usleep(5000000); //wait for 5 sec 

IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, data++); 

if(data>=8) 

data=0; 

 

When i Run In NIOS II EDS > Run On Hardware it works fine. 

Now problem in Standalone. 

 

I follow 5 steps  

  1. Open NIOS II Console 

  2. Type "
  3. Copy that in my project location 

  4. Open Quartus > Settings>> Compilation Process Settings >> Use Smart Compilation and then Compile. During Compilation it detects the boot_rom.hex and compiles. 

  5. Now when i dump the sof and keep the fpga in standalone mode, NIOS Starts but my counter LED does not execute I Checked whether NIOS Started via NIOS II EDS>> Run Hardware then program runs but automatically it does not start
Can you tell me what is the error here.  

 

I use device Stratix II EP2S180F1020(Altera) and their is a flash M26P64(Nynmonics) which is Serial in Serial Out flash but in standalone this can program the FPGA. Actually my requirement is the SOF should also have .hex file which can program the FPGA on Boot up  

 

Can you tell me where i am going wrong. 

 

Thank you in Advance for your reply. Which is very use ful for me 

 

Thanks & Regards 

Emmanuel
0 Kudos
0 Replies
Reply