diff --git a/Makefile b/Makefile index 6984e4ea..171d666e 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,7 @@ endef $(BINODIR)/%.bin: $(IMAGEODIR)/%.out @mkdir -p $(BINODIR) - $(OBJCOPY) -O binary $< $@ + ../tools/esptool.py elf2image $< -o $(BINODIR)/ ############################################################# # Rules base diff --git a/app/Makefile b/app/Makefile index 84a5f424..e498fada 100644 --- a/app/Makefile +++ b/app/Makefile @@ -159,8 +159,10 @@ sinclude $(PDIR)Makefile $(BINODIR)/%.bin: $(IMAGEODIR)/%.out @mkdir -p $(BINODIR) - $(OBJCOPY) -O binary $< $@ + ../tools/esptool.py elf2image $< -o $(BINODIR)/ + +flash: + ../tools/esptool.py write_flash 0x00000 $(BINODIR)/0x00000.bin 0x10000 $(BINODIR)/0x10000.bin .PHONY: FORCE FORCE: - diff --git a/app/flash.bat b/app/flash.bat deleted file mode 100644 index 1b9e927b..00000000 --- a/app/flash.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off -set BACKPATH=%PATH% -set PATH=%BACKPATH%;%CD%\..\tools -@echo on - -rem gen_misc.bat -rem eagle.app.v6.flash.bin: 0x00000 -rem eagle.app.v6.irom0text.bin: 0x10000 -rem esp_init_data_default.bin: 0x7c000 -rem blank.bin: 0x7e000 - -cd ..\bin -esptool.py -p com1 write_flash 0x00000 eagle.app.v6.flash.bin 0x10000 eagle.app.v6.irom0text.bin 0x7c000 esp_init_data_default.bin 0x7e000 blank.bin -echo ************************* flash end ************************************* -cd ..\app - -@echo off -set PATH=%BACKPATH% -@echo on diff --git a/app/flash.sh b/app/flash.sh deleted file mode 100644 index 3ed9dffa..00000000 --- a/app/flash.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -x -### gen_misc.sh -### eagle.app.v6.flash.bin: 0x00000 -### eagle.app.v6.irom0text.bin: 0x10000 -### esp_init_data_default.bin: 0x7c000 -### blank.bin: 0x7e000 - -cd ../bin -../../../../../tools/esptool.py --port /dev/ttyUSB0 write_flash 0x00000 eagle.app.v6.flash.bin 0x10000 eagle.app.v6.irom0text.bin 0x7c000 esp_init_data_default.bin 0x7e000 blank.bin -echo "************************* flash end *************************************" -cd ../app diff --git a/app/gen_misc.bat b/app/gen_misc.bat deleted file mode 100644 index 6e8052a9..00000000 --- a/app/gen_misc.bat +++ /dev/null @@ -1,41 +0,0 @@ -@echo off -set BACKPATH=%PATH% -set PATH=%BACKPATH%;%CD%\..\tools -@echo on - -make %1 - -del /F ..\bin\eagle.app.v6.flash.bin ..\bin\eagle.app.v6.irom0text.bin ..\bin\eagle.app.v6.dump ..\bin\eagle.app.v6.S - -cd .output\eagle\debug\image - -@echo off -set OBJDUMP=xt-objdump -set OBJCOPY=xt-objcopy -if defined XTENSA_CORE ( - set OBJDUMP=xt-objdump - set OBJCOPY=xt-objcopy -) else ( - set OBJDUMP=xtensa-lx106-elf-objdump - set OBJCOPY=xtensa-lx106-elf-objcopy -) -@echo on - -%OBJDUMP% -x -s eagle.app.v6.out > ..\..\..\..\..\bin\eagle.app.v6.dump -%OBJDUMP% -S eagle.app.v6.out > ..\..\..\..\..\bin\eagle.app.v6.S - -%OBJCOPY% --only-section .text -O binary eagle.app.v6.out eagle.app.v6.text.bin -%OBJCOPY% --only-section .data -O binary eagle.app.v6.out eagle.app.v6.data.bin -%OBJCOPY% --only-section .rodata -O binary eagle.app.v6.out eagle.app.v6.rodata.bin -%OBJCOPY% --only-section .irom0.text -O binary eagle.app.v6.out eagle.app.v6.irom0text.bin - -gen_appbin.py eagle.app.v6.out v6 - -xcopy /y eagle.app.v6.irom0text.bin ..\..\..\..\..\bin\ -xcopy /y eagle.app.v6.flash.bin ..\..\..\..\..\bin\ - -cd ..\..\..\..\ - -@echo off -set PATH=%BACKPATH% -@echo on diff --git a/app/gen_misc.sh b/app/gen_misc.sh deleted file mode 100755 index 6ddf62af..00000000 --- a/app/gen_misc.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -x -make -if [ $? == 0 ];then -rm ../bin/eagle.app.v6.flash.bin ../bin/eagle.app.v6.irom0text.bin ../bin/eagle.app.v6.dump ../bin/eagle.app.v6.S - -cd .output/eagle/debug/image - -xtensa-lx106-elf-objdump -x -s eagle.app.v6.out > ../../../../../bin/eagle.app.v6.dump -xtensa-lx106-elf-objdump -S eagle.app.v6.out > ../../../../../bin/eagle.app.v6.S - -xtensa-lx106-elf-objcopy --only-section .text -O binary eagle.app.v6.out eagle.app.v6.text.bin -xtensa-lx106-elf-objcopy --only-section .data -O binary eagle.app.v6.out eagle.app.v6.data.bin -xtensa-lx106-elf-objcopy --only-section .rodata -O binary eagle.app.v6.out eagle.app.v6.rodata.bin -xtensa-lx106-elf-objcopy --only-section .irom0.text -O binary eagle.app.v6.out eagle.app.v6.irom0text.bin - -../../../../../tools/gen_appbin.py eagle.app.v6.out v6 - -cp eagle.app.v6.irom0text.bin ../../../../../bin/ -cp eagle.app.v6.flash.bin ../../../../../bin/ - -cd ../../../../../ - -else -echo "make error" -fi diff --git a/app/gen_misc_plus.bat b/app/gen_misc_plus.bat deleted file mode 100644 index 6331ebdd..00000000 --- a/app/gen_misc_plus.bat +++ /dev/null @@ -1,41 +0,0 @@ -@echo off -set BACKPATH=%PATH% -set PATH=%BACKPATH%;%CD%\..\tools -@echo on - -make APP=$1 - -rm ..\bin\upgrade\%1.bin - -cd .output\eagle\debug\image\ - -@echo off -set OBJDUMP=xt-objdump -set OBJCOPY=xt-objcopy -if defined XTENSA_CORE ( - set OBJDUMP=xt-objdump - set OBJCOPY=xt-objcopy -) else ( - set OBJDUMP=xtensa-lx106-elf-objdump - set OBJCOPY=xtensa-lx106-elf-objcopy -) -@echo on - -%OBJCOPY% --only-section .text -O binary eagle.app.v6.out eagle.app.v6.text.bin -%OBJCOPY% --only-section .data -O binary eagle.app.v6.out eagle.app.v6.data.bin -%OBJCOPY% --only-section .rodata -O binary eagle.app.v6.out eagle.app.v6.rodata.bin -%OBJCOPY% --only-section .irom0.text -O binary eagle.app.v6.out eagle.app.v6.irom0text.bin - -gen_appbin.py eagle.app.v6.out v6 - -gen_flashbin.py eagle.app.v6.flash.bin eagle.app.v6.irom0text.bin - -cp eagle.app.flash.bin %1.bin - -xcopy /y %1.bin ..\..\..\..\..\bin\upgrade\ - -cd ..\..\..\..\ - -@echo off -set PATH=%BACKPATH% -@echo on \ No newline at end of file diff --git a/app/gen_misc_plus.sh b/app/gen_misc_plus.sh deleted file mode 100755 index 8e1c5b43..00000000 --- a/app/gen_misc_plus.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -x -touch user/user_main.c -make APP=$1 -if [ $? == 0 ];then -rm ../bin/upgrade/user$1.bin ../bin/upgrade/user$1.dump ../bin/upgrade/user$1.S - -cd .output/eagle/debug/image/ - -xtensa-lx106-elf-objdump -x -s eagle.app.v6.out > ../../../../../bin/upgrade/user$1.dump -xtensa-lx106-elf-objdump -S eagle.app.v6.out > ../../../../../bin/upgrade/user$1.S - -xtensa-lx106-elf-objcopy --only-section .text -O binary eagle.app.v6.out eagle.app.v6.text.bin -xtensa-lx106-elf-objcopy --only-section .data -O binary eagle.app.v6.out eagle.app.v6.data.bin -xtensa-lx106-elf-objcopy --only-section .rodata -O binary eagle.app.v6.out eagle.app.v6.rodata.bin -xtensa-lx106-elf-objcopy --only-section .irom0.text -O binary eagle.app.v6.out eagle.app.v6.irom0text.bin - -../../../../../tools/gen_appbin.py eagle.app.v6.out v6 - -../../../../../tools/gen_flashbin.py eagle.app.v6.flash.bin eagle.app.v6.irom0text.bin - -cp eagle.app.flash.bin user$1.bin -cp user$1.bin ../../../../../bin/upgrade/ - -cd ../../../../../ - -else -echo "make error" -fi diff --git a/tools/esptool.py b/tools/esptool.py old mode 100644 new mode 100755 diff --git a/tools/gen_appbin.py b/tools/gen_appbin.py deleted file mode 100755 index f3820c09..00000000 --- a/tools/gen_appbin.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2010 Espressif System -# -# grab user_start() address and pass it to genflashbin program -# - -import string -import sys -import os -import re - -if len(sys.argv) != 3: - print 'Usage: gen_appbin.py eagle.app.out version' - sys.exit(0) - -elf_file = sys.argv[1] -ver = sys.argv[2] -#print elf_file - -if os.getenv('XTENSA_CORE')=='lx106': - cmd = 'xt-nm -g ' + elf_file + ' > eagle.app.sym' -else: - cmd = 'xtensa-lx106-elf-nm -g ' + elf_file + ' > eagle.app.sym' -#print cmd -os.system(cmd) - -fp = file('./eagle.app.sym') -if fp is None: - print "open sym file error\n" - exit - -lines = fp.readlines() - -fp.close() - -entry_addr = None -p = re.compile('(\w*)(\sT\s)(call_user_start)$') -for line in lines: - m = p.search(line) - if m != None: - entry_addr = m.group(1) - #entry_addr = int(entry_addr, 16) - print entry_addr - -if entry_addr is None: - print 'no entry point!!' - exit - -data_start_addr = '0' -p = re.compile('(\w*)(\sA\s)(_data_start)$') -for line in lines: - m = p.search(line) - if m != None: - data_start_addr = m.group(1) - print data_start_addr - -rodata_start_addr = '0' -p = re.compile('(\w*)(\sA\s)(_rodata_start)$') -for line in lines: - m = p.search(line) - if m != None: - rodata_start_addr = m.group(1) - print rodata_start_addr - -if os.getenv('XTENSA_CORE')=='lx106': - cmd = 'genflashbin%s eagle.app.%s.text.bin '%(ver, ver)+entry_addr+' eagle.app.%s.data.bin '%(ver)+ data_start_addr+' eagle.app.%s.rodata.bin '%(ver)+rodata_start_addr -else: - cmd = 'genflashbin%s eagle.app.%s.text.bin '%(ver, ver)+entry_addr+' eagle.app.%s.data.bin '%(ver)+ data_start_addr+' eagle.app.%s.rodata.bin '%(ver)+rodata_start_addr - -print cmd -os.system(cmd) - -cmd = 'mv eagle.app.flash.bin eagle.app.%s.flash.bin'%(ver) - -print cmd -os.system(cmd) diff --git a/tools/gen_flashbin.py b/tools/gen_flashbin.py deleted file mode 100755 index 0f8f92ba..00000000 --- a/tools/gen_flashbin.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/python -import os -import sys -import binascii -import string - -if len(sys.argv) != 3: - print 'Usage: gen_flashbin.py 1.bin 2.bin' - sys.exit(0) - -bin1_name = sys.argv[1] -bin2_name = sys.argv[2] - -bin1_file = open(bin1_name, 'rb') -bin2_file = open(bin2_name, 'rb') - -bin1_len = os.path.getsize(bin1_name) - -bin1 = bin1_file.read() -bin2 = bin2_file.read() - -bitlist = ['FF']*(0x10000-bin1_len) -bytes = binascii.a2b_hex(''.join(bitlist)) - -bitout = open('eagle.app.flash.bin', 'wb') -bitout.write(bin1) -bitout.write(bytes) -bitout.write(bin2) -bitout.close() - -bin1_file.close() -bin2_file.close() - diff --git a/tools/genflashbinv6.exe b/tools/genflashbinv6.exe deleted file mode 100644 index 0e1e1d36..00000000 Binary files a/tools/genflashbinv6.exe and /dev/null differ