2015年8月14日金曜日

OS-XでESP8266開発環境その2

前回作ったSDKの環境でbuildしていきます。
# cd ~/ESP8266/esp_iot_sdk_v1.2.0
# cp -r examples/at/ .
# cd at
scriptの属性を実行可能に修正
# chmod +x gen_misc.sh
# ./gen_misc.sh
gen_misc.sh version 20150511

Please follow below steps(1-5) to generate specific bin(s):
STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)
enter(0/1/2, default 2):
1 <---最初にfirmware updateで使用したイメージと同じものを選択
boot mode: new

STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
enter (0/1/2, default 0):
1 <---ここも最初にfirmware updateで使用したイメージと同じものを選択
generate bin: user1.bin

STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
enter (0/1/2/3, default 2):
2 <---defaultを選択
spi speed: 40 MHz

STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
enter (0/1/2/3, default 0):
0 <---defaultを選択
spi mode: QIO

STEP 5: choose spi size and map
    0= 512KB( 256KB+ 256KB)
    2=1024KB( 512KB+ 512KB)
    3=2048KB( 512KB+ 512KB)
    4=4096KB( 512KB+ 512KB)
    5=2048KB(1024KB+1024KB)
    6=4096KB(1024KB+1024KB)
enter (0/2/3/4/5/6, default 0):
2 <---ここも最初にfirmware updateで使用したイメージと同じものを選択
spi size: 1024KB
spi ota map:  512KB + 512KB


start...

DEPEND: xtensa-lx106-elf-gcc -M -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -DAT_UPGRADE_SUPPORT -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c
xtensa-lx106-elf-gcc -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections  -DICACHE_FLASH -DAT_UPGRADE_SUPPORT   -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle  -o .output/eagle/debug/obj/user_main.o -c user_main.c
xtensa-lx106-elf-ar ru .output/eagle/debug/lib/libuser.a .output/eagle/debug/obj/user_main.o 
xtensa-lx106-elf-gcc  -L../lib -nostdlib -T../ld/eagle.app.v6.new.1024.app1.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lmain -ljson -lupgrade -lsmartconfig user/.output/eagle/debug/lib/libuser.a -lat -Wl,--end-group -o .output/eagle/debug/image/eagle.app.v6.out 

!!!
Support boot_v1.2 and +
Generate user1.1024.new.2.bin successully in folder bin/upgrade.
boot.bin------------>0x00000
user1.1024.new.2.bin--->0x01000
!!!

これで../bin/upgradeに
user1.4096.new.4.S 逆アセンブルコード
user1.4096.new.4.bin 書き込みイメージ
user1.4096.new.4.dump シンボル情報
が出来上がります。

# cd ../bin

基板のIO0のスイッチをUART書き込み側に倒してリセットします。

# esptool.py -p /dev/cu.usbserial-A101JG84 write_flash -fs 32m 0x00000 boot_v1.4\(b1\).bin 0x1000 upgrade/user1.1024.new.2.bin                                   
Connecting...
Erasing flash...
Writing at 0x00000800... (100 %)
Erasing flash...
Writing at 0x00040800... (100 %)

Leaving...

基板のIO0のスイッチを通常モードに戻してリセットします。
# jerm -b 115200 -r rntn /dev/cu.usbserial-A101JG84
を起動してATコマンドでバージョンを確認
AT+GMR
AT version:0.30.0.0(Jul  3 2015 19:35:49)
SDK version:1.2.0
compile time:Jul 25 2015 10:44:06
OK
ちゃんと更新されて動いているようです。

0 件のコメント:

コメントを投稿