Forum Discussion
Problems booting uClinux on Neek
I've been having some trouble getting uClinux running from flash on the NEEK Cyclone III.
What I have been able to do: 1. Build the kernel with JTAG console and Altera's standard example ptf. Run the kernel from ram using nios2-download and nios2-terminal. Get networking up and telnet into it. 2. Build the kernel with JTAG console and "Bypass output when no connection" and networking set up in the rc file. Run the kernel using nios2-download and telnet into it without running nios2-terminal. What I have not been able to do: 3. Run the kernel built without JTAG console support. It seems to hang after downloading and I can't telnet to it. 4. Run the kernel with both JTAG and serial UART console support. As far as I understand this is not a supported configuration, but I haven't been able to... 5. Build the kernel with serial UART console support and without JTAG console support. I get a compile error:In file included from /data/nios/nios2-linux/linux-2.6/arch/nios2/boot/compressed/misc.c:80:
/data/nios/nios2-linux/linux-2.6/arch/nios2/boot/compressed/console.c: In function `console_init':
/data/nios/nios2-linux/linux-2.6/arch/nios2/boot/compressed/console.c:82: error: `na_uart0' undeclared (first use in this function)
/data/nios/nios2-linux/linux-2.6/arch/nios2/boot/compressed/console.c:82: error: (Each undeclared identifier is reported only once
/data/nios/nios2-linux/linux-2.6/arch/nios2/boot/compressed/console.c:82: error: for each function it appears in.)
make: *** Error 1
make: *** Error 2
make: *** Error 2
make: *** Error 2
make: Leaving directory `/data/nios/nios2-linux/linux-2.6'
make: *** Error 1 6. Build the kernel in nios2-ide 7. Run the kernel with JTAG console from CFI flash. First problem I noticed was that the reset address used by all the Altera examples is 0x100000. However, the zImage flash file generated has addresses starting at 0x500000. This seems to be controlled by the "Link address offset for booting." in the kernel config, which as I understand should only be for where the kernel goes in RAM. If I set the link address offset to 0x100000, I can't boot the kernel at all, from RAM or flash. So I had the sof changed to boot from 0x500000, but this did not help. This is what I am doing: in uClinux-dist directory: make menuconfig
make vendor_hwselect images/cycloneIII_embedded_evaluation_kit_standard_sopc.ptf
make where cycloneIII_embedded_evaluation_kit_standard_sopc.ptf is the Altera standard example modified to boot from 0x500000. then, in nios2 shell: nios2-configure-sof images/cycloneIII_embedded_evaluation_kit_standard.sof
cd /opt/altera/nios2eds/components/altera_nios2/boot_loader_sources
nios2-flash-programmer --base=0x4000000
nios2-flash-programmer --base=0x4000000 --erase 0x8000+0x8000 Back in the uClinux-dist direcotry: cd images
sof2flash --activeparallel --offset=0x20000 --input=cycloneIII_embedded_evaluation_kit_standard.sof --output=standard7bf.flash
nios2-flash-programmer --base=0x4000000 standard7bf.flash
elf2flash --base=0x04000000 --end=0x04FFFFFF --reset=0x00500000 --input=zImage --output=zImagebf.flash --boot=/opt/altera/nios2eds/components/altera_nios2/boot_loader_cfi.srec
nios2-flash-programmer --base=0x4000000 zImagebf.flash Using a kernel configuration the same as the one I used for running from RAM, I can't get a nios2-terminal up this way and it doesn't come up on the network. Any help with any of these problems would be greatly appreciated!12 Replies
- Altera_Forum
Honored Contributor
Did you follow the NIOSWiki instructions to install the tool-chain ?
I had no problem to make this run on the NEEK with either of JTAG-UART or serial UART. -Michael - Altera_Forum
Honored Contributor
argh my reply never got posted
<div class='quotetop'>QUOTE (mschnell @ Aug 12 2009, 03:27 AM) <{post_snapback}> (index.php?act=findpost&pid=23487)</div> --- Quote Start --- Did you follow the NIOSWiki instructions to install the tool-chain ?[/b] --- Quote End --- Yes, I followed the instructions here: http://nioswiki.com/installnios2linux (http://nioswiki.com/installnios2linux) I have since updated but haven't rebuilt the toolchain. - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (tehfury87 @ Aug 13 2009, 03:42 PM) <{post_snapback}> (index.php?act=findpost&pid=23502)</div>
--- Quote Start --- argh my reply never got posted <div class='quotetop'>QUOTE (mschnell @ Aug 12 2009, 03:27 AM) <{post_snapback}> (index.php?act=findpost&pid=23487) --- Quote End --- --- Quote Start --- Did you follow the NIOSWiki instructions to install the tool-chain ?[/b] --- Quote End --- Yes, I followed the instructions here: http://nioswiki.com/installnios2linux (http://nioswiki.com/installnios2linux) I have since updated but haven't rebuilt the toolchain. [/b] --- Quote End --- /data/nios/nios2-linux/linux-2.6/arch/nios2/boot/compressed/console.c:82: error: `na_uart0' undeclared (first use in this function) sounds like you need to change the name of your uart in sopc builder to uart0. ive had this problem with ethernet, and pio's - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (Gaz @ Aug 14 2009, 06:36 AM) <{post_snapback}> (index.php?act=findpost&pid=23509)</div>
--- Quote Start --- <div class='quotetop'>QUOTE (tehfury87 @ Aug 13 2009, 03:42 PM) <{post_snapback}> (index.php?act=findpost&pid=23502) --- Quote End --- --- Quote Start --- argh my reply never got posted <div class='quotetop'>QUOTE (mschnell @ Aug 12 2009, 03:27 AM) <{post_snapback}> (index.php?act=findpost&pid=23487) --- Quote End --- --- Quote Start --- Did you follow the NIOSWiki instructions to install the tool-chain ?[/b] --- Quote End --- Yes, I followed the instructions here: http://nioswiki.com/installnios2linux (http://nioswiki.com/installnios2linux) I have since updated but haven't rebuilt the toolchain. [/b] --- Quote End --- /data/nios/nios2-linux/linux-2.6/arch/nios2/boot/compressed/console.c:82: error: `na_uart0' undeclared (first use in this function) sounds like you need to change the name of your uart in sopc builder to uart0. ive had this problem with ethernet, and pio's [/b] --- Quote End --- Sorry to jump in the conversation, but, now that you mentioned it, where can I find the expected names for DE2 components in uCLinux? - Altera_Forum
Honored Contributor
Please check nios2-linux/linux-2.6/arch/nios2/kernel/config.c
- Hippo - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (hippo @ Aug 23 2009, 04:09 AM) <{post_snapback}> (index.php?act=findpost&pid=23550)</div>
--- Quote Start --- Please check nios2-linux/linux-2.6/arch/nios2/kernel/config.c - Hippo[/b] --- Quote End --- Is that to me or to Lima85? What should I be checking for? - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (tehfury87 @ Aug 12 2009, 02:20 AM) <{post_snapback}> (index.php?act=findpost&pid=23486)</div>
--- Quote Start --- I've been having some trouble getting uClinux running from flash on the NEEK Cyclone III.[/b] --- Quote End --- 1. the atlera standard neek design didn't have serial uart. please check another example at, http://www.nioswiki.com/@api/deki/files/11...eek_ocm_spi.zip (http://www.nioswiki.com/@api/deki/files/115/=neek_ocm_spi.zip) 2. I will update the flash example for neek on the wiki. - Hippo - Altera_Forum
Honored Contributor
You gave wrong reset address in elf2flash, which should be nios2 cpu hardware reset address. You should also change the reset vector to offset 0x100000 of cpi flash in sopc. The boot link address in kernel config for neek can be set to 0x01600000, which is about 2/3 of 32MB. From power on reset, fpga gets configured from offset 0x20000 of cfi flash, cpu reset from 0x100000 of cfi flash, boot loader cfi copy zImage to boot link address, zImage uncompress to 0, and kernel start. - Hippoelf2flash --base=0x04000000 --end=0x04FFFFFF --reset=0x04100000 --input=zImage --output=zImagebf.flash --boot=/opt/altera/nios2eds/components/altera_nios2/boot_loader_cfi.srec - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (hippo @ Aug 24 2009, 11:56 PM) <{post_snapback}> (index.php?act=findpost&pid=23571)</div>
--- Quote Start ---
You gave wrong reset address in elf2flash, which should be nios2 cpu hardware reset address. You should also change the reset vector to offset 0x100000 of cpi flash in sopc. The boot link address in kernel config for neek can be set to 0x01600000, which is about 2/3 of 32MB. From power on reset, fpga gets configured from offset 0x20000 of cfi flash, cpu reset from 0x100000 of cfi flash, boot loader cfi copy zImage to boot link address, zImage uncompress to 0, and kernel start. - Hippo[/b] --- Quote End --- So, to clarify, the argument passed to --reset has to be the reset address (0x100000) PLUS the base address (0x4000000) = 0x04100000 as in your listing?elf2flash --base=0x04000000 --end=0x04FFFFFF --reset=0x04100000 --input=zImage --output=zImagebf.flash --boot=/opt/altera/nios2eds/components/altera_nios2/boot_loader_cfi.srec - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (tehfury87 @ Aug 25 2009, 09:54 PM) <{post_snapback}> (index.php?act=findpost&pid=23606)</div>
--- Quote Start --- So, to clarify, the argument passed to --reset has to be the reset address (0x100000) PLUS the base address (0x4000000) = 0x04100000 as in your listing?[/b] --- Quote End --- Right, reset to cfi flash. You should not reset to sdram, which is volatile. - Hippo