Forum Discussion
Minimal MMU linux hangs on DE1 board
Hi all, when trying to build my first MMU linux on a DE1 board system hangs just after nios2-terminal with:
nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB 6-1.1]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Linux version 2.6.34-00692-g5bc7853-dirty ([email protected]) (gcc version 4.1.2)# 62 Wed Jun 23 19:31:26 CEST 2010 bootconsole [early0] enabled and that's all. The system is a bare minimum one comprising only:- linux_cpu (JTAG_debug at 0x07ff_f800)
- linux_timer_1ms (0x0840_0000, IRQ 11)
- fast_tlb_miss_ram_1k (0x07ff_f400, both slaves)
- cfi_flash (thru tsb_cpu_cfi, 0x0000_0000, 4MB)
- sdram (0x1000_0000, 8MB)
- jtag_uart (0x0840_0020, IRQ 1)
23 Replies
- Altera_Forum
Honored Contributor
S O L V E D
I've changed cache sizes downto 4 kB and now takes longer to hang B U T still hangs after: nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB 6-1.1]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Linux version 2.6.34-00692-g5bc7853-dirty ([email protected] version 2.6.34-00692-g5bc7853-dirty (root at mcesarpc4114c.sec.upm.es) (gcc version 4.1.2)# 100 Thu Jun 24 19:01:16 CEST 2010 bootconsole [early0] enabled early_console initialized at 0xe8400020 Linux/Nios II-MMU init_bootmem_node(?,0x10421, 0x10000, 0x10800) free_bootmem(0x10421000, 0x3df000) reserve_bootmem(0x10421000, 0x100) Built 1 zonelists in Zone order, mobility grouping off. Total pages: 2032 Kernel command line: PID hash table entries: 32 (order: -5, 128 bytes) Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) We have 67584 pages of RAM Memory available: 3876k/4224k RAM, 0k/0k ROM (1175k kernel code, 3048k data) Hierarchical RCU implementation. NR_IRQS:32 Calibrating delay loop... 5.72 BogoMIPS (lpj=28608) Mount-cache hash table entries: 512 init_BSP(): registering device resources bio: create slab <bio-0> at 0 Switching to clocksource timer Says 0k/0k ROM as I have removed the CFI flash for now. As before, any help will be wellcome. - Altera_Forum
Honored Contributor
Well, after adjusting SDRAM's timing & PLL I found that the problem is not enough memory. Eight MB seems to little for even a bare minimum MMU linux to work. I switched back to uClinux.
- Altera_Forum
Honored Contributor
Please try turn on this config. It will reduce the shared lib size in the image.
Blackfin build options ─> [*] Cull unused ELF shared libraries - Hippo - Altera_Forum
Honored Contributor
Thanks hippo. Using that option and trimming a lot more I finally managed to boot MMU with only 8 MB SDRAM. Unfortunately the system is almost unusable as, even with functionalities keep to a minimum, remains really short on RAM and apps sometimes fire oom-killer.
[mcesar@mcesarpc4114c uClinux-dist]$ nios2-terminal nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB 6-1.1]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Uncompressing Linux... Ok, booting the kernel. Linux version 2.6.34-00693-ga32ca88-dirty () (gcc version 4.1.2)# 300 PREEMPT Tue Jul 6 20:28:07 CEST 2010 bootconsole [early0] enabled early_console initialized at 0xe1001420 Linux/Nios II-MMU init_bootmem_node(?,0x101c9, 0x10000, 0x10800) free_bootmem(0x101c9000, 0x637000) reserve_bootmem(0x101c9000, 0x100) Built 1 zonelists in Zone order, mobility grouping off. Total pages: 2032 Kernel command line: PID hash table entries: 32 (order: -5, 128 bytes) Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) We have 67584 pages of RAM Memory available: 6276k/1825k RAM, 0k/0k ROM (904k kernel code, 920k data) NR_IRQS:32 Calibrating delay loop... 49.35 BogoMIPS (lpj=246784) Mount-cache hash table entries: 512 init_BSP(): registering device resources Switching to clocksource timer ttyJ0 at MMIO 0x1001420 (irq = 1) is a Altera JTAG UART console [ttyJ0] enabled, bootconsole disabled console [ttyJ0] enabled, bootconsole disabled Freeing unused kernel memory: 772k freed (0xd00e3000 - 0xd01a3000) devpts: called with bogus options ifconfig: socket: Function not implemented Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| For further information check: BusyBox v1.16.2 (2010-07-06 20:15:46 CEST) hush - the humble shell /# free total used free shared buffers Mem: 7048 2876 4172 0 0 Swap: 0 0 0 Total: 7048 2876 4172 /# - Altera_Forum
Honored Contributor
Maybe you can try root fs ext2/3 on sd card (mmc_spi), jffs2 on 4M cfi flash.
- Hippo - Altera_Forum
Honored Contributor
Or use nfs for most or all file systems for the development phase (seems to be recommended for easy development of user software, anyway), and when doing a PCB for the project design it with at least 16 MB (AFAIR the smallest DDR 2 is 32 MB, anyway).
-Michael - Altera_Forum
Honored Contributor
--- Quote Start --- Unfortunately the system is almost unusable as, even with functionalities keep to a minimum, remains really short on RAM and apps sometimes fire oom-killer. --- Quote End --- The default uClinux-dist setup is a bit too aggressive with the oom-killer. You can adjust when it fires with settings in /proc/sys/vm. The init script (rc file) that came in the Altera vendor directory had this:
This isn't a nommu system, and making the value *bigger* for a small memory system doesn't make any sense to me. I've changed it to# the default calculated values for these kernel controls are too small for # an embedded nommu system, so override them. For more info check out # - ./Documentation/sysctl/vm.txt # - ./Documentation/filesystems/proc.txt # echo 4096 > /proc/sys/vm/min_free_kbytes
to reduce the oom-killer needlessly firing. 1MiB is the minimum one should use for this value according to the kernel documentation.echo 1024 > /proc/sys/vm/min_free_kbytes - Altera_Forum
Honored Contributor
Thanks a lot ykozlov. Now it runs great!
In any case I'm still trying to use the Flash memory to mount the filesystem there, but without success until now. What options in menuconfig must I enable? What are the /dev names for the Flash drive? Thanks a lot & regards. - Altera_Forum
Honored Contributor
Well, finally managed to store filesystem in Flash, now I've much more free memory in my DE1 board. here it is:
nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB 6-1.1]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Linux version 2.6.34-00693-ga32ca88-dirty ([email protected]) (gcc version 4.1.2)# 331 PREEMPT Tue Jul 13 20:28:55 CEST 2010 Linux/Nios II-MMU init_bootmem_node(?,0x101bf, 0x10000, 0x10800) free_bootmem(0x101bf000, 0x641000) reserve_bootmem(0x101bf000, 0x100) Built 1 zonelists in Zone order, mobility grouping off. Total pages: 2032 Kernel command line: root=/dev/mtdblock0 rootfstype=jffs2 ro PID hash table entries: 32 (order: -5, 128 bytes) Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) We have 67584 pages of RAM Memory available: 6316k/1785k RAM, 0k/0k ROM (1402k kernel code, 382k data) NR_IRQS:32 Calibrating delay loop... 49.15 BogoMIPS (lpj=245760) Mount-cache hash table entries: 512 init_BSP(): registering device resources bio: create slab <bio-0> at 0 Switching to clocksource timer JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc. JFS: nTxBlock = 49, nTxLock = 394 io scheduler noop registered (default) ttyJ0 at MMIO 0x1801420 (irq = 1) is a Altera JTAG UART console [ttyJ0] enabled physmap platform flash device: 00400000 at 01400000 physmap-flash.0: Found 1 x16 devices at 0x0 in 8-bit bank Amd/Fujitsu Extended Query Table at 0x0040 number of CFI chips: 1 cmdlinepart partition parsing not available RedBoot partition parsing not available Using physmap partition information Creating 2 MTD partitions on "physmap-flash.0": 0x000000200000-0x000000400000 : "romfs/jffs2" 0x000000000000-0x000000200000 : "loader/kernel" VFS: Mounted root (jffs2 filesystem) readonly on device 31:0. Freeing unused kernel memory: 44k freed (0xd0160000 - 0xd016a000) ifconfig: socket: Function not implemented Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| For further information check: http://www.uclinux.org/ BusyBox v1.16.2 (2010-07-12 20:38:43 CEST) hush - the humble shell Enter 'help' for a list of built-in commands. root:/> free total used free shared buffers Mem: 6360 3124 3236 0 0 Swap: 0 0 0 Total: 6360 3124 3236 root:/> mount rootfs on / type rootfs (rw) /dev/root on / type jffs2 (ro,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600) var on /var type ramfs (rw,relatime) tmp on /tmp type tmpfs (rw,nosuid,nodev,relatime) root:/> - Altera_Forum
Honored Contributor
Hi mcesar,
I am using NEEK, however, my board hangs after few minutes, do you think the problem lies in insufficient memory? I am curious to know the following 1. what things you store in Flash? 2. what HW components do you have? and what are their settings? 3. what kernel menuconfig do you do? 4. what must I read to be able to do like you did? Thanks.