u-boot mmc 版本或稱SD卡版本, 用在NOR FLASH 是不正常或未燒錄任何東西時, SD卡開機進到 u-boot , 重新燒錄映像檔到 NOR FLASH 之用.


1. 解壓縮 u-boot
複製原始檔, 從書附光碟
DVD_DMA-6410L_21\Android 2.1\u-boot_mmc\dma6410-u-boot-1.1.6_mmc_101115.tar.bz2
解壓縮
root@ubuntu:~# tar jxvf dma6410-u-boot-1.1.6_mmc_101115.tar.bz2
進入目錄
root@ubuntu:~# cd dma6410-u-boot-1.1.6_mmc

2. 確認 Makefile 裡的 CROSS_COMPILE 巨集 (已經修改好)
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# vim Makefile
CROSS_COMPILE = /usr/local/arm/4.3.1-eabi-armv6/usr/bin/arm-linux-
export    CROSS_COMPILE

3. 加入 LD_LIBRARY_PATH 環境參數
(在新版本或 64 位元的 Ubuntu新版本的 Ubuntu,可能會有編譯錯誤的問題, 加入此參數可以修正)
修改 ~/.bashrc 加入環境參數
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# vim ~/.bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/arm/4.3.1-eabi-armv6/mpfr/lib:/usr/local/arm/4.3.1-eabi-armv6/gmp/lib:/usr/local/arm/4.3.1-eabi-armv6/lib
應用新的 ~/.bashrc
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# source ~/.bashrc
查看環境參數是否作用
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# echo $LD_LIBRARY_PATH

4. 編譯 u-boot
清除暫存檔
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# make clean
設定硬體
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# make smdk6410_config
Configuring for dmatek6410 board...
查看硬體檔
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# cat include/config.mk
查看詳細設定檔
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# vim include/configs/smdk6410.h
開始編譯
root@ubuntu:~/dma6410-u-boot-1.1.6_mmc# source build_mmc.sh (有特殊格式,不要用make)
=>編譯完成


5. u-boot_mmc.bin 燒到 SD
  (燒錄工具 DVD_DMA-6410L_21\Android 2.1\u-boot_mmc\IROM_Fusing_Tool.exe)
=>調 jumper 用此 SD 卡開機
  (5 在下, 其餘1~8都在上)

6. u-boot.bin 燒到 NORFLASH
DMA-6410L開電源後馬上按Enter進到u-boot
=> run u-boot
(當然Host上的u-boot.bintftp都要先ready)


make_u-boot_mmc.sh 編譯約1分鐘
======================
cd /root/dma6410-u-boot-1.1.6_mmc
echo "Start making u-boot_mmc:" >> ../make_u-boot_mmc.log ; date >> ../make_u-boot_mmc.log

./build_mmc.sh
echo "Stop making u-boot_mmc:" >> ../make_u-boot_mmc.log ; date >> ../make_u-boot_mmc.log
cd -

********************************
1012 03:38:29 PDT 2011
Stop making u-boot_mmc:
1012 03:39:17 PDT 2011
*******************************

copy_u-boot_mmc_image.sh
=============================
mkdir -p -v /root/image
cp -f /root/dma6410-u-boot-1.1.6_mmc/u-boot_mmc.bin /root/image


build_mmc.sh 內容
======================
#!/bin/bash

make clean
make smdk6410_config
make -j 4

if [ $? -eq 0 ]
then
    rm -f u-boot_mmc.bin
    cat u-boot.bin >> temp
    cat u-boot.bin >> temp
    split -b 256k temp
    mv xaa u-boot_256k.bin

    split -b 8k u-boot.bin
    mv xaa u-boot_8k.bin

    cat u-boot_256k.bin >> u-boot_mmc.bin
    cat u-boot_8k.bin >> u-boot_mmc.bin
   
    chmod 777 u-boot_mmc.bin
    rm -rf temp u-boot_256k.bin u-boot_8k.bin x*
fi


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 aries 的頭像
    aries

    aries's Embedded Notes

    aries 發表在 痞客邦 留言(0) 人氣()