Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Problem rebooting Nios II from uClinux

Dear all,

I need to reset Nios II from uClinux. I tried to use "reboot" app from sash but it didn't work. The response is

Restarting system

and then system freezes. I'm working on a Stratix II EP2S60. I tried to reset using "CPU RESET" button, but with the same result. I tested the button on a simple program without OS and it works, so it's a uClinux problem.

I hope you can help me, thanks in advance

Marco

14 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok guys, thanks for your replies, I agree with you. Now I'm focusing on how to run uClinux from flash. I followed the wiki's article "Flash Programmer", but it doesn't work. I was able to store .sof in flash and it works. The problem is when i try to store zImage.

    Step followed:

    1. nios2-configure-sof <file>.sof

    2. sof2flash --offset=0xC00000 --input=<file>.sof --output=<file>.flash

    3. nios2-flash-programmer --base=0x02000000 <file>.flash

    4. elf2flash --base=0x02000000 --end=0x02ffffff --reset=0x02000000 --input=zImage --output=ext_flash.flash --boot =SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_cfi.srec

    5. nios2-flash-programmer --base=0x02000000 ext_flash.flash

    My Flash base address is 0x02000000 and its size is 16 MBytes. In vendor_hwselect i selected sdram in "Please select device to execute kernel from", the Reset Vector is located in ext_flash at the base address (0x02000000), exception vector in sdram (0x00000020).

    The problem is that kernel doesn't start. If i press CPU reset botton i can see the LEDs on the LAN turn off and on again after a certain period, so it seems to be right because i set up LAN in rc file, but i can't ping the board and i cannot see anything on hyperterminal.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Finally it works. I made some mistakes, but the most important was in "Link Address offset for booting", i had to change it to a bigger value. Thanks a lot for your support.

    Marco
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok fine.

    But the steps 1-5 you described above were right?

    Because I couldn't see any mistake in the commands.

    Urmel
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes they were right, but initially I had the wrong address reset (0x00000000 instead of 0x02000000, i've edit a previous post).