Forum Discussion
Altera_Forum
Honored Contributor
16 years agoHippo wrote:
--- Quote Start --- You may enable passing command line from u-boot with this kernel config, "NiosII Configuration"-->"Passed kernel command line from u-boot" --- Quote End --- When I was trying to figure out what was going on, I verified that this was set in the kernel config. Despite this, when the kernel output prints "Kernel command line: ", it shows no bootargs (even when I set bootargs in U-Boot). I had to do weird things with the addresses in U-Boot, to get it to work with the MMU, as I documented in http://www.nioswiki.com/dasuboot/u-boot_with_mmu. It could be that I missed something, and the bootargs are being written to non-existent memory. Specifically, I prefixed the flash address and all the device addresses with "E". For example, my custom_fpga.h shows JTAG_UART_BASE is 0x21208B0. My EP2C35.h defines JTAG_UART_BASE as 0xE21208B0. (Getting the UART right is essential.... without it, you get no output to tell you what is wrong.) I did not move CFG_SDRAM_BASE and CFG_SRAM_BASE. They are still at 0x06000000 and 0x01400000 respectively (the same as in my custom_fpga.h). I did define TEXT_BASE as 0xC7FC0000, 256k from the end of the RAM, in kernel space. If I didn't do this, nios2-download failed. Should CFG_SDRAM_BASE be a 0xC6000000 (in kernel space) instead of 0x06000000? --- Quote Start --- You may enable jffs2 and mtd in kernel config, (or ubifs etc) so that your can root your fs on it. as stated in the wiki, "images/rootfs.jffs2 is jffs2 image, eg, cp rootfs.jffs2 /dev/mtd0. This is available when jffs2 is selected in kernel. Please note the flash erase sector size on 3c120 dev board is 128KB, you will have to specify "MKFS_JFFS2_FLAGS = -l -p -e 128" at the beginning of your product Makefile." --- Quote End --- The Altera EP2C35 board uses either the AM29LV128M or the S29GL128M10TFIR1, both of which have 64 kB sectors. I assume that means I should switch to "MKFS_JFFS2_FLAGS = -l -p -e 64". I turned on jffs2 support in the kernel build. The kernel builds, but the tools fail:
make: Entering directory `/home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user/mtd-utils'
unset CC CFLAGS CPPFLAGS CROSS LDFLAGS; make -C 606f38a2221648ca5c5fa292c9f71d2ddd59fa66/ WITHOUT_XATTR=1 SUBDIRS= BUILDDIR=$PWD/build-606f38a2221648ca5c5fa292c9f71d2ddd59fa66-host/ TARGETS=" mkfs.jffs2"
make: Entering directory `/home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user/mtd-utils/606f38a2221648ca5c5fa292c9f71d2ddd59fa66'
mkdir -p /home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user/mtd-utils/build-606f38a2221648ca5c5fa292c9f71d2ddd59fa66-host/
gcc -I./include -DWITHOUT_XATTR -D_FILE_OFFSET_BITS=64 -O2 -g -Wall -Wextra -Wwrite-strings -Wno-sign-compare -c -o /home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user/mtd-utils/build-606f38a2221648ca5c5fa292c9f71d2ddd59fa66-host/mkfs.jffs2.o mkfs.jffs2.c -g -Wp,-MD,/home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user/mtd-utils/build-606f38a2221648ca5c5fa292c9f71d2ddd59fa66-host/.mkfs.jffs2.c.dep
mkfs.jffs2.c:73:18: error: zlib.h: No such file or directory
mkfs.jffs2.c: In function ‘recursive_populate_directory’:
mkfs.jffs2.c:1336: warning: format ‘%9lu’ expects type ‘long unsigned int’, but argument 3 has type ‘__off64_t’
mkfs.jffs2.c:1345: warning: format ‘%9lu’ expects type ‘long unsigned int’, but argument 3 has type ‘__off64_t’
mkfs.jffs2.c:1354: warning: format ‘%9lu’ expects type ‘long unsigned int’, but argument 3 has type ‘__off64_t’
mkfs.jffs2.c:1384: warning: format ‘%9lu’ expects type ‘long unsigned int’, but argument 3 has type ‘__off64_t’
mkfs.jffs2.c:1395: warning: format ‘%9lu’ expects type ‘long unsigned int’, but argument 3 has type ‘__off64_t’
mkfs.jffs2.c: At top level:
mkfs.jffs2.c:1519: warning: initialization discards qualifiers from pointer target type
mkfs.jffs2.c:1521: warning: initialization discards qualifiers from pointer target type
mkfs.jffs2.c: In function ‘main’:
mkfs.jffs2.c:1881: warning: passing argument 2 of ‘recursive_add_host_directory’ discards qualifiers from pointer target type
make: *** Error 1
make: Leaving directory `/home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user/mtd-utils/606f38a2221648ca5c5fa292c9f71d2ddd59fa66'
make: *** Error 2
make: Leaving directory `/home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user/mtd-utils'
make: *** Error 2
make: Leaving directory `/home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user'
make: *** Error 2
make: Leaving directory `/home/nina/projects/micropump/nios_linux/nios2-linux/uClinux-dist/user'
make: *** Error 1
This seems to be due to a lack of a zlib.h. Recommendations?