刷固件Layer1到手机FLASH(硬刷)
開頭:
注意:本文章并不是做GSM 嗅探必須的,平時我們刷機(jī)叫軟刷是刷到內(nèi)存里面的,斷電就消失了,這個是硬刷,刷到flash里面的,斷電不消失,開機(jī)就運(yùn)行的。
本文章經(jīng)過作者實測可行,這只是單個應(yīng)用程序,官方還有多個應(yīng)用程序菜單
這篇教程解釋了怎樣把應(yīng)用程序刷到C118手機(jī)里面。你一定要仔細(xì)的閱讀每一個細(xì)節(jié),否則你的手機(jī)可能會變磚。即使你遵循本教程,您可能也會變磚,如果你遇到電纜問題,弱電池或軟件故障,目前firmare還不支持電池充電功能。
總共需要三部分:
內(nèi)存布局:
- 0x000000-0x00ffff: Flash page 0
- 0x010000-0x01ffff: Flash page 1
- … more Flash pages …
- 0x800000-0x83ffff: Ram
osmocom flash 布局:
- 0x000000-0x001fff: Compal loader
- 0x002000-0x00ffff: OSMOCOM loader
- 0x010000-……..: OSMOCOM application and storage
注意:C118 bootloader和OSMOCOM loader將位于同一flash頁面!
準(zhǔn)備工作
解鎖 Osmocom loader 的flash write:
$ cd src/target/firmware/ $ edit Makefile開啟下面的編譯選項:
CFLAGS += -DCONFIG_FLASH_WRITE CFLAGS += -DCONFIG_FLASH_WRITE_LOADER更改loader
diff --git a/src/target/firmware/apps/loader/main.c b/src/target/firmware/apps/loader/main.c index 2ff6f9c..e488c98 100644 --- a/src/target/firmware/apps/loader/main.c +++ b/src/target/firmware/apps/loader/main.c @@ -438,6 +438,9 @@ static void key_handler(enum key_codes code, enum key_states state)puts("Resetting due to keypress.\n");device_reset();break; + case KEY_MENU: + device_jump((void *)0x10000); + break;default:break;}編譯
make安裝
引導(dǎo)手機(jī)到downloading 到RAM
$ cd src $ host/osmocon/osmocon -p /dev/ttyUSB0 -m c123xor target/firmware/board/compal_e88/loader.compalram.bin你將看到類似以下輸出:
Received PROMPT1 from phone, responding with CMD read_file(target/firmware/board/compal_e88/loader.compalram.bin): file_size=18436, hdr_len=4, dnload_len=18443 Received PROMPT2 from phone, starting download handle_write(): 4096 bytes (4096/18443) handle_write(): 4096 bytes (8192/18443) handle_write(): 4096 bytes (12288/18443) handle_write(): 4096 bytes (16384/18443) handle_write(): 2059 bytes (18443/18443) handle_write(): finished Received DOWNLOAD ACK from phone, your code is running now! Received DOWNLOAD ACK from phone, your code is running now!OSMOCOM Loader (revision osmocon_v0.0.0-1322-g43c588b-modified) ====================================================================== Running on compal_e88 in environment compalram Found flash of 2097152 bytes at 0x0 with 2 regions現(xiàn)在打開另一個終端
裝載loader
備份loader
$ cd src $ host/osmocon/osmoload memdump 0x000000 0x2000 compal_loader.bin測試flash:
首先我們將loader裝載到錯誤的位置,如果失敗,我們?nèi)匀贿€有原來的loader, 這樣不會把手機(jī)搞成磚.
$ host/osmocon/osmoload funlock 0x010000 0x10000 $ host/osmocon/osmoload ferase 0x010000 0x10000 $ host/osmocon/osmoload fprogram 0 0x010000 compal_loader.bin $ host/osmocon/osmoload fprogram 0 0x012000 target/firmware/board/compal_e88/loader.e88loader.bin如果上面沒有出現(xiàn)錯誤之類的,下面我們就開始動真格的了
$ host/osmocon/osmoload funlock 0x000000 0x10000 $ host/osmocon/osmoload ferase 0x000000 0x10000 $ host/osmocon/osmoload fprogram 0 0x000000 compal_loader.bin $ host/osmocon/osmoload fprogram 0 0x002000 target/firmware/board/compal_e88/loader.e88loader.bin裝載應(yīng)用程序
注意:在你把應(yīng)用程序刷到手機(jī)里面你是要看一下你刷的應(yīng)用程序的大小的,有多少你就清空多大的flash空間,我這里清空了64KB
$ host/osmocon/osmoload funlock 0x010000 0x20000 $ host/osmocon/osmoload ferase 0x010000 0x20000 $ host/osmocon/osmoload fprogram 0 0x010000 target/firmware/board/compal_e88/layer1.e88flash.bin測試
如何使用:
讓手機(jī)處于關(guān)于狀態(tài),連接后各個模塊及線路,確保能誤別出來,模塊CP2102,如圖所示:
cd src host/osmocon/osmocon -p /dev/ttyUSB0然后開機(jī),出現(xiàn)藍(lán)色空白屏幕,接著按菜單鍵,就是那個圓點(diǎn),出現(xiàn)如下圖所示表示成功
關(guān)于后面的步驟,就是其它的文章操作,一樣了,就不多講了.
本文轉(zhuǎn)自 K1two2 博客園博客,原文鏈接:http://www.cnblogs.com/k1two2/p/5310892.html??,如需轉(zhuǎn)載請自行聯(lián)系原作者
總結(jié)
以上是生活随笔為你收集整理的刷固件Layer1到手机FLASH(硬刷)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: IP编址的概述
- 下一篇: 关于SWT中的布局Layout