编译Uboot——错误记录

时间:2022-08-19 22:06:41

我使用的是ZLG的EasyARM i.MX280A的开发板。官方提供的编译器时arm-fsl-linux-gnueabihf(gcc 4.4.4)。自己尝试使用arm-linaro-linux-gnueabihf(gcc 4.7.3)。

按照开发手册的流程,解决编译上的报错后,得到imx_ivt_uboot.sb文件。

使用官方提供的工具格式化NAND flash,格式化成功,串口终端输出与手册上一致。

按照开发手册,将进行uboot only的烧写,需要提供的文件是imx_ivt_uboot.sb(放在Profiles\MX28 Linux Update\OS Firmware\files目录下),我仅且提供了imx_ivt_uboot.sb来控制变量。

烧写过程串口输出如下:

start bootlets
Mar 7 201610:44:04
FRAC 0x92925552
Wait for ddr ready 1power 0x00820616
Frac 0x92925552
start change cpu freq
hbus 0x00000003
cpu 0x00010001
start test memory accress
ddr2 0x40FFFF00
finish simple test
******ddr2 read write success!
finish simple test
finish boot prep,start to run ...
LLLLLFLCLFLLJUncompressing Linux... done, booting the kernel.
Linux version 2.6.35.3-571-gcca29a0-gea56f1e-dirty (chenhaiman@ubuntuVM) (gcc version 4.4.4 (4.4.4_09.06.2010) ) #8 Tue May 10 16:07:37 CST 2016
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Freescale MX28EVK board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: gpmi=g console=ttyAM0,115200n8 ip=192.168.12.180:192.168.12.48:192.68.12.1:255.255.255.0::eht0: fec_mac= ethact mem=64M
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 57568k/57568k available, 7968k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xfde00000 - 0xffe00000 ( 32 MB)
vmalloc : 0xc4800000 - 0xf0000000 ( 696 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.init : 0xc0008000 - 0xc0024000 ( 112 kB)
.text : 0xc0024000 - 0xc02d9000 (2772 kB)
.data : 0xc02da000 - 0xc02f6e00 ( 116 kB)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
RCU-based detection of stalled CPUs is disabled.
Verbose stalled-CPUs detection is disabled.
NR_IRQS:288
Console: colour dummy device 80x30
console [ttyAM0] enabled
Calibrating delay loop... 226.09 BogoMIPS (lpj=1130496)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
regulator: vddd: 800 <--> 1575 mV at 1500 mV fast normal
regulator: vdddbo: 800 <--> 1575 mV fast normal
regulator: vdda: 1500 <--> 2275 mV at 1800 mV fast normal
vddio = 3380000, val=10
regulator: vddio: 2880 <--> 3680 mV at 3380 mV fast normal
regulator: overall_current: fast normal
regulator: vbus5v:
regulator: mxs-duart-1: fast normal
regulator: mxs-bl-1: fast normal
regulator: mxs-i2c-1: fast normal
regulator: mmc_ssp-1: fast normal
regulator: mmc_ssp-2: fast normal
regulator: charger-1: fast normal
regulator: power-test-1: fast normal
regulator: cpufreq-1: fast normal
i.MX IRAM pool: 120 KB@0xc4820000
Initializing GPMI pins
usb DR wakeup device is registered
IMX usb wakeup probe
audit: cannot initialize inotify handle
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Switching to clocksource mxs clock source
NET: Registered protocol family 1
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 4096K
Bus freq driver module loaded
mxs_cpu_init: cpufreq init finished
audit: initializing netlink socket (disabled)
type=2000 audit(1.500:1): initialized
JFFS2 version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
msgmni has been set to 120
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered (default)
mxs-duart.0: ttyAM0 at MMIO 0x80074000 (irq = 47) is a DebugUART
brd: module loaded
loop: module loaded
Loading iSCSI transport class v2.0-870.
i.MX GPMI NFC
NFC: Version 1, 8-chip GPMI and BCH
Boot ROM: Version 1, Single-chip boot area, block mark swapping supported
Scanning for NAND Flash chips...
NAND device: Manufacturer ID: 0xc2, Chip ID: 0xf1 (Unknown NAND 128MiB 3,3V 8-bit)
-----------------------------
NAND Flash Device Information
-----------------------------
Manufacturer : Unknown (0xc2)
Device Code : 0xf1
Cell Technology : SLC
Chip Size : 128 MiB
Pages per Block : 64
Page Geometry : 2048+64
ECC Strength : 4 bits
ECC Size : 512 B
Data Setup Time : 20 ns
Data Hold Time : 10 ns
Address Setup Time: 20 ns
GPMI Sample Delay : 6 ns
tREA : Unknown
tRLOH : Unknown
tRHOH : Unknown
Description : MX30LF1G08AA
-----------------
Physical Geometry
-----------------
Chip Count : 1
Page Data Size in Bytes: 2048 (0x800)
Page OOB Size in Bytes : 64
Block Size in Bytes : 131072 (0x20000)
Block Size in Pages : 64 (0x40)
Chip Size in Bytes : 134217728 (0x8000000)
Chip Size in Pages : 65536 (0x10000)
Chip Size in Blocks : 1024 (0x400)
Medium Size in Bytes : 134217728 (0x8000000)
------------
NFC Geometry
------------
ECC Algorithm : BCH
ECC Strength : 8
Page Size in Bytes : 2112
Metadata Size in Bytes : 10
ECC Chunk Size in Bytes: 512
ECC Chunk Count : 4
Payload Size in Bytes : 2048
Auxiliary Size in Bytes: 16
Auxiliary Status Offset: 12
Block Mark Byte Offset : 1999
Block Mark Bit Offset : 0
-----------------
Boot ROM Geometry
-----------------
Boot Area Count : 1
Boot Area Size in Bytes : 20971520 (0x1400000)
Stride Size in Pages : 64
Search Area Stride Exponent: 2
Boot area protection is enabled.
Creating 7 MTD partitions on "gpmi-nfc-main":
0x000000000000-0x000000c00000 : "reserve"
0x000000c00000-0x000000c80000 : "reserve"
0x000000c80000-0x000000d00000 : "reserve"
0x000000d00000-0x000000f00000 : "bmp"
0x000000f00000-0x000000f80000 : "reserve"
0x000000f80000-0x000004f80000 : "rootfs"
0x000004f80000-0x000008000000 : "opt"
ARC USBOTG Device Controller driver (1 August 2005)
check_parameters:UTP settings are in place now, overriding defaults
g_file_storage gadget: File-backed Storage Gadget, version: 20 November 2008
g_file_storage gadget: Number of LUNs=1
fsl-usb2-udc: bind to driver g_file_storage
This is 5V only build.
mxs-mmc: MXS SSP Controller MMC Interface driver
mxs-mmc mxs-mmc.0: mmc0: MXS SSP MMC DMAIRQ 82 ERRIRQ 96
NET: Registered protocol family 17
Freeing init memory: 112K
init started: BusyBox v1.15.0 ()
starting pid 1633, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
mount: mounting tmpfs on /dev failed: Invalid argument
mknod: /dev/console: File exists
Starting the hotplug events dispatcher udevd
Synthesizing initial hotplug events
g_file_storage gadget: high speed config #1
Setting the hostname to freescale
Mounting filesystems
no mount -n -t tmpfs shm /dev/shm
no mount -n -t tmpfs rwfs /mnt/rwfs -o size=512k
*
*
mount: mounting usbfs on /proc/bus/usb failed: No such file or directory
no mount tmpfs /tmp -t tmpfs -o size=16m
Starting inetd:
==========================================================
Common updater program for IMX28 chips,2016/05/11
Guangzhou ZHIYUAN electronics Co.,LTD
==========================================================
*** No SD card detected ***
*** Using USB method ***
uuc 0.4 [built Feb 21 2014 08:19:00]
UTP: Waiting for device to appear
UTP: file/device node /dev/utp already exists
cpu_id is 28
UTP: received command 'mknod class/mtd,mtd0,/dev/mtd0'
class = 'class/mtd'
item = 'mtd0'
node = /dev/mtd0
type = (null)
UTP: running utp_mk_devnode(class/mtd,mtd0,/dev/mtd0,0x2000)
UTP: file/device node /dev/mtd0 already exists
UTP: sending Success
g_file_storage gadget: high speed config #1
UTP: received command '$ nandtest -m -s /dev/urandom /dev/mtd0'
UTP: sending Busy
UTP: executing "nandtest -m -s /dev/urandom /dev/mtd0"
ECC corrections: 0
ECC failures : 0
Bad blocks : 0
BBT blocks : 0
00be0000: checking...
Finished pass 1 successfully
UTP: sending Success
UTP: received command 'send'
UTP: sending Success
UTP: received command '$ kobs-ng init $FILE'
UTP: sending Busy
UTP: executing "kobs-ng init $FILE"
UTP: sending Success
UTP: received command '$ echo Update Complete!'
UTP: sending Busy
UTP: executing "echo Update Complete!"
Update Complete!
UTP: sending Success
g_file_storage gadget: high speed config #1

烧写完成之后,启动开发板串口终端输出如下:

Aug  ::
FRAC 0x92925552
Wait for ddr ready 1Wait for ddr ready 1bank count is
power 0x00820616
Frac 0x92925552
start change cpu freq
hbus 0x00000003
cpu 0x00010001
start test memory accress
ddr2 0x40FFFF00
finish simple test
******ddr2 read write success!
finish simple test
finish boot prep,start to run ...

进行对比实验,

1.使用官方的uboot可以正常启动,流程操作无误,且证明单单使用imx_ivt_uboot.sb能满足uboot正常启动。

2.使用CPU参数-mfloat-abi=hard和-msoft-float不同的固件imx_ivt_uboot.sb都可以成功烧写入。

结论

1.排除了操作失误影响,每次烧写前格式化保证了不会受前次烧写的影响。

2.rootfs的影响。尚在学习rootfs制作。(怀疑原因:我在前面做了个实验,替换了系统glibc库,结果uboot都不能正常使用了,故怀疑uboot依赖根目录下的库文件)

3.设备与该编译器不兼容。优先级最低,不能证真,若归结到此原因上则没有继续试验必要。

把这个写下来是希望自己深入理解嵌入式后能知道为什么有问题,而不是通过尝试寻找到问题所在。当然如果有嵌入式大神能给予指导更加欢迎。

参考:

1.使用arm-none-linux-gnueabi编译uboot可以正常运行,排除了使用的glibc版本过高而导致的问题。