Forum Discussion
Altera_Forum
Honored Contributor
21 years agoThe problem concerning uClinux uploading to UP3
Hello everyone!I need your help now...
The problem is concerning uClinux uploading to UP3 board. Here is my developing enviornment: target board: UP3 Education Kit Cyclone EP1C6Q240 TC58FVT160 Flash Memory 2MB(1M*16b) 1S42S16400B SDRAM 8MB 128KB(64K*16b) SRAM Software: Quartus 4.2 + NIOS IDE1.0 Nios2linux1_3 Since there is no ptf file from linux_example support for UP3,i have no idea. I try to use NiosII_lab_up3 ptf. According to the Linux Quick Start Guide,creat Linux Kernel Project,Configure Kernel,then Build Project,waiting... the final error are as follows: --- 2.6.x/drivers/char/altera_pio_button.c:112: error: `na_button_pio_irq' undeclared (first use in this function) /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/altera_pio_button.c:112: error: (Each undeclared identifier is reported only once /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/altera_pio_button.c:112: error: for each function it appears in.) /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/altera_pio_button.c: In function `button_release': /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drmake: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x' ivers/char/altera_pio_button.c:156: error: `na_button_pio_irq' undeclared (first use in this function) make[3]: *** [drivers/char/altera_pio_button.o] Error 1 make[2]: *** [drivers/char] Error 2 make[1]: *** [drivers] Error 2 make: *** [_all] Error 2 ----- And what's the matter,need to modify the UP3 ptf file? and how to?I'm a newer in this developing what i should complete,is Web Server using in Industry data gathering,based on Nios-uClinux board system.(UP3) Thank you for everyone here, it's my first title here,and english is not good. Maybe should description more details.http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif11 Replies
- Altera_Forum
Honored Contributor
Hi, sounds like a cool little project. Though I have to warn you that the board may not have enough flash or sdram to comfortably run Linux.
The current distribution uses the first 2 MB of flash to hold the kernel and any remaining flash to hold a read-only filesystem. With only 2 MB of space, I'd recommend browsing around the forum to learn how to use u-boot and a compressed kernel. You should be able to fit u-boot and the kernel into the first meg of flash. The next step would be to ensure that you're flash is supported in the kernel and to set up a flash partition map so that you can mount the last MB of flash as a filesystem. With only 1 MB to work with, it would be best to use cramfs I think... again, people on this forum have successfully used cramfs in the past, so searching around should give you some answers. As for the error that you're getting during the build process, configure your kernel to turn off Altera PIO Button support... you can find it at: Device Drivers --> Character Devices ----> Nios PIO buttons support Once you turn it off, try re-building again, it should help. - Altera_Forum
Honored Contributor
Hi:
Thank you very much! This UP3 board is supply by Altera,using for the university NIOS competition.So we have no chose,also should build a web server on this board,based on uClinux operating system. According your suggestion,turn 'Nios PIO buttons support' off,build again,the former error disppear,but another error appears: -------------------------------------------------------- make: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2li nux.kernel_0.1.5/linux-2.6.x' ive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.ker nel_0.1.5/linux-2.6.x/drivers/net/smc91111.c:2062: warning: `MOD_DEC_USE_COUNT' is deprecated (declared at /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2lin ux.kernel_0.1.5/linux-2.6.x/include/linux/module.h:567) /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2lin ux.kernel_0.1.5/linux-2.6.x/drivers/net/smc91111.c: In function `init_module': /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2lin ux.kernel_0.1.5/linux-2.6.x/drivers/net/smc91111.c:2173: warning: assignment from incompatible pointer type make[3]: *** [drivers/net/smc91111.o] Error 1 make[2]: *** [drivers/net] Error 2 make[1]: *** [drivers] Error 2 make: *** [_all] Error 2 --------------------------------------------------------- Then i think it's the smc9111's problem, so i turn it off other errors appear: arch/nios2nommu/lib/.checksum.o.d: done. CC arch/nios2nommu/lib/string.o arch/nios2nommu/lib/.string.o.d: done. AR arch/nios2nommu/lib/lib.a GEN .version CHK include/linux/compile.h UPD include/linux/compile.h CC init/version.o init/.version.o.d: done. LD init/built-in.o LD .tmp_vmlinux1 nios2-elf-ld: region ram is full (.tmp_vmlinux1 section .text) nios2-elf-ld: region ram is full (.tmp_vmlinux1 section .bss) nios2-elf-ld: section .data [00020000 -> 0002dfff] overlaps section .text [00020000 -> 0017b43b] nios2-elf-ld: section .init [0002e000 -> 0003a51f] overlaps section .text [00020000 -> 0017b43b] nios2-elf-ld: section .bss [0003a520 -> 0004afc7] overlaps section .text [00020000 -> 0017b43b] nios2-elf-ld: section .sbss [00020000 -> 0002003c] overlaps section .text [00020000 -> 0017b43b] make[1]: *** [.tmp_vmlinux1] Error 1 make: *** [_all] Error 2 make: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2li nux.kernel_0.1.5/linux-2.6.x' ------------------------------------- I don't know how to deal with this problem. Another questions: As some other embedded developing board as ARM-9,it has some crossing complie tools(arm-gcc), using in developing application through linux. So what about NIOS-board, does NIOS has the likely gcc developing eviornment(NIOS-gcc) When i develop the U-boot, do i need to using the nios-gcc, and how,using in linux system....? Thank you again!:) Best Regards! - Altera_Forum
Honored Contributor
Hi Justin,
> When i develop the U-boot, do i need to using the nios-gcc, and how,using in linux system....? Yes, you should use nios2-elf-xxx. When building u-boot for Nios-II, nios2-elf is the default cross compile prefix. Regards, --Scott - Altera_Forum
Honored Contributor
Hi:
This days I browse around the forum,and try to find how to use u-boot. But where can I download the u-boot and the nios2-elf-gcc tool. Thank you! Regards, -Justin - Altera_Forum
Honored Contributor
Hi Justin,
> where can I download the u-boot and the nios2-elf-gcc tool. You can get u-boot from two places. The official sources can be found at: http://www.sourceforge.net/projects/u-boot (http://www.sourceforge.net/projects/u-boot) The source tree at sourceforge contains the sources for all supported architectures and boards. You can also get the u-boot sources from: http://www.psyent.com/download (http://www.psyent.com/download) The sources at psyent contain only the files necessary to support Nios-II, and a few of the files have minor changes to support an error/warning free build using the standard Nios-II tools under cygwin. The psyent site from time-to-time also has certain updates applied before they are incorporated into the source tree a sourceforge (u-boot patches can take as long as 3 months to be added to the sourceforge tree). As for the nios2-elf-xxx tools ... they're part of the Nios-II development kit. I believe you can download the tools from the Altera website ... but I'm not sure ... never needed to do this. Regards, --Scott - Altera_Forum
Honored Contributor
Hi again:)
Thank you for your given links, i have down the software as follows: 1:uClinux-dist-20041215.tar 2:nios-gcc.tar 3:u-boot-1.1.2.tar And today i try to compile the uClinux kernel for NIOS,follow the point steps: $ make xconfig $ make dep $ make but when the final step 'make',following info appears: ----------------------------------------------------------------- /home/JustinYan/uClinux-dist/linux-2.4.x/include/linux/coda.h:116: redefinition of `struct timespec' {standard input}: Assembler messages: {standard input}:824: Error: Unknown pseudo-op: `.subsection' {standard input}:832: Error: Unknown pseudo-op: `.previous' {standard input}:1000: Error: Unknown pseudo-op: `.subsection' {standard input}:1008: Error: Unknown pseudo-op: `.previous' make: *** [init/main.o] Error 1 ----------------------------------------------------------------- I have no idea about it.why? The another problem i meet,is about the rpm command. I have download 'cdk-nios-example-u-boot-20040316cvs-20040317.src.rpm' for the U-boot. when: --------------------------------------------------------------------- JustinYan@JUSTINYAN ~/setup/cdk-nios-example-u-boot $ rpm -ivh cdk-nios-example-u-boot-20040316cvs-20040317.src.rpm cdk-nios-example-u-boot # ################################################# JustinYan@JUSTINYAN ~/setup/cdk-nios-example-u-boot $ rpm -qi cdk-nios-example-u-boot-20040316cvs-20040317.src.rpm package cdk-nios-example-u-boot-20040316cvs-20040317.src.rpm is not installed ---------------------------------------------------------------------------------------------------- why this package is not installed, the rpm command using is correct,i think. I'm a beginner , so forgive me for asking this simple questions. Thank you again!:) Best Regards! Justin - Altera_Forum
Honored Contributor
Hi~Anybody here?
The first problem above has been solved today. I have convert the kernel into a raw binary image--linux.bin(2.4MB), and compress the binary image to linux.bin.gz(1.1MB) Then package linux.bin.gz for U-Boot, but when i build the U-Boot in this final step:
This time, I really don't know how to fix this error. Can anyone tell me how to solve this problem? Thank you very much!!! Best regards! Justin# make make: Entering directory `/usr/Setup_Nios/u-boot-1.1.2/tools' make: `.depend' is up to date. make: Leaving directory `/usr/Setup_Nios/u-boot-1.1.2/tools' make: Entering directory `/usr/Setup_Nios/u-boot-1.1.2/examples' make: `.depend' is up to date. make: Leaving directory `/usr/Setup_Nios/u-boot-1.1.2/examples' make: Entering directory `/usr/Setup_Nios/u-boot-1.1.2/post' make: `.depend' is up to date. make: Leaving directory `/usr/Setup_Nios/u-boot-1.1.2/post' make: Entering directory `/usr/Setup_Nios/u-boot-1.1.2/post/cpu' make: `.depend' is up to date. make: Leaving directory `/usr/Setup_Nios/u-boot-1.1.2/post/cpu' make -C tools all make: Entering directory `/usr/Setup_Nios/u-boot-1.1.2/tools' make: Leaving directory `/usr/Setup_Nios/u-boot-1.1.2/tools' make -C examples all make: Entering directory `/usr/Setup_Nios/u-boot-1.1.2/examples' nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/usr/Setup_Nios/u-boot-1.1.2/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/usr/Setup_Nios/u-boot-1.1.2/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -I.. -Bstatic -T /usr/Setup_Nios/u-boot-1.1.2/board/altera/dk1c20/u-boot.lds -Ttext 0x018c0000 hello_world.c -o hello_world /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/../../../../nios-elf/bin/ld: cannot open crt0.o: No such file or directory collect2: ld returned 1 exit status nios-elf-gcc: file path prefix `static' never used make: *** Error 1 make: Leaving directory `/usr/Setup_Nios/u-boot-1.1.2/examples' make: *** Error 2 - Altera_Forum
Honored Contributor
Hi Scott:
I can' open this link: http://www.psyent.com/download (http://www.psyent.com/download) Can you sent me the U-boot sources, containing only the files necessary to support Nios-II, using in email. My email address is [email protected] Thank you very much! Regards! Justin - Altera_Forum
Honored Contributor
Hi Justin,
My first recommendation is: delete anything and everything you downloaded fromthe cdk4nios project -- It's dead ... it's junk ... it never amounted to much more than a semester project ... and it does not support nios-ii. > Can you sent me the U-boot sources, containing only the files necessary to support Nios-II, > using in email. It will my pleasure ... but you must promise to get rid of the CDK4NIOS code ;-) Regards, --Scott
- Altera_Forum
Honored Contributor
Hi:
Thank you very very much! Scott:) My board is UP3,with Cyclone EP1C6Q240(with CPU 48MHz),TC58FVT160 Flash Memory 2MB(1M*16b),1S42S16400B SDRAM 8MB,128KB(64K*16b) SRAM. So i should create a suitable u-boot for this board,because u-boot-nios2-src just has the pci5441 and pk1c20. And i should modify the sample files, and fit it to UP3. 1:<target_board>.h include/configs/up3.h 2:<target_board>.c board/up3/up3.c 3:flash driver board/up3/flash.c The first problem is that i can't find the up3-flash datasheet(TC58FVT160), to use in the flash.c. No help in the UP3 munual reference. And in the work of creating up3.h,just getting little info from the SOPC Builder,a exiting up3_board example.Just like the below info: CPU: Clock 48.0MHz Base 0x00000000 End 0x000007FF jtag_uart: JTAG UART Base 0x00000800 End 0x00000807 ext_ram:Sram_UP3 Base 0x00020000 End 0x0003FFFF So the second problem is where can I find some details using for this u-boot work,such as, CFG_Nios_CONSOLE,CF G_GBL_DATA_OFFSET,CFG_Nios_TMRBASE,CFG_Nios_TMRIRQ and so on, because the UP3 munual reference doesn't have this data. Thank you again~! Regards! Justin