首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

在IDE中怎样编写uClinux上运行的程序

在IDE中怎样编写uClinux上运行的程序

在IDE中怎样编写uClinux上运行的程序
在IDE中编译hello代码成hello.exe文件后,我把他粘贴到文件系统的bin目录下,然后重新编译文件系统后,下载到开发板上,运行uClinux,在串口工具中进入bin目录,为什么找不到hello.exe文件啊
我build过文件系统之后才上传的,还是没有,不知道为什么,有一些自带的程序在串口软件用ls命令查看时也没有,例如boa.exe
在IDE中文件系统bin目录下,我能看到hello.exe,boa.exe等,build之后上传,在传口调式中就看不到了。我选文件系统时差不多都选了,只有两个没选。肯定不是boa,与内核配置文件选择有关吗,与文件系统有关的该选那项呢。

[此贴子已经被作者于2007-2-8 11:57:35编辑过]

文件上传没有失败啊,上传之后只有部分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编辑过]

#! /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有问题吗?怎样才能上传成功啊。

romfs.bin应该没有找错,# 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  这上面还有具体的路径。

怎样将将flash erase掉,自己编写代码擦吗?这可有点困难

终于成功了,谢谢caopengly 的帮助,有两个文件系统,我明明改了在0x400000是文件系统的起始位置,但是没有变,还是在0x200000位置找文件系统.我也不知道怎么改了。
返回列表