uboot從SD卡燒寫內核和文件系統


環境:ubuntu 13.04
一、首先制作sd啟動盤:
 插入SD卡
    sudo dd iflag=dsync oflag=dsync if=tiny210v2-uboot.binof=/dev/mmcblk0 seek=1
 tiny210v2-uboot.bin來自:
  http://www.arm9home.net/read.php?tid-80476.html
二、SD卡分區
   卸載SD卡,
  sudo /sbin/fdisk /dev/mmcblk0

    如果你的SD卡上有幾個分區
    Command (mfor help): d   回車 刪除硬盤分割區屬性
    Partitionnumber (1-N):1  回車 刪除1分區,
    Command (mfor help): d   回車
    Partition number (1-N):2 回車刪除2分區
    你的SD卡里有幾個區 就一一刪除分區。 
    Command (mfor help): P 回車查看信息

    Command (m for help):n 回車

      p回車

    partition uumber(1-4):1 回車 這是選分第1個分區。
    first cylinder (1-17183,default 1):309248回車 前面預留100M左右
    Last cylinder or +size or +sizeM or +sizeK (1-17183, default17183): +400M 回車 
    同理再分一個區。
    第一個分區格式化為FAT
    Command (mfor help): t回車
    Partitionnumber (1-4): 1回車
    Hex code(type L to list codes): b 回車    這里要們要設定這個區為w95 FAT323分區。
--------------
    Command (mfor help): t 回車
    Partitionnumber (1-4): 2 回車
    Hex code(type L to list codes): 83 回車    這里要們要設定這個區為LinuxEXT3分區。 
    Command (mfor help):w 寫入退出。
三、把tiny210v2-uboot.bin和uImage復制到fat分區。
   插入到開發板上,sd啟動模式
四、燒錄到nand中
   1、燒寫uboot
   #fatload mmc 0:1 21000000tiny210v2-uboot.bin
    #nanderase.chip
    #nand write21000000 0 3eab8  (0為nand地址,3eab8為文件長度)
   2、燒寫內核
    #fatload mmc 0:1 21000000uImage
    #nand erase200000  f200000 
    #nand write21000000  200000 34cb08
  3、燒寫yaff文件系統
五、環境變量設置
  #setenv bootcmd nand read 0x20008000 0x2000000x34cb08\; bootm

 

  #saveenv
  #setenv bootargsroot=/dev/mmcblk0p2 rootfstype=ext4init=/linuxrc console=ttySAC0,115200
  #saveenv 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM