QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: CoryXie

U-boot for lumit4510 released.

[复制链接]
发表于 2005-9-29 14:55:56 | 显示全部楼层
好,感谢!我试试
回复

使用道具 举报

发表于 2005-9-29 17:35:48 | 显示全部楼层
CoryXie,我按照你说的从SF下载u-boot-1.1.3源码,把你的源码文件夹里lumit4510和lumit4510.h拷贝到解压后相应的路径下.并修改了Makefile文件.
运行make distclean
    make lumit4510_config
    make
相应的信息如下:
[root@localhost u-boot-1.1.3]# make lumit4510_config
Configuring for lumit4510 board...
[root@localhost u-boot-1.1.3]# make
make[1]: arm-linux-gcc: Command not found
make[1]: Entering directory `/root/u-boot-1.1.3/tools'
make[1]: `.depend' is up to date.
make[1]: Leaving directory `/root/u-boot-1.1.3/tools'
make[1]: arm-linux-gcc: Command not found
make[1]: Entering directory `/root/u-boot-1.1.3/examples'
/bin/sh: line 1: arm-linux-gcc: command not found
dirname: 参数太少
请尝试执行‘dirname --help’来获取更多信息。
/bin/sh: line 1: arm-linux-gcc: command not found
dirname: 参数太少
请尝试执行‘dirname --help’来获取更多信息。
make[1]: `.depend' is up to date.
make[1]: Leaving directory `/root/u-boot-1.1.3/examples'
make[1]: arm-linux-gcc: Command not found
make[1]: Entering directory `/root/u-boot-1.1.3/post'
make[1]: `.depend' is up to date.
make[1]: Leaving directory `/root/u-boot-1.1.3/post'
make[1]: arm-linux-gcc: Command not found
make[1]: Entering directory `/root/u-boot-1.1.3/post/cpu'
make[1]: `.depend' is up to date.
make[1]: Leaving directory `/root/u-boot-1.1.3/post/cpu'
make -C tools all
make[1]: arm-linux-gcc: Command not found
make[1]: Entering directory `/root/u-boot-1.1.3/tools'
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O -c -o img2srec.o img2srec.c
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O  -o img2srec img2srec.o
strip img2srec
gcc -g -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O -c mkimage.c
gcc -g -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O -c crc32.c
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O  -o mkimage mkimage.o crc32.o
strip mkimage
gcc -g -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O -c envcrc.c
gcc -g  -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -c environment.c
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O -o envcrc envcrc.o crc32.o environment.o
gcc -g -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O -c gen_eth_addr.c
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O  -o gen_eth_addr gen_eth_addr.o
strip gen_eth_addr
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O -c -o bmp_logo.o bmp_logo.c
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE=0x007d0000 -DUSE_HOSTCC -O  -o bmp_logo bmp_logo.o
strip bmp_logo
./bmp_logo logos/denx.bmp >/root/u-boot-1.1.3/include/bmp_logo.h
make[1]: Leaving directory `/root/u-boot-1.1.3/tools'
make -C examples all
make[1]: arm-linux-gcc: Command not found
make[1]: Entering directory `/root/u-boot-1.1.3/examples'
/bin/sh: line 1: arm-linux-gcc: command not found
dirname: 参数太少
请尝试执行‘dirname --help’来获取更多信息。
/bin/sh: line 1: arm-linux-gcc: command not found
dirname: 参数太少
请尝试执行‘dirname --help’来获取更多信息。
arm-linux-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x007d0000 -I/root/u-boot-1.1.3/include -fno-builtin -ffreestanding -nostdinc -isystem  -pipe  -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -mtune=arm7tdmi -Wall -Wstrict-prototypes -c -o hello_world.o hello_world.c
make[1]: arm-linux-gcc: Command not found
make[1]: *** [hello_world.o] Error 127
make[1]: Leaving directory `/root/u-boot-1.1.3/examples'
make: *** [examples] Error 2
[root@localhost u-boot-1.1.3]#

好像是差个命令文件arm-linux-gcc
运行make evb4510_config
    make
提示信息是一样的.
是不是要从SF上下载ELDK?
回复

使用道具 举报

 楼主| 发表于 2005-9-29 18:37:20 | 显示全部楼层
对了,应该将arm-linux-gcc改成arm-elf-gcc.
回复

使用道具 举报

 楼主| 发表于 2005-9-29 18:38:39 | 显示全部楼层
干脆把我的Makefile换过去
回复

使用道具 举报

发表于 2005-10-5 12:43:34 | 显示全部楼层
按照你说的,编译通过了。拷贝lumit4510和lumit4510.h到相应目录,覆盖Makefile,改arm成Arm。修改后的U-boot如何在线调试,用GDB?配置的时候没有弹出来一个界面供选择,对于有些函数功能块我不需要?要是能和配置linux内核一样就好了。可以随意裁减。
回复

使用道具 举报

 楼主| 发表于 2005-10-5 14:53:46 | 显示全部楼层
你可以参照lumit4510.h里面的配置,一般是CFG_XXX_XXX,如果相应的CFG_XXX_XXX没有#define的话,就表示不包含。例如,你不需要将环境变量
保存到Flash中,你可以去掉#define CFG_ENV_IN_FLASH的定义。
回复

使用道具 举报

发表于 2005-10-8 11:11:35 | 显示全部楼层
老大,把你总结的u-boot 命令的一些用法说明传一份。按照你说我重新编译并烧写
U-Boot 1.1.3 (Oct  2 2005 - 16:12:09)

U-Boot code: 007D0000 -> 007E83E0  BSS: -> 007F2634
IRQ Stack: 007aef7c
FIQ Stack: 007adf7c
RAM Configuration:
Bank #0: 00000000 16 MB
Flash:  4 MB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
lumit4510 # help
?       - alias for 'help'
autoscr - run script from memory
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
echo    - echo args to console
erase   - erase FLASH memory
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
imls    - list all images found in flash
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
tftpboot- boot image via network using TFTP protocol
version - print monitor version
lumit4510 # printenv
bootargs=console=ttyS0,19200 initrd=0x100a0040,530K root=/dev/ram0 keepinitrd
bootcmd=tftp 100000 uImage.bin
bootdelay=7
baudrate=19200
ethaddr=00:40:95:36:35:33
ipaddr=192.168.1.5
serverip=192.168.1.2
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial

Environment size: 265/4092 bytes
lumit4510 #
只会用简单的几个命令(reset,help,printenv)。
我想把这个u-boot改造成这样:
1。标准输入输出改成telnet,只要PC机通过telnet登陆4510,就出现和串口一样的引导信息。既然他支持网络就利用它远程服务。
2。支持ftp服务,通过通用ftp终端软件上传下载程序,并在telnet里输入命令运行他。
我也断断续续看了一些别人写u-boot移植说明,但是还有很多疑问想跟老大请教。方便的话能留个QQ号吗?群里好像做u-boot移植的很少。先谢了!:):)
回复

使用道具 举报

 楼主| 发表于 2005-10-8 12:00:52 | 显示全部楼层
老大,u-boot支持tftp下载内核,不要用FTP,TFTP用在嵌入式系统已经不错了,FTP太重了,嵌入式系统一般不用这个作bootloader!!
你在PC linux上能启动TFTP服务吗?
我常用的命令是:
1.setenv,saveenv一般用来设置内核启动参数。
例如:
[code:1]
lumit4510 # setenv bootargs root=/dev/mtdblock0 rw rootfstype=jffs2
lumit4510 # save
Saving Environment to Flash...
Un-Protected 1 sectors
Erasing Flash... done
Erased 1 sectors
Writing to Flash... done
Protected 1 sectors
lumit4510 #
[/code:1]
注意,u-boot可以识别简略命令,例如上面的saveenv,你输入save就可以了,只要不冲突。
2.tftpboot ,一般用来下载内核和文件系统映像到内存的某个位置。
例如,
[code:1]
lumit4510 # tftp 100000 uImage.bin
TFTP from server 192.168.1.2; our IP address is 192.168.1.5
Filename 'uImage.bin'.
Load address: 0x100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ############################
done
Bytes transferred = 1473412 (167b84 hex)
[/code:1]
3.bootm,当然用来启动内核。
例如,
[code:1]
lumit4510 # bootm
## Booting image at 00100000 ...
   Image Name:   Linux 2.6.9-hcs0 Kernel Image
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1473348 Bytes =  1.4 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
                                                                                                                                               
Starting kernel ...
                                                                                                                                               
Linux version 2.6.9-hsc0 ([email protected]) (gcc version 3.4.0) #3 Sat Oct 8 02:00:46 CST 2005
CPU: Samsung-S3C4510B [36807001] revision 1 (ARMv4T)
Machine: ESPD 4510B(S3C4510B)
。。。。。。。
[/code:1]
注意,bootm 可以有几种用法,如果你是内核和文件系统映像(例如romfs.img)是分开的,你用tftp将内核和文件系统映像下载到0x100000和0x600000之后,可以用:
[code:1]bootm 100000 600000[/code:1]
来启动。
4。如果你要将内核烧到FLASH中去,可以这样:
[code:1]
lumit4510 # tftp
TFTP from server 192.168.1.2; our IP address is 192.168.1.5
Filename 'uImage.bin'.
Load address: 0x100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ############################
done
Bytes transferred = 1473412 (167b84 hex)
lumit4510 # protect off 1030000 1200000
Un-Protected 29 sectors
lumit4510 # era 1030000 1200000
done
Erased 29 sectors
lumit4510 # cp.b 100000 1030000 $(filesize)
Copy to Flash... done
lumit4510 # boot
## Booting image at 01030000 ...
   Image Name:   Linux 2.6.9-hcs0 Kernel Image
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1473348 Bytes =  1.4 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
                                                                                                                                               
Starting kernel ...
                                                                                                                                               
Linux version 2.6.9-hsc0 ([email protected]) (gcc version 3.4.0) #3 Sat Oct 8 02:00:46 CST 2005
CPU: Samsung-S3C4510B [36807001] revision 1 (ARMv4T)
Machine: ESPD 4510B(S3C4510B)
Built 1 zonelists
Kernel command line: root=/dev/mtdblock0 rw rootfstype=jffs2
[/code:1]
我能直接用tftp就开始下载映像,原因是我已经使用setenv命令将loadaddr和bootfile指定了。
[code:1]
lumit4510 # printenv
bootdelay=7
baudrate=19200
ethaddr=00:40:95:36:35:33
bootfile=uImage.bin
loadaddr=100000
bootcmd=bootm 1030000
filesize=bc840
fileaddr=600000
netmask=255.255.255.0
ipaddr=192.168.1.5
serverip=192.168.1.2
rootpath=/root/lumit/src/uClinux/2.6/uClinux-dist/romfs
bootargs=root=/dev/mtdblock0 rw rootfstype=jffs2
stdin=serial
stdout=serial
stderr=serial
                                                                                                                                               
Environment size: 350/4092 bytes
[/code:1]
回复

使用道具 举报

发表于 2005-10-8 17:36:03 | 显示全部楼层
老大,我的板网络好像有问题。我把PC的IP设成192.168.1.2 MAC:255.255.255.0
在超级终端上
lumit4510 # ping 192.168.1.2
host 192.168.1.2 is alive
lumit4510 # bdinfo
arch_number = 0x00000000
env_t       = 0x00000000
boot_params = 0x00000800
DRAM bank   = 0x00000000
-> start    = 0x00000000
-> size     = 0x01000000
ethaddr     = 00:40:95:36:35:33
ip_addr     = 192.168.1.5
baudrate    = 19200 bps
lumit4510 #
在我的PC机上ping 192.168.1.5不通,从你说的站点上下载tftpd32,双击可执行文件tftpd32.exe
PC机有错误提示信息:Error Can`t bind the TFTP port!
Either you do not have necessary privilege or a TFTP daemon is already started
bind returns error -1,GetLastError 10048
u-boot 里设的端口是多少?然后就是运行tftpd32后DHCP Server页面应该怎么设置?
重起PC也不管用。
我从lumit主页上下载DOS版的TFTP也没传成功。
闭门造车造不出来,只好麻烦你了。:):0
回复

使用道具 举报

 楼主| 发表于 2005-10-8 23:21:34 | 显示全部楼层
首先,你的板子的网络没有问题.
其次,你的PC机的网络可能已经开启了TFTP服务,你看看你的"控制面板->管理工具->服务".注意,PC上应该运行TFTP服务器.
回复

使用道具 举报

发表于 2005-10-9 20:32:16 | 显示全部楼层
老大,程序写进去了,没启动成功
lumit4510 # tftp 100000 image.bin
TFTP from server 192.168.1.2; our IP address is 192.168.1.5
Filename 'image.bin'.
Load address: 0x100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##############
done
Bytes transferred = 3066692 (2ecb44 hex)
lumit4510 # bootm
## Booting image at 00100000 ...
Bad Magic Number
lumit4510 #
Bad Magic Number是什么意思?

通过串口loadb下载image.ram,也没启动成功
lumit4510 # loadb 0x10000 19200
## Ready for binary (kermit) download to 0x00010000 at 19200 bps...
## Total Size      = 0x00171406 = 1512454 Bytes
## Start Addr      = 0x00010000
lumit4510 # go 0x10000
## Starting application at 0x00010000 ...
就没下文了。重起目标板,引导不太好,停上一会,再加电,目标板有能正常启动。
看了半天readme,搞不大懂.老大再指点一下:):)谢了!
回复

使用道具 举报

 楼主| 发表于 2005-10-9 23:40:29 | 显示全部楼层
我告诉过你要用mkimage工具转换一下image.bin吧?
mkimage -A arm -O linux -T kernel -C none \
         -a 0x8000 -e 0x8000 -n "Linux 2.6.7-hcs0 Kernel Image" \
         -d linux-2.6.x/linux.bin images/uImage.bin
mkimage工具在u-boot的顶层目录下能找到,直接放到你的PC机的/usr/bin下面去吧!
回复

使用道具 举报

发表于 2005-10-10 10:35:54 | 显示全部楼层
CoryXie
大侠,我在用你的u-boot的时候,怎么用Flash烧写功能阿?用超级终端和kemit协议,怎么传不过去,还有就是你的这个u—boot的存储器配置,应该是SDRAM的起始地址0x0000000;Flash的起始地址为:0x01000000吗?说说你的Flash烧写功能,多谢!
回复

使用道具 举报

发表于 2005-10-10 10:45:12 | 显示全部楼层
拷贝Falsh程序,怎么出现这个错误了?####################################################
done
Bytes transferred = 1596204 (185b2c hex)
lumit4510 # protect off 130  

Usage:
protect - enable or disable FLASH write protection

lumit4510 # protect off 1030000 1200000

Error: end address not on sector boundary
lumit4510 # cp.b 10000 1030000 1600000

Copy to Flash... Outside available Flash
lumit4510 #
回复

使用道具 举报

发表于 2005-10-10 11:04:57 | 显示全部楼层
mkimage工具,这个工具在哪了, 我没有找到阿?  
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-19 19:29 , Processed in 0.101780 second(s), 12 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表