文章目录
  1. 1. ADB常用操作、fasboot烧写
    1. 1.1. 常用ADB操作
    2. 1.2. ADB安装、卸载命令
    3. 1.3. fastboot烧写Android
    4. 1.4. 制作可以烧写的TF卡
  2. 2. 烧写Ubuntu
  3. 3. fdisk -c 0 2700 300 300
  4. 4. fatformat mmc 0:1
  5. 5. ext3format mmc 0:2
  6. 6. ext3format mmc 0:3
  7. 7. ext3format mmc 0:4
  8. 8. sdfuse flash bootloader u-boot-iTOP-4412.bin
  9. 9. sdfuse flash kernel zImage_sd
  10. 10. reset
    1. 10.0.1. TF卡分区格式化Log
      1. 10.0.1.1. EMMC分区log
      2. 10.0.1.2. 烧写uboot与zImage_sd的日志
  • 11. 搭建最小系统
  • red alert

    2016-4-16 周六;

    ADB常用操作、fasboot烧写

    安装USB驱动(Android adb驱动)

    常用ADB操作

    1. 准备好platform-tools基本工具

      注意如果platform-tools文件夹下的cmd.exe运行报错的话,请将宿主机的cmd.exe覆盖即可

    2. 启动开发板,连接OTG,打开cmd.exe,使用adb命令对开发板进行操作。

    • 帮助命令

      adb  services

    • 查找设备命令

      adb   devices

    1
    2
    3
    E:\T\platform-tools>adb devices
    List of devices attached
    0123456789ABCDEF device
    • 登入Android的shell命令

      adb   shell

      返回使用exit命令


    ADB安装、卸载命令

    • 安装应用

      adb install   <软件名>

      安装之后会在Android的data/data下创建应用的包名com. example. hello

    1
    2
    3
    4
    5
    6
    E:\T\platform-tools>adb install hello.apk
    2248 KB/s (833416 bytes in 0.361s)
    pkg: /data/local/tmp/hello.apk
    Success

    E:\T\platform-tools>
    • 卸载应用

      adb uninstall 
      应用的包名是com. example. hello

    1
    2
    3
    4
    E:\T\platform-tools>adb uninstall com.example.hello
    Success

    E:\T\platform-tools>
    • 从电脑上发送文件到设备

      新建一个有内容的takethat.txt文档,方便测试

      adb push  <本地路径> <远程路径>

    1
    2
    3
    4
    E:\T\platform-tools>adb push takethat.txt /data/data
    69 KB/s (284 bytes in 0.003s)

    E:\T\platform-tools>
    • 从设备上下载文件到电脑

      adb pull <开发板上文件路径> <目标电脑路径>

    便于测试,先删除电脑上takethat.txt文档

    1
    2
    3
    4
    E:\T\platform-tools>adb pull /data/data/takethat.txt
    50 KB/s (284 bytes in 0.005s)

    E:\T\platform-tools>

    fastboot烧写Android

    注意烧写android和烧写QtE文件是一样的

    HyperTerminal波特率设置

    设备管理器波特率设置

    从光盘拷贝出1.文件系统ramdisk-uboot.img、 system.img、  Uboot镜像u-boot-iTOP-4412.bin 内核镜像 zImageplatform-tools文件夹下

    通电启动开发板,在HyperTerminal立即敲击回车键进入uboot (没有启动android、内核)

    1
    iTOP-4412 # 
    1. 分区、格式化

    分区

    fdisk -c 0

    1
    2
    3
    4
    5
    6
    7
    8
    9
    iTOP-4412 # fdisk -c 0
    .fdisk is completed

    partion # size(MB) block start # block count partition_Id
    1 1340 4862616 2744544 0x0C
    2 1026 37290 2103156 0x83
    3 1026 2140446 2103156 0x83
    4 302 4243602 619014 0x83
    iTOP-4412 #

    格式化

    setp 1:  # fatformat mmc 0:1

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    iTOP-4412 # fatformat mmc 0:1
    Start format MMC&d partition&d ...
    Partition1: Start Address(0x4a3298), Size(0x29e0e0)
    ................................size checking ...
    Under 8G
    write FAT info: 32
    Fat size : 0xa78
    ..Erase FAT region.................................................................
    .................................................................................................................................................................................................................................................................................................................
    .Partition1 format complete.
    iTOP-4412 #

    step 2:   # ext3format mmc 0:2

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    iTOP-4412 # ext3format mmc 0:2
    Start format MMC0 partition2 ....
    ** Partition2 is not ext2 file-system 0 **
    Partition2: Start Address(0x91aa), Size(0x201774)
    Start ext2format...
    Wirte 0/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x91aa
    ....................................................................Erase inode table(0) - 0x93ca..................
    ...............d_indirect_point:0xc2aa
    ..Wirte 1/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x491aa
    ....Erase inode table(1) - 0x493ca..................
    Wirte 2/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x891aa
    ..Erase inode table(2) - 0x891ba..................
    Wirte 3/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0xc91aa
    ....Erase inode table(3) - 0xc93ca..................
    Wirte 4/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x1091aa
    ..Erase inode table(4) - 0x1091ba..................
    Wirte 5/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x1491aa
    ....Erase inode table(5) - 0x1493ca..................
    Wirte 6/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x1891aa
    ..Erase inode table(6) - 0x1891ba..................
    Wirte 7/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x1c91aa
    ....Erase inode table(7) - 0x1c93ca..................
    Wirte 8/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x2091aa
    ..Erase inode table(8) - 0x2091ba..................
    iTOP-4412 #

    setp 3 # ext3format mmc 0:3

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    iTOP-4412 # ext3format mmc 0:3                     
    Start format MMC0 partition3 ....
    ** Partition3 is not ext2 file-system 0 **
    Partition3: Start Address(0x20a91e), Size(0x201774)
    Start ext2format...
    Wirte 0/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x20a91e
    ....................................................................Erase inode table(0) - 0x20ab3e..................
    ...............d_indirect_point:0x20da1e
    ..Wirte 1/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x24a91e
    ....Erase inode table(1) - 0x24ab3e..................
    Wirte 2/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x28a91e
    ..Erase inode table(2) - 0x28a92e..................
    Wirte 3/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x2ca91e
    ....Erase inode table(3) - 0x2cab3e..................
    Wirte 4/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x30a91e
    ..Erase inode table(4) - 0x30a92e..................
    Wirte 5/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x34a91e
    ....Erase inode table(5) - 0x34ab3e..................
    Wirte 6/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x38a91e
    ..Erase inode table(6) - 0x38a92e..................
    Wirte 7/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x3ca91e
    ....Erase inode table(7) - 0x3cab3e..................
    Wirte 8/9block-group
    Reserved blocks for jounaling : 8202
    Start write addr : 0x40a91e
    ..Erase inode table(8) - 0x40a92e..................
    iTOP-4412 #

    step4:# ext3format mmc 0:4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    iTOP-4412 # ext3format mmc 0:4
    Start format MMC0 partition4 ....
    ** Partition4 is not ext2 file-system 0 **
    Partition4: Start Address(0x40c092), Size(0x97206)
    Start ext2format...
    Wirte 0/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x40c092
    ......................Erase inode table(0) - 0x40c142............................
    ...........d_indirect_point:0x40fb12
    ..Wirte 1/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x44c092
    ....Erase inode table(1) - 0x44c142............................
    Wirte 2/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x48c092
    ..Erase inode table(2) - 0x48c0a2............................

    连接:

    fastboot

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    iTOP-4412 # fastboot                                         
    [Partition table on MoviNAND]
    ptn 0 name='bootloader' start=0x0 len=N/A (use hard-coded info. (cmd: movi))
    ptn 1 name='kernel' start=N/A len=N/A (use hard-coded info. (cmd: movi))
    ptn 2 name='ramdisk' start=N/A len=0x300000(~3072KB) (use hard-coded info. (cmd: movi))
    ptn 3 name='Recovery' start=N/A len=0x600000(~6144KB) (use hard-coded info. (cmd: movi))
    ptn 4 name='system' start=0x1235400 len=0x402EE800(~1051578KB)
    ptn 5 name='userdata' start=0x41523C00 len=0x402EE800(~1051578KB)
    ptn 6 name='cache' start=0x81812400 len=0x12E40C00(~309507KB)
    ptn 7 name='fat' start=0x94653000 len=0x53C1C000(~1372272KB)
    Insert a OTG cable into the connector!

    platform-tools文件夹下运行cmd.exe

    • 烧写uboot(由于已经烧写,则跳过)

      fastboot.exe  bootloader  u-boot-iTOP-4412.bin

    • 烧写zImage内核命令

      fastboot.exe  flash  kernel   zImage

      注意串口不能被其他手机助手软件占用

      1
      2
      3
      4
      5
      6
      E:\T\platform-tools>fastboot.exe flash kernel zimage
      sending 'kernel' (3903 KB)...
      OKAY [ 0.584s]
      writing 'kernel'...
      OKAY [ 0.403s]
      finished. total time: 0.988s
    • 烧写ramdisk

      fastboot.exe  flash ramdisk ramdisk-uboot.img

    1
    2
    3
    4
    5
    6
    7
    8
    E:\T\platform-tools>fastboot.exe flash  ramdisk ramdisk-uboot.img
    sending 'ramdisk' (900 KB)...
    OKAY [ 0.144s]
    writing 'ramdisk'...
    OKAY [ 0.081s]
    finished. total time: 0.225s

    E:\T\platform-tools>
    • 烧写system文件系统

      fastboot.exe flash system system.img

      烧写时间稍微长一点可通过HyperTerminal观察

    1
    2
    3
    4
    5
    6
    7
    8
    E:\T\platform-tools>fastboot.exe flash system system.img
    sending 'system' (220323 KB)...
    OKAY [ 32.547s]
    writing 'system'...
    OKAY [ 32.626s]
    finished. total time: 65.174s

    E:\T\platform-tools>
    • 输入擦除命令(擦除android用户文件)

      fastboot -w

    1
    2
    3
    4
    5
    6
    E:\T\platform-tools>fastboot -w
    erasing 'userdata'...
    OKAY [ 1.948s]
    erasing 'cache'...
    OKAY [ 0.966s]
    finished. total time: 2.915s
    • 重启开发板
      1
      2
      3
      4
      E:\T\platform-tools>fastboot reboot
      rebooting...

      finished. total time: 0.003s

    第一次Android启动需要解压和安装一些初始化文件,花费时间上一些。

    1
    2
    [   51.926556] acc_open
    [ 51.927284] acc_release

    表明android起来了


    制作可以烧写的TF卡

    TF卡烧写方式可以烧写Android系统和Qt系统


    烧写Ubuntu

    预备:

    插入TF卡到开发板上,进入UBOOT模式即

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    In:    serial
    Out: serial
    Err: serial
    eMMC OPEN Success.!!
    !!!Notice!!!
    !You must close eMMC boot Partition after all image writing!
    !eMMC boot partition has continuity at image writing time.!
    !So, Do not close boot partition, Before, all images is written.!

    MMC read: dev # 0, block # 48, count 16 ...16 blocks read: OK
    eMMC CLOSE Success.!!


    Checking Boot Mode ... EMMC4.41
    SYSTEM ENTER NORMAL BOOT MODE
    Hit any key to stop autoboot: 0
    iTOP-4412 #
    iTOP-4412 #

    Uboot版本

    1
    2
    3
    iTOP-4412 # version                                                

    U-Boot 2010.03-dirty (Nov 13 2015 - 02:04:01) for iTOP-4412 Android

    TF卡进行分区格式化:

    1. iTOP-4412 # fdisk -c 1 2700 50 50

      格式大小为2.7G、50M、50M

    2. iTOP-4412 # fatformat mmc 1:1

    iTOP-4412 # ext3format mmc 1:2

    操作完后TF卡只剩下 11.6G,格式为FAT32

    在PC上的ubuntu识别TF卡分区

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    topeet@ubuntu:~$ df -l
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/sda1 60894268 9292296 48508724 17% /
    udev 1747508 4 1747504 1% /dev
    tmpfs 702712 852 701860 1% /run
    none 5120 0 5120 0% /run/lock
    none 1756776 152 1756624 1% /run/shm
    /dev/sdc3 49584 4140 42884 9% /media/48037b11-e7dd-53aa-85b8-b8c6ead456a1
    /dev/sdc4 49584 4140 42884 9% /media/b980254d-585b-c427-f635-620295108e60
    /dev/sdc2 2721368 69664 2513464 3% /media/fbeb2efa-9ac6-ccd4-ffe2-6baf9ebd0a8a
    /dev/sdc1 12220736 24 12220712 1% /media/0000-3333
    1. ubuntu文件系统拷贝到PC下的ubuntu内,并拷贝到TF卡内

      1
      root@ubuntu:/home/topeet# cp -r iTOP4412_ubuntu_12.04_for_HDMI_20141230.tar.gz  /media/fbeb2efa-9ac6-ccd4-ffe2-6baf9ebd0a8a/

      主要拷贝错误的位置,请拷贝到2.7G里,可以执行df -m以MB查看空间

      如何少写完程序,开发板老是重新启动 很有可能是这部操作错误

    2. 直接在TF卡目录下解压

      1
      root@ubuntu:/media/fbeb2efa-9ac6-ccd4-ffe2-6baf9ebd0a8a# tar -vxf iTop4412_Kernel_3.0_20150403.tar.gz
    3. 将TF卡插入PC宿主系统上将
      iTOP4412_ubuntu_12.04_for_HDMI_20141230.tar 、  u-boot-iTOP-4412.bin  zImage zImage_sd拷贝到TF卡上新建的F:\sdupdate


    给EMMC分区

    将TF卡插入开发板上并进入UBOOT模式

    1. fdisk -c 0 2700 300 300

    2. fatformat mmc 0:1

    3. ext3format mmc 0:2

    4. ext3format mmc 0:3

    5. ext3format mmc 0:4


    分区后烧写uboot和zImage_sd

    1. sdfuse flash bootloader u-boot-iTOP-4412.bin

    2. sdfuse flash kernel zImage_sd

    3. reset

    重启命令


    在超级中断进入ubuntu:进入MMC中的sdupdate文件中

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    root@iTOP4412-ubuntu-desktop:~# df -l
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/root 2721368 2026316 556812 79% /
    none 323312 4 323308 1% /dev
    none 64664 684 63980 2% /run
    none 5120 0 5120 0% /run/lock
    none 323312 24 323288 1% /run/shm
    /dev/mmcblk0p1 398208 4 398204 1% /media/0000-3333
    /dev/mmcblk1p1 12220736 524216 11696520 5% /media/0000-3333_
    /dev/mmcblk0p3 299780 16576 267732 6% /media/83ffefcb-22da-c864-fa72-2c81994dcb5b
    /dev/mmcblk1p4 49584 4140 42884 9% /media/b980254d-585b-c427-f635-620295108e60
    /dev/mmcblk1p3 49584 4140 42884 9% /media/48037b11-e7dd-53aa-85b8-b8c6ead456a1
    /dev/mmcblk0p2 2723396 69664 2515388 3% /media/a7da13a7-46b5-b281-e48f-505c836ab578
    /dev/mmcblk0p4 299780 16576 267732 6% /media/0aaa3cb8-6fc6-db92-475f-796de6391848

    如果没有/media挂在,请重复执行df -l刷新查看

    迅速查找相关文件

    1
    2
    3
    root@iTOP4412-ubuntu-desktop:/media# find / -name iT*
    /iTOP4412_ubuntu_12.04_for_LCD_20141230.tar.gz
    /media/0000-3333_/sdupdate/iTOP4412_ubuntu_12.04_for_LCD_20141230.tar.gz

    将sdupdate下的iTOP4412_ubuntu_12.04_for_LCD_20141230.tar.gz拷贝到2.7G的eMMC

    1
    /dev/mmcblk0p2   2723396   69664   2515388   3% /media/a7da13a7-46b5-b281-e48f-505c836ab578

    并解压

    重新启动后进入uboot模式下

    再烧写

    1
    iTOP-4412 # sdfuse flash kernel zImage

    重启后
    就完全把ubuntu烧写到eMMC下了。

    TF卡分区格式化Log

    1. iTOP-4412 # fdisk -c 1 2700 50 50

      1
      2
      3
      4
      5
      6
      7
      8
      iTOP-4412 # fdisk -c 1 2700 50 50
      .fdisk is completed

      partion # size(MB) block start # block count partition_Id
      1 11946 5767168 24465408 0x0C
      2 2700 32768 5529600 0x83
      3 50 5562368 102400 0x83
      4 50 5664768 102400 0x83
    2. fatformat mmc 1:1

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      iTOP-4412 # fatformat mmc 1:1
      Start format MMC&d partition&d ...
      Partition1: Start Address(0x580000), Size(0x1755000)
      ................................size checking ...
      Under 16G
      write FAT info: 32
      Fat size : 0x2eaa
      ..Erase FAT region.................................................................................................
      ...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
      .Partition1 format complete.
    3. ext3format mmc 1:2

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      68
      69
      70
      71
      72
      73
      74
      75
      76
      77
      78
      79
      80
      81
      82
      83
      84
      85
      86
      87
      88
      89
      90
      91
      92
      93
      94
      95
      iTOP-4412 # ext3format mmc 1:2
      Start format MMC1 partition2 ....
      ** Partition2 is not ext2 file-system 1 **
      Partition2: Start Address(0x8000), Size(0x546000)
      Start ext2format...
      Wirte 0/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x8000
      ...................................................................................................................
      .........................................................Erase inode table(0) - 0x8560....................
      ........................d_indirect_point:0xb550
      ..Wirte 1/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x48000
      ....Erase inode table(1) - 0x48560....................
      Wirte 2/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x88000
      ..Erase inode table(2) - 0x88010....................
      Wirte 3/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0xc8000
      ....Erase inode table(3) - 0xc8560....................
      Wirte 4/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x108000
      ..Erase inode table(4) - 0x108010....................
      Wirte 5/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x148000
      ....Erase inode table(5) - 0x148560....................
      Wirte 6/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x188000
      ..Erase inode table(6) - 0x188010....................
      Wirte 7/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x1c8000
      ....Erase inode table(7) - 0x1c8560....................
      Wirte 8/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x208000
      ..Erase inode table(8) - 0x208010....................
      Wirte 9/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x248000
      ....Erase inode table(9) - 0x248560....................
      Wirte 10/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x288000
      ..Erase inode table(10) - 0x288010....................
      Wirte 11/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x2c8000
      ..Erase inode table(11) - 0x2c8010....................
      Wirte 12/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x308000
      ..Erase inode table(12) - 0x308010....................
      Wirte 13/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x348000
      ..Erase inode table(13) - 0x348010....................
      Wirte 14/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x388000
      ..Erase inode table(14) - 0x388010....................
      Wirte 15/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x3c8000
      ..Erase inode table(15) - 0x3c8010....................
      Wirte 16/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x408000
      ..Erase inode table(16) - 0x408010....................
      Wirte 17/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x448000
      ..Erase inode table(17) - 0x448010....................
      Wirte 18/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x488000
      ..Erase inode table(18) - 0x488010....................
      Wirte 19/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x4c8000
      ..Erase inode table(19) - 0x4c8010....................
      Wirte 20/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x508000
      ..Erase inode table(20) - 0x508010....................
      Wirte 21/22block-group
      Reserved blocks for jounaling : 16402
      Start write addr : 0x548000
      ..Erase inode table(21) - 0x548010....................

    EMMC分区log

    fdisk -c 0 2700 300 300

    1
    2
    3
    4
    5
    6
    7
    iTOP-4412 # fdisk -c 0 2700 300 300
    .fdisk is completed

    partion # size(MB) block start # block count partition_Id
    1 389 6809154 798006 0x0C
    2 2702 37290 5533836 0x83
    3 302 5571126 619014 0x83

    fatformat mmc 0:1

    1
    2
    3
    4
    5
    6
    7
    8
    9
       iTOP-4412 # fatformat mmc 0:1
    Start format MMC&d partition&d ...
    Partition1: Start Address(0x67e642), Size(0xc2d36)
    ................................size checking ...
    Under 8G
    write FAT info: 32
    Fat size : 0x30b
    ..Erase FAT region............................................................................................................
    .Partition1 format complete.

    ext3format mmc 0:2

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    iTOP-4412 # ext3format mmc 0:2           
    Start format MMC0 partition2 ....
    ** Partition2 is not ext2 file-system 0 **
    Partition2: Start Address(0x91aa), Size(0x54708c)
    Start ext2format...
    Wirte 0/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x91aa
    ............................................................................................................................................................................Erase inode table(0) - 0x970a....................
    ........................d_indirect_point:0xc702
    ..Wirte 1/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x491aa
    ....Erase inode table(1) - 0x4970a....................
    Wirte 2/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x891aa
    ..Erase inode table(2) - 0x891ba....................
    Wirte 3/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0xc91aa
    ....Erase inode table(3) - 0xc970a....................
    Wirte 4/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x1091aa
    ..Erase inode table(4) - 0x1091ba....................
    Wirte 5/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x1491aa
    ....Erase inode table(5) - 0x14970a....................
    Wirte 6/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x1891aa
    ..Erase inode table(6) - 0x1891ba....................
    Wirte 7/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x1c91aa
    ....Erase inode table(7) - 0x1c970a....................
    Wirte 8/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x2091aa
    ..Erase inode table(8) - 0x2091ba....................
    Wirte 9/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x2491aa
    ....Erase inode table(9) - 0x24970a....................
    Wirte 10/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x2891aa
    ..Erase inode table(10) - 0x2891ba....................
    Wirte 11/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x2c91aa
    ..Erase inode table(11) - 0x2c91ba....................
    Wirte 12/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x3091aa
    ..Erase inode table(12) - 0x3091ba....................
    Wirte 13/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x3491aa
    ..Erase inode table(13) - 0x3491ba....................
    Wirte 14/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x3891aa
    ..Erase inode table(14) - 0x3891ba....................
    Wirte 15/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x3c91aa
    ..Erase inode table(15) - 0x3c91ba....................
    Wirte 16/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x4091aa
    ..Erase inode table(16) - 0x4091ba....................
    Wirte 17/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x4491aa
    ..Erase inode table(17) - 0x4491ba....................
    Wirte 18/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x4891aa
    ..Erase inode table(18) - 0x4891ba....................
    Wirte 19/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x4c91aa
    ..Erase inode table(19) - 0x4c91ba....................
    Wirte 20/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x5091aa
    ..Erase inode table(20) - 0x5091ba....................
    Wirte 21/22block-group
    Reserved blocks for jounaling : 16402
    Start write addr : 0x5491aa
    ..Erase inode table(21) - 0x5491ba....................

    ext3format mmc 0:3

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    iTOP-4412 # ext3format mmc 0:3   
    Start format MMC0 partition3 ....
    ** Partition3 is not ext2 file-system 0 **
    Partition3: Start Address(0x550236), Size(0x97206)
    Start ext2format...
    Wirte 0/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x550236
    ......................Erase inode table(0) - 0x5502e6............................
    ...........d_indirect_point:0x553cb6
    ..Wirte 1/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x590236
    ....Erase inode table(1) - 0x5902e6............................
    Wirte 2/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x5d0236
    ..Erase inode table(2) - 0x5d0246...........................

    ext3format mmc 0:4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    iTOP-4412 # ext3format mmc 0:4 
    Start format MMC0 partition4 ....
    ** Partition4 is not ext2 file-system 0 **
    Partition4: Start Address(0x5e743c), Size(0x97206)
    Start ext2format...
    Wirte 0/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x5e743c
    ......................Erase inode table(0) - 0x5e74ec............................
    ...........d_indirect_point:0x5eaebc
    ..Wirte 1/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x62743c
    ....Erase inode table(1) - 0x6274ec............................
    Wirte 2/3block-group
    Reserved blocks for jounaling : 4102
    Start write addr : 0x66743c
    ..Erase inode table(2) - 0x66744c...........................

    烧写uboot与zImage_sd的日志

    sdfuse flash bootloader u-boot-iTOP-4412.bin

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    iTOP-4412 # sdfuse flash bootloader u-boot-iTOP-4412.bin
    SD sclk_mmc is 400K HZ
    SD sclk_mmc is 50000K HZ
    SD sclk_mmc is 50000K HZ
    [Fusing Image from SD Card.]
    [Partition table on MoviNAND]
    ptn 0 name='bootloader' start=0x0 len=N/A (use hard-coded info. (cmd: movi))
    ptn 1 name='kernel' start=N/A len=N/A (use hard-coded info. (cmd: movi))
    ptn 2 name='ramdisk' start=N/A len=0x300000(~3072KB) (use hard-coded info. (cmd: movi))
    ptn 3 name='Recovery' start=N/A len=0x600000(~6144KB) (use hard-coded info. (cmd: movi))
    ptn 4 name='system' start=0x1235400 len=0xA8E11800(~2766918KB)
    ptn 5 name='userdata' start=0xAA046C00 len=0x12E40C00(~309507KB)
    ptn 6 name='cache' start=0xBCE87800 len=0x12E40C00(~309507KB)
    ptn 7 name='fat' start=0xCFCC8400 len=0x185A6C00(~399003KB)
    Partition: bootloader, File: /sdupdate/u-boot-iTOP-4412.bin
    Partition1: Start Address(0x580000), Size(0x1755000)
    reading /sdupdate/u-boot-iTOP-4412.bin
    454656 (0x0006f000) bytes read
    flashing 'bootloader'
    writing bootloader.. 0, 1038
    eMMC OPEN Success.!!
    !!!Notice!!!
    !You must close eMMC boot Partition after all image writing!
    !eMMC boot partition has continuity at image writing time.!
    !So, Do not close boot partition, Before, all images is written.!

    MMC write: dev # 0, block # 0, count 1038. 1038 blocks write finish
    1038 blocks verify1: OK
    eMMC CLOSE Success.!!
    completed
    partition 'bootloader' flashed

    sdfuse flash kernel zImage_sd

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    iTOP-4412 # sdfuse flash kernel zImage_sd
    SD sclk_mmc is 400K HZ
    SD sclk_mmc is 50000K HZ
    SD sclk_mmc is 50000K HZ
    [Fusing Image from SD Card.]
    [Partition table on MoviNAND]
    ptn 0 name='bootloader' start=0x0 len=N/A (use hard-coded info. (cmd: movi))
    ptn 1 name='kernel' start=N/A len=N/A (use hard-coded info. (cmd: movi))
    ptn 2 name='ramdisk' start=N/A len=0x300000(~3072KB) (use hard-coded info. (cmd: movi))
    ptn 3 name='Recovery' start=N/A len=0x600000(~6144KB) (use hard-coded info. (cmd: movi))
    ptn 4 name='system' start=0x1235400 len=0xA8E11800(~2766918KB)
    ptn 5 name='userdata' start=0xAA046C00 len=0x12E40C00(~309507KB)
    ptn 6 name='cache' start=0xBCE87800 len=0x12E40C00(~309507KB)
    ptn 7 name='fat' start=0xCFCC8400 len=0x185A6C00(~399003KB)
    Partition: kernel, File: /sdupdate/zImage_sd
    Partition1: Start Address(0x580000), Size(0x1755000)
    reading /sdupdate/zImage_sd
    4009704 (0x003d2ee8) bytes read
    flashing 'kernel'
    writing kernel.. 1120, 12288
    MMC write: dev # 0, block # 1120, count 12288. 12288 blocks write finish
    12288 blocks written: OK
    completed
    partition 'kernel' flashed

    搭建最小系统

    配置Busybox

    1. 进入配置busybox界面
      在ubuntu新建一个目录,将busybox拷贝进去,并解压
      1
      root@ubuntu:~/busybox# tar -vxf busybox-1.22.1.tar.bz2

    执行

    1
    root@ubuntu:~/busybox/busybox-1_25_0# make menuconfig

    进入配置busybox的界面

    1. 配置编译器

    make menuconfig

    Busybox Settings —>Cross Compiler prefix —>arm-none-linux-gnueabi-

    1. 配置二进制文件安装目录

    Installation Options (“make install” behavior) —> (./_install) BusyBox installation prefix (NEW) —>../system

    在SecurtCRT按键盘CTRL+backspace即可删除字符

    退出并保存

    1. 编译和安装Busybox

    先确认 宿主linux是编译器是arm-

    1
    root@ubuntu:~# vi .bashrc
    1
    export PATH=$PATH:/usr/local/arm/arm-2009q3/bin

    执行make编译Busybox

    注意使用busybox-1_25_0.tar.gz作为编译,可能会报错

    1
    2
    3
    4
    5
    6
    miscutils/nandwrite.c: In function 'nandwrite_main':
    miscutils/nandwrite.c:151: error: 'MTD_FILE_MODE_RAW' undeclared (first use in this function)
    miscutils/nandwrite.c:151: error: (Each undeclared identifier is reported only once
    miscutils/nandwrite.c:151: error: for each function it appears in.)
    make[1]: *** [miscutils/nandwrite.o] Error 1
    make: *** [miscutils] Error 2
    1. 安装

      1
      #make install

      返回上一级则有system这个文件

    2. 继续完善最小系统
      在system目录下新建文件夹

      1
      root@ubuntu:~/busybox/system# mkdir dev etc lib mnt proc sys tmp var

    在etc目录里下新建文件夹

    1
    root@ubuntu:~/busybox/system/etc# make init.d rc.d

    在新创建的文件init.d继续再次创建文件夹

    1
    root@ubuntu:~/busybox/system/etc/rc.d# mkdir init.d

    返回system目录下进入var目录再新建文件夹

    1
    root@ubuntu:~/busybox/system/var# mkdir lib lock log run tmp

    将eth0-setting passwd profile三个文件拷贝进去,将文件的权限改为755

    1
    root@ubuntu:~/busybox/system/etc# chmod 755 eth0-setting  passwd  profile 

    进入system目录下的etc目录里将 将ifconfig-eth0和rcS两个文件拷贝进去,将文件的权限改为755。

    进入 etc/rc.d/init.d目录

    • 将netd文件拷贝进去,将文件的权限改为755

    返回到system目录下,进入lib文件夹下将编译器的库文件复制到该目录下:

    1
    root@ubuntu:~/busybox/system/lib# cp /usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/libc/lib/* ./

    用打包工具使用make_ext4fs打包成二进制文件

    1
    root@ubuntu:~/busybox# make_ext4fs -s -l 314572800 -a root -L linux system.img system

    生成了img文件。

    开始烧写最小系统

    1.

    文章目录
    1. 1. ADB常用操作、fasboot烧写
      1. 1.1. 常用ADB操作
      2. 1.2. ADB安装、卸载命令
      3. 1.3. fastboot烧写Android
      4. 1.4. 制作可以烧写的TF卡
    2. 2. 烧写Ubuntu
    3. 3. fdisk -c 0 2700 300 300
    4. 4. fatformat mmc 0:1
    5. 5. ext3format mmc 0:2
    6. 6. ext3format mmc 0:3
    7. 7. ext3format mmc 0:4
    8. 8. sdfuse flash bootloader u-boot-iTOP-4412.bin
    9. 9. sdfuse flash kernel zImage_sd
    10. 10. reset
      1. 10.0.1. TF卡分区格式化Log
        1. 10.0.1.1. EMMC分区log
        2. 10.0.1.2. 烧写uboot与zImage_sd的日志
  • 11. 搭建最小系统