2016年5月23日 星期一

編譯問題解決: MT7620A Uboot


解決MT7620A "Uboot" 編譯問題

SDK Version: 4.3.0.0

編譯問題:ERROR: ... mkimage: invalid entry point -n


進入Uboot路徑:執行make最後要產生boot.img時產生錯誤.


./tools/mkimage -A mips -T standalone -C none \
-a 0x80200000 -e  \
-n "SPI Flash Image" \
-r DDR2 -s 16 -t 64 -u 32 \
-y 0xFF -z 0xFF -w 0xFF -d uboot.bin uboot.img
./tools/mkimage: invalid entry point -n

make: *** [uboot.img] Error 1




解決方法:


        此一錯誤是由於系統語言不是英文導致,請進入Uboot路徑;編輯Makefile;找到
mkimage ...-e $(shell readelf -h u-boot | grep "Entry" | awk '{print $$4}')                        
這一行,這就是出錯的地方.
        看看出什麼錯誤;在command line下執行: #readelf -h u-boot
Uboot# readelf -h u-boot
ELF 檔頭:
  魔術位元組:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  類別:                              ELF32
  資料:                              2 的補數,小尾序(little endian)
  版本:                              1 (current)
  OS/ABI:                            UNIX - System V
  ABI 版本:                          0
  類型:                              EXEC (可執行檔案)
  系統架構:                          MIPS R3000
  版本:                              0x1
  進入點位址:               0x80200000
  程式標頭起點:          52 (檔案內之位元組)
  區段標頭起點:          217472 (檔案內之位元組)
  旗標:             0x50001007, noreorder, pic, cpic, o32, mips32
  此標頭的大小:       52 (位元組)
  程式標頭大小:       32 (位元組)
  Number of program headers:         2
  區段標頭大小:         40 (位元組)
  區段標頭數量:         153

  字串表索引區段標頭: 150

原來是Makefile找不到”Entry“字串;將字串改成“進入點位址”再執行一次:


Uboot# readelf -h u-boot| grep '進入點位址'
  進入點位址:               0x80200000


終於找到進入點位址, 接著修改分析參數.
 awk '{print $$4}'

改成

 awk '{print $$2}'



重新編譯;終於成功了:


./tools/mkimage -A mips -T standalone -C none \
-a 0x80200000 -e 0x80200000 \
-n "SPI Flash Image" \
-r DDR2 -s 16 -t 64 -u 32 \
-y 0xFF -z 0xFF -w 0xFF -d uboot.bin uboot.img
Image Name:   SPI Flas
Created:      Mon May 23 15:33:25 2016
Image Type:   MIPS Linux Standalone Program (uncompressed)
Data Size:    88104 Bytes = 86.04 kB = 0.08 MB
Load Address: 0x80200000
Entry Point:  0x80200000
DRAM Parameter: 29 (Parm0=0 Parm1=0)

===============<<IMPORTANT>>==================
Notes:Uboot firmware in flash is uboot.img NOT uboot.bin

================================================



以上!

沒有留言:

張貼留言