美文网首页
BeagleBone Black_SDK开发之Debian镜像烧

BeagleBone Black_SDK开发之Debian镜像烧

作者: sweetmilkcake | 来源:发表于2016-11-07 23:24 被阅读0次

    前言

    写此文章主要是为了记录自己学习elinux的过程中的一点经验,如果有错误欢迎指出,谢谢。

    环境配置

    • Win10 1607
    • BeagleBone Black Rev C
    • USB-to-Serial CH340G
    • Micro SD Card 8G

    串口是嵌入式开发必备的工具之一,没有的话可以去某宝淘一个,只要支持3.3v的就没问题。

    镜像下载

    Debian镜像地址:http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

    找到预先编译好的镜像:Flasher: (lxqt-4gb) (BeagleBone Black/Green 4GB eMMC) (注:因为我们要用SD Card来烧写EMMC,所以需要下载对应的烧写镜像)

    当前镜像地址如下:https://rcn-ee.com/rootfs/bb.org/testing/2016-10-30/lxqt-4gb/BBB-blank-debian-8.6-lxqt-4gb-armhf-2016-10-30-4gb.img.xz

    其中镜像下面有对应不同系统的烧写链接,我们选用Windows平台对应的烧写工具:http://etcher.io

    该工具使用比较简单,解压上面下载的镜像得到:BBB-blank-debian-8.6-lxqt-4gb-armhf-2016-10-30-4gb.img,选择该镜像,选择需要烧写的SD Card,点击Flash即可以完成烧写。该软件烧写完毕会弹出u盘,直接拔USB就好了。(注:请备份好SD Card里的数据)

    镜像烧写

    在镜像烧写过程中,我们可以通过串口来打印消息,获取烧写状态。

    串口调试软件putty下载地址:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

    设置界面如下:

    设置波特率为115200

    插入SD Card,串口线连接BeagleBone Black,先打开putty,然后按住板子上的boot按键,板子上电,等待4个LED轮流点亮,就可以松开boot按键。

    BeagleBone Black按住boot键后会从SD Card启动,从而调用烧脚本,烧写EMMC,等待大约40分钟,烧写完毕,BeagleBone Black会自动断电,断开电源。

    相应输出的log

    <pre>
    U-Boot SPL 2016.09-00003-gb2f9e49 (Sep 28 2016 - 10:34:21)
    Trying to boot from MMC1
    Expected Linux image is not found. Trying to start U-boot

    U-Boot 2016.09-00003-gb2f9e49 (Sep 28 2016 - 10:34:21 -0500), Build: jenkins-github_Bootloader-Builder-467

    I2C: ready
    DRAM: 512 MiB
    Reset Source: Power-on reset has occurred.
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Board: BeagleBone Black
    Net: <ethaddr> not set. Validating first E-fuse MAC
    eth0: MII MODE
    cpsw
    Press SPACE to abort autoboot in 2 seconds
    board_name=[A335BNLT] ...
    board_rev=[00C0] ...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Bad device 0:2 0x82000000 **
    ** Bad device 0:2 0x82000000 **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    gpio: pin 56 (gpio 56) value is 0
    gpio: pin 55 (gpio 55) value is 0
    gpio: pin 54 (gpio 54) value is 0
    gpio: pin 53 (gpio 53) value is 1
    switch to partitions #0, OK
    mmc0 is current device
    gpio: pin 54 (gpio 54) value is 1
    Checking for: /uEnv.txt ...
    1179 bytes read in 9 ms (127.9 KiB/s)
    gpio: pin 55 (gpio 55) value is 1
    Loaded environment from /uEnv.txt
    Importing environment from mmc ...
    Checking if uenvcmd is set ...
    gpio: pin 56 (gpio 56) value is 1
    Running uenvcmd ...
    1140 bytes read in 44 ms (24.4 KiB/s)
    debug: [/boot/vmlinuz-4.4.27-ti-r62] ...
    8640088 bytes read in 589 ms (14 MiB/s)
    debug: [/boot/initrd.img-4.4.27-ti-r62] ...
    5153757 bytes read in 362 ms (13.6 MiB/s)
    debug: [/boot/dtbs/4.4.27-ti-r62/am335x-boneblack.dtb] ...
    62069 bytes read in 124 ms (488.3 KiB/s)
    debug: [console=tty0 console=ttyO0,115200n8 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh] ...
    debug: [bootz 0x82000000 0x88080000:4ea3dd 0x88000000] ...

    Flattened Device Tree blob at 88000000

    Booting using the fdt blob at 0x88000000
    Using Device Tree in place at 88000000, end 88012274

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Initializing cgroup subsys cpuset
    [ 0.000000] Initializing cgroup subsys cpu
    [ 0.000000] Initializing cgroup subsys cpuacct
    [ 0.000000] Linux version 4.4.27-ti-r62 (root@a2-imx6q-wandboard-2gb) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP Wed Oct 26 19:27:10 UTC 2016
    [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] Machine model: TI AM335x BeagleBone Black
    [ 0.000000] cma: Reserved 48 MiB at 0x9c800000
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM335X ES2.1 (sgx neon )
    [ 0.000000] PERCPU: Embedded 13 pages/cpu @df917000 s24320 r8192 d20736 u53248
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129408
    [ 0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
    [ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    [ 0.000000] Memory: 444824K/522240K available (11353K kernel code, 916K rwdata, 3792K rodata, 748K init, 907K bss, 28264K reserved, 49152K cma-reserved, 0K highmem)
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    [ 0.000000] vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
    [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
    [ 0.000000] .text : 0xc0008000 - 0xc0ed26f4 (15146 kB)
    [ 0.000000] .init : 0xc0ed3000 - 0xc0f8e000 ( 748 kB)
    [ 0.000000] .data : 0xc0f8e000 - 0xc1073340 ( 917 kB)
    [ 0.000000] .bss : 0xc1076000 - 0xc1158fa8 ( 908 kB)
    [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [ 0.000000] Hierarchical RCU implementation.
    [ 0.000000] Build-time adjustment of leaf fanout to 32.
    [ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
    [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
    [ 0.000000] NR_IRQS:16 nr_irqs:16 16
    [ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [ 0.000017] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [ 0.000040] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [ 0.000052] OMAP clocksource: timer1 at 24000000 Hz
    [ 0.001354] clocksource_probe: no matching clocksources found
    [ 0.001569] Console: colour dummy device 80x30
    [ 0.002421] console [tty0] enabled
    ================================================================================
    ===================================分隔线========================================
    ================================================================================
    Begin: Loading essential drivers ... done.
    Begin: Running /scripts/init-premount ... done.
    Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
    Begin: Running /scripts/local-premount ... done.
    Begin: Will now check root file system ... fsck from util-linux 2.25.2
    fsck: error 2 (No such file or directory) while executing fsck.ext4 for /dev/mmcblk0p1
    fsck exited with status code 8
    done.
    Warning: File system check failed but did not detect errors
    [ 12.512414] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
    done.
    Begin: Running /scripts/local-bottom ... done.
    Begin: Running /scripts/init-bottom ... done.
    ================================================================================
    Starting eMMC Flasher from microSD media
    Version: [1.20161019: Major refactor of library]
    ================================================================================

    ================================================================================
    Prepare environment for flashing
    Starting at Sat Jan 1 00:00:10 UTC 2000


    ==> Preparing /tmp
    ==> Determining root drive
    ====> Root drive identified at /dev/mmcblk0p1
    ==> Determining boot drive
    ==> Figuring out Source and Destination devices
    ====> Source identified: [/dev/mmcblk0]
    ====> Destination identified: [/dev/mmcblk1]
    ==> Figuring out machine
    ====> Machine is TI_AM335x_BeagleBone_Black
    ====> Machine is compatible with BeagleBone Black
    ================================================================================
    5 4 3 2 1
    ================================================================================
    ===================================分隔线========================================
    ================================================================================

    [ 1325.463407] systemd-shutdown[1]: Remounting '/' read-only with options 'errors=remount-ro,data=ordered'.
    [ 1327.216090] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro,data=ordered
    [ 1327.323830] systemd-shutdown[1]: Remounting '/' read-only with options 'errors=remount-ro,data=ordered'.
    [ 1327.334555] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro,data=ordered
    [ 1327.342297] systemd-shutdown[1]: All filesystems unmounted.
    [ 1327.348021] systemd-shutdown[1]: Deactivating swaps.
    [ 1327.353501] systemd-shutdown[1]: All swaps deactivated.
    [ 1327.358944] systemd-shutdown[1]: Detaching loop devices.
    [ 1327.369826] systemd-shutdown[1]: All loop devices detached.
    [ 1327.375699] systemd-shutdown[1]: Detaching DM devices.
    [ 1327.381594] systemd-shutdown[1]: All DM devices detached.
    [ 1327.401734] systemd-shutdown[1]: Powering off.
    [ 1327.409204] musb-hdrc musb-hdrc.1.auto: remove, state 4
    [ 1327.414701] usb usb1: USB disconnect, device number 1
    [ 1327.420749] musb-hdrc musb-hdrc.1.auto: USB bus 1 deregistered
    [ 1327.430935] reboot: Power down
    [ 1327.434305] System will go to power_off state in approx. 1 second

    </pre>

    镜像验证

    让板子重新上电,验证烧写的镜像是否成功,在putty输入root登陆root用户,可以对板子进行操作。

    <pre>
    U-Boot SPL 2016.09-00002-g03e9979 (Sep 28 2016 - 10:33:38)
    Trying to boot from MMC2
    Expected Linux image is not found. Trying to start U-boot

    U-Boot 2016.09-00002-g03e9979 (Sep 28 2016 - 10:33:38 -0500), Build: jenkins-github_Bootloader-Builder-467

    I2C: ready
    DRAM: 512 MiB
    Reset Source: Power-on reset has occurred.
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Board: BeagleBone Black
    Net: <ethaddr> not set. Validating first E-fuse MAC
    eth0: MII MODE
    cpsw
    Press SPACE to abort autoboot in 2 seconds
    board_name=[A335BNLT] ...
    board_rev=[00C0] ...
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    gpio: pin 56 (gpio 56) value is 0
    gpio: pin 55 (gpio 55) value is 0
    gpio: pin 54 (gpio 54) value is 0
    gpio: pin 53 (gpio 53) value is 1
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Scanning mmc 1:1...
    gpio: pin 56 (gpio 56) value is 0
    gpio: pin 55 (gpio 55) value is 0
    gpio: pin 54 (gpio 54) value is 0
    gpio: pin 53 (gpio 53) value is 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    gpio: pin 54 (gpio 54) value is 1
    Checking for: /uEnv.txt ...
    Checking for: /boot.scr ...
    Checking for: /boot/boot.scr ...
    Checking for: /boot/uEnv.txt ...
    gpio: pin 55 (gpio 55) value is 1
    1183 bytes read in 22 ms (51.8 KiB/s)
    Loaded environment from /boot/uEnv.txt
    Checking if uname_r is set in /boot/uEnv.txt...
    gpio: pin 56 (gpio 56) value is 1
    Running uname_boot ...
    loading /boot/vmlinuz-4.4.27-ti-r62 ...
    8640088 bytes read in 576 ms (14.3 MiB/s)
    loading /boot/dtbs/4.4.27-ti-r62/am335x-boneblack.dtb ...
    62069 bytes read in 38 ms (1.6 MiB/s)
    loading /boot/initrd.img-4.4.27-ti-r62 ...
    5153757 bytes read in 353 ms (13.9 MiB/s)
    debug: [console=ttyO0,115200n8 root=UUID=6bb2f869-8c99-4715-9f6e-27c051172e3a ro rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable] ...
    debug: [bootz 0x82000000 0x88080000:4ea3dd 0x88000000] ...

    Flattened Device Tree blob at 88000000

    Booting using the fdt blob at 0x88000000
    Loading Ramdisk to 8fb15000, end 8ffff3dd ... OK
    Loading Device Tree to 8fb02000, end 8fb14274 ... OK

    Starting kernel ...

    [ 0.001350] clocksource_probe: no matching clocksources found
    [ 2.076284] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
    [ 2.263330] omap_voltage_late_init: Voltage driver support not added
    [ 2.274862] PM: Cannot get wkup_m3_ipc handle
    [ 2.386346] bone_capemgr bone_capemgr: slot #0: No cape found
    [ 2.430341] bone_capemgr bone_capemgr: slot #1: No cape found
    [ 2.474337] bone_capemgr bone_capemgr: slot #2: No cape found
    [ 2.518338] bone_capemgr bone_capemgr: slot #3: No cape found
    Loading, please wait...
    fsck: error 2 (No such file or directory) while executing fsck.ext4 for /dev/mmcblk1p1
    fsck exited with status code 8

    Debian GNU/Linux 8 beaglebone ttyS0

    BeagleBoard.org Debian Image 2016-10-30

    Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

    default username:password is [debian:temppwd]

    beaglebone login: root
    Linux beaglebone 4.4.27-ti-r62 #1 SMP Wed Oct 26 19:27:10 UTC 2016 armv7l

    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    root@beaglebone:~# ls /
    bin dev home lib media nfs-uEnv.txt proc run srv tmp var
    boot etc ID.txt lost+found mnt opt root sbin sys usr
    root@beaglebone:~#

    </pre>

    相关文章

      网友评论

          本文标题:BeagleBone Black_SDK开发之Debian镜像烧

          本文链接:https://www.haomeiwen.com/subject/kgxauttx.html