假设你的uclinux系统已经有了核和文件系统。然后
1。在Mcrotronix niosii 中选linux application project一路next到finish.
2.在app中建一个new->file 如hello.c
3.然后在nios2/example/software/linux/apps samples/hello中找到makefile,并考到hello。c的路径下,makefile的制作看Linux Reference Guaid 19页
4。然后Creat Make Target....
Build Make Target....
在把exe考到文件系统/bin/中,就可以像运行shell命令一样运行程序了
[此贴子已经被作者于2007-2-6 21:50:26编辑过]
你如果在ide中将hello.exe拷到/bin/目录,然后build文件系统。
再将文件系统重新下载下去,会有的。
你是这样做的吗?
[此贴子已经被作者于2007-2-7 17:14:24编辑过]
那是你在选file系统的时候选了最小的系统。你可以选全部选项,有4M多,就有boa了
上面的做法没有错,如果你将文件拷到file系统中,build后都应该看得到。
[此贴子已经被作者于2007-2-8 11:57:35编辑过]
你的文件系统上传有没有问题,就是会不会上传失败了?你是怎么判断的?
在build前,文件系统中有的东西,上传后不会改变的。
文件上传没有失败啊,上传之后只有部分exe文件在bin目录下
下面是运行的代码
uClinux/Nios II
Altera Nios II support (C) 2004 Microtronix Datacom Ltd.
Built 1 zonelists
Kernel command line: root=/dev/mtdblock0 ro
PID hash table entries: 256 (order: 8, 4096 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 30640k/32768k RAM, 0k/0k ROM (1452k kernel code, 303k data)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
NET: Registered protocol family 16
NIOS serial driver version 0.0
ttyS0 (irq = 4) is a builtin NIOS UART
Serial: JTAG UART driver $Revision: 1.4 $
ttyJ0 at MMIO 0x808010f0 (irq = 5) is a jtag_uart
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
microtronix[mtd]: RAM probe address=0x200000 size=0xdc000
Creating 1 MTD partitions on "RAM":
0x00000000-0x000dc000 : "ROMfs"
microtronix[mtd]: set ROMfs to be root filesystem
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
NET: Registered protocol family 1
NET: Registered protocol family 17
VFS: Mounted root (romfs filesystem) readonly.
Freeing unused kernel memory: 64k freed (0x2196000 - 0x21a5000)
# ls
bin dev etc home mnt proc ramfs.img
sbin sys tmp usr var
# cd bin
# ls
cat chgrp chmod chown cmp cp dd
debug df free grep hostname ifattach kill
l ln ls mkdir mkfifo mknod more
mount mv ps reboot rm rmdir sh
shutdown sync touch umount
一直是这32个exe文件,其他exe文件显示不出来,再就是自己编写的exe文件也显示不出来,不管原来是全部插入文件系统,还是最小插入文件系统
[此贴子已经被作者于2007-2-8 22:38:37编辑过]
你说一直是这32个exe文件?你有没有曾经改变过,哪怕是一点改变来说明你能够上传,你的开机提示并不能代表你能够上传。如果系统的flash中有uclinux系统,就会有这个提示。
你是怎么判断上传成功了的?
#! /bin/sh
#
# This file was automatically generated by the Nios II IDE Flash Programmer.
#
# It will be overwritten when the flash programmer options change.
#
cd G:/nios2_5_1/linux_nios_v2/build
# Creating .flash file for the datafile
$SOPC_KIT_NIOS2/bin/bin2flash --base=0x00000000 --location=0x0400000 --input=G:/
nios2_5_1/file_system/romfs.bin --output=romfs.flash
# Programming flash with the datafile
$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --cable='USB-Blaster [USB-0]' --devic
e=1 --base=0x00000000 romfs.flash
Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Resetting and pausing target processor: OK
: Checksumming existing contents
00400000 : Reading existing contents
00410000 : Reading existing contents
00420000 : Reading existing contents
00430000 : Reading existing contents
00440000 : Reading existing contents
00450000 : Reading existing contents
00460000 : Reading existing contents
00470000 : Reading existing contents
00480000 : Reading existing contents
00490000 : Reading existing contents
Checksummed/read 12kB in 0.6s
00400000 ( 0%): Erasing
00410000 (10%): Erasing
00420000 (20%): Erasing
00430000 (30%): Erasing
00440000 (40%): Erasing
00450000 (50%): Erasing
00460000 (60%): Erasing
00470000 (70%): Erasing
00480000 (80%): Erasing
00490000 (90%): Erasing
Erased 640kB in 5.9s (108.4kB/s)
00400000 ( 0%): Programming
00410000 (10%): Programming
00420000 (20%): Programming
00430000 (30%): Programming
00440000 (40%): Programming
00450000 (50%): Programming
00460000 (60%): Programming
00470000 (70%): Programming
00480000 (80%): Programming
00490000 (90%): Programming
Programmed 628KB +12KB in 13.6s (47.0KB/s)
Device contents checksummed OK
Leaving target processor paused
这是文件系统上传的记录,我把bin目录下的文件删除了几个,上传之后还是有这几个文件。也许我的文件系统是真的上传失败了,我该怎么做,是我的flash有问题吗?怎样才能上传成功啊。
重你的Programmed 628KB +12KB in 13.6s (47.0KB/s) 上来看,你的flash上传没有问题,应该是你的romfs.bin找错了,你仔细找找。你可能多次上传了错误的文件!
你再摸索一下。
goodluck!
[此贴子已经被作者于2007-2-10 13:48:01编辑过]
你的flash能够上传正确的文件系统,而且,调用的文件系统从来又没有改变过。。。。
系统能够顺利启动,你可以:
这样我猜测,你的flash中可能有两个文件系统,而你的kernal总是指向了错误的那个。你可以看看kernal指向的文件系统的地址有没有问题。
你可以将flash erase掉,然后重新生成kernal和flash,看能不能顺利启动。。。。如果不能说明kernal指向的文件系统的地址有问题。
怎样将将flash erase掉,自己编写代码擦吗?这可有点困难
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |