Hello,
I have a problem with Standalone mode i.e. Booting From On-Chip Memory.
I have created a NIOS II Processor and Reset Vector pointing it to On-Chip Memory which resides from address range (On Chip Memory address base=0x4004000 to End =0x40067ff)
Written some C Code i.e. a LED counter works well when dumped through NIOS II EDS (i.e. Run As Hardware).
Now my Problem is I want to run it in Standalone mode for that I follow 5 Steps
- Open NIOS II EDS Console
- Type "
- Copy that boot_rom.hex file to the project working Directory
- Then In Quartus >Settings>Compilation Process Settings Then Check Use Smart Compilation then give compile
- Then dump in FPGA and keep it in Standalone mode
In standalone mode This RTL is dumped but that led counter code is not executing automatically after boot.
I Check whether RTL is dumped in this manner via NIOS II EDS > Run As Hardware. It works fine.
///Code
///Count LED.c
# 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)
{
//Code is 3 bit counter
usleep(5000000); //wait for 5 sec
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, data++);
if(data>=8)
data=0;
}
}
Can any one help me by telling me what mistake i do. OR can you get me some document which will guide so (an458 is giving me but they give bin2flash example I would prefer elf2hex reason i guess mistake is their)
Thank You in Advance for your reply, of my needful post.
Regards
Emmanuel