Forum Discussion

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

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