Chinaunix首页 | 论坛 | 博客
  • 博客访问: 149887
  • 博文数量: 35
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 305
  • 用 户 组: 普通用户
  • 注册时间: 2016-02-01 12:35
个人简介

不断超越自己,将更强大!

文章分类

全部博文(35)

文章存档

2022年(1)

2017年(5)

2016年(29)

我的朋友

分类: 嵌入式

2016-02-20 13:00:25

在串口终端打印的信息如下:




RomBOOT


AT91Bootstrap 3.6.0 (Sat Jan 30 20:44:32 CST 2016)

NAND: Done to load image


U-Boot 2014.04 (Feb 20 2016 - 12:02:56)

CPU: AT91SAM9261
Crystal frequency:   18.432 MHz
CPU clock        :  198.656 MHz
Master clock     :   99.328 MHz
DRAM:  64 MiB
WARNING: Caches not enabled
NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0 

NAND read: device 0 offset 0x200000, size 0x300000
 3145728 bytes read: OK
## Booting kernel from Legacy Image at 22000000 ...
   Image Name:   Linux-3.4.9-AT91SAM9261
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1663528 Bytes = 1.6 MiB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

         接下来,就什么都没有了,就像没有内核一样的。。。但是内核又加载成功了一样,看了一下开发板,LED还在闪着呢,我记得Uboot烧写成功后,这个用户LED灯不闪烁。难道Linux内核已经成功运行,只是串口没有打印,看来有可能与Linux中的串口驱动有关!!!
        Uboot的传递参数是正确的,其他的内核引导过正常!!

打开内核,配置一下串口的驱动,控制台的串口使用的是DEBUG串口,这里使用AT91SAM9261EK的开发板,Linux 内核为:Linux 3.4.9的内核(官方的)。

         内核配置是根据默认的配置修改的,去掉一些无关项。
找到Device Driver看一下串口配置:
在shell控制台里执行:
make ARCH=arm menuconfig



(1)串口的驱动,在Device Drivers --->菜单项下:



(2)串口设备属于:字符设备 Character devices --->




(3)找到串口驱动项:Serial drivers --->




(4)串口的配置正常:我这里用的是Atmel的板子。



(5)这个DMA一定要选上,因为串口设备那里选择了串口基于DMA,否则可能串口驱动不正常,并且还不打印出错的信息,让你蒙在鼓里!!!




以上配置正确后,重新编译内核:生成uImage,使用samba烧写即可。

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage


          烧写后,果然,串口终端有打印信息了,内核启动正常!!

RomBOOT




AT91Bootstrap 3.6.0 (Sat Jan 30 20:44:32 CST 2016)


NAND: Done to load image




U-Boot 2014.04 (Feb 20 2016 - 12:02:56)


CPU: AT91SAM9261
Crystal frequency:   18.432 MHz
CPU clock        :  198.656 MHz
Master clock     :   99.328 MHz
DRAM:  64 MiB
WARNING: Caches not enabled
NAND:  128 MiB
*** Warning - bad CRC, using default environment


In:    serial
Out:   serial
Err:   serial
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0 


NAND read: device 0 offset 0x200000, size 0x300000
 3145728 bytes read: OK
## Booting kernel from Legacy Image at 22000000 ...
   Image Name:   Linux-3.4.9-AT91SAM9261
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1654216 Bytes = 1.6 MiB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK


Starting kernel ...


Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.4.9-AT91SAM9261 (root@zhangsz) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #4 Sat Feb 20 12:30:17 CST 2016
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9261-EK
Memory policy: ECC disabled, Data cache writeback
AT91: Detected soc type: at91sam9261
AT91: Detected soc subtype: Unknown
AT91: sram at 0x300000 of 0x28000 mapped at 0xfef50000
Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
gpiochip_add: registered GPIOs 0 to 31 on device: pioA
gpiochip_add: registered GPIOs 32 to 63 on device: pioB
gpiochip_add: registered GPIOs 64 to 95 on device: pioC
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: mem=64M console=ttyS0,115200 mtdparts=atmel_nand:8M(bootstrap/uboot/kernel)ro,-(rootfs) root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs
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: 60900k/60900k available, 4636k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc4800000 - 0xff000000   ( 936 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc0395ee8   (3640 kB)
      .init : 0xc0396000 - 0xc03b6000   ( 128 kB)
      .data : 0xc03b6000 - 0xc03db4c0   ( 150 kB)
       .bss : 0xc03db4e4 - 0xc03eef9c   (  79 kB)
NR_IRQS:16 nr_irqs:16 16
AT91: 96 gpio irqs in 3 banks
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop... 98.71 BogoMIPS (lpj=493568)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x202c7130 - 0x202c7188
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
AT91: Power Management
AT91: Starting after general reset
bio: create slab at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-gpio i2c-gpio.0: using pins 7 (SDA) and 8 (SCL)
Switching to clocksource tcb_clksrc
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
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)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
squashfs: version 4.0 (2009/01/31) Phillip Lougher
msgmni has been set to 118
io scheduler noop registered (default)
atmel_lcdfb atmel_lcdfb.0: clut resources unusable
atmel_usart.0: ttyS0 at MMIO 0xfffff200 (irq = 17) is a ATMEL_SERIAL
console [ttyS0] enabled
brd: module loaded
ssc ssc.1: Atmel SSC device at 0xc4810000 (irq 31)
atmel_nand: Use On Flash BBT
atmel_nand atmel_nand: No DMA support for NAND access.
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
Bad eraseblock 446 at 0x0000037c0000
Bad eraseblock 994 at 0x000007c40000
Bad block table written to 0x000007fe0000, version 0x01
Bad block table written to 0x000007fc0000, version 0x01
2 cmdlinepart partitions found on MTD device atmel_nand
Creating 2 MTD partitions on "atmel_nand":
0x000000000000-0x000000800000 : "bootstrap/uboot/kernel"
0x000000800000-0x000008000000 : "rootfs"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: empty MTD device detected
UBI: max. sequence number:       0
UBI: create volume table (copy #1)
UBI: create volume table (copy #2)
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "rootfs"
UBI: MTD device size:            120 MiB
UBI: number of good PEBs:        954
UBI: number of bad PEBs:         6
UBI: number of corrupted PEBs:   0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             941
UBI: total number of reserved PEBs: 13
UBI: number of PEBs reserved for bad PEB handling: 9
UBI: max/mean erase counter: 0/0
UBI: image sequence number:  -230112458
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffc8000 (irq 28)
UBI: background thread "ubi_bgt0d" started, PID 810
atmel_spi atmel_spi.0: master is unqueued, this is deprecated
dm9000 Ethernet Driver, V1.31
dm9000 dm9000.0: eth%d: Invalid ethernet MAC address. Please set using ifconfig
eth0: dm9000a at c4804000,c4806044 IRQ 123 MAC: 86:74:e2:c9:41:58 (random)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 36, io mem 0x00500000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mousedev: PS/2 mouse device common for all mice
ads7846 spi0.2: touchscreen, irq 45
input: ADS7843 Touchscreen as /devices/platform/atmel_spi.0/spi_master/spi0/spi0.2/input/input0
rtc-at91sam9 rtc-at91sam9.0: rtc core: registered rtc-at91sam9 as rtc0
rtc-at91sam9: probe of rtc-at91sam9.0 failed with error -38
i2c /dev entries driver
at91sam9_wdt: sorry, watchdog is disabled
at91_wdt: probe of at91_wdt failed with error -5
TCP: cubic registered
NET: Registered protocol family 17
VFP support v0.3: not present
input: gpio-keys as /devices/platform/gpio-keys/input/input1
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
Please append a correct "root=" boot option; here are the available partitions:
1f00            8192 mtdblock0  (driver?)
1f01          122880 mtdblock1  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[] (unwind_backtrace+0x0/0xf4) from [] (panic+0x74/0x1bc)
[] (panic+0x74/0x1bc) from [] (mount_block_root+0x174/0x228)
[] (mount_block_root+0x174/0x228) from [] (prepare_namespace+0x8c/0x1ac)
[] (prepare_namespace+0x8c/0x1ac) from [] (kernel_init+0x164/0x1ac)
[] (kernel_init+0x164/0x1ac) from [] (kernel_thread_exit+0x0/0x8)


           总结:学习嵌入式,需要的是软件与硬件的结合,我是硬件出身,因此,出现问题,先从硬件角度去思路,也就是从硬件驱动上着手,从根本上找到为什么会这样!!



阅读(5711) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~