Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
update version to 0.9.9, have a try.
Browse files Browse the repository at this point in the history
  • Loading branch information
Espressif Systems committed Mar 31, 2015
1 parent 97a5314 commit ec75c85
Show file tree
Hide file tree
Showing 137 changed files with 2,231 additions and 55,413 deletions.
177 changes: 170 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,131 @@ ifndef PDIR

endif

AR = xt-ar
CC = xt-xcc
NM = xt-nm
CPP = xt-cpp
OBJCOPY = xt-objcopy
#MAKE = xt-make
ifeq ($(COMPILE), gcc)
AR = xtensa-lx106-elf-ar
CC = xtensa-lx106-elf-gcc
NM = xtensa-lx106-elf-nm
CPP = xtensa-lx106-elf-cpp
OBJCOPY = xtensa-lx106-elf-objcopy
OBJDUMP = xtensa-lx106-elf-objdump
else
AR = xt-ar
CC = xt-xcc
NM = xt-nm
CPP = xt-cpp
OBJCOPY = xt-objcopy
OBJDUMP = xt-objdump
endif

BOOT?=none
APP?=0
SPI_SPEED?=40
SPI_MODE?=QIO
SPI_SIZE?=512

ifeq ($(BOOT), new)
boot = new
else
ifeq ($(BOOT), old)
boot = old
else
boot = none
endif
endif

ifeq ($(APP), 1)
app = 1
else
ifeq ($(APP), 2)
app = 2
else
app = 0
endif
endif

ifeq ($(SPI_SPEED), 26.7)
freqdiv = 1
else
ifeq ($(SPI_SPEED), 20)
freqdiv = 2
else
ifeq ($(SPI_SPEED), 80)
freqdiv = 15
else
freqdiv = 0
endif
endif
endif


ifeq ($(SPI_MODE), QOUT)
mode = 1
else
ifeq ($(SPI_MODE), DIO)
mode = 2
else
ifeq ($(SPI_MODE), DOUT)
mode = 3
else
mode = 0
endif
endif
endif

# flash larger than 1024KB only use 1024KB to storage user1.bin and user2.bin
ifeq ($(SPI_SIZE), 256)
size = 1
flash = 256
else
ifeq ($(SPI_SIZE), 1024)
size = 2
flash = 1024
else
ifeq ($(SPI_SIZE), 2048)
size = 3
flash = 1024
else
ifeq ($(SPI_SIZE), 4096)
size = 4
flash = 1024
else
size = 0
flash = 512
endif
endif
endif
endif

ifeq ($(flash), 512)
ifeq ($(app), 1)
addr = 0x01000
else
ifeq ($(app), 2)
addr = 0x41000
endif
endif
else
ifeq ($(flash), 1024)
ifeq ($(app), 1)
addr = 0x01000
else
ifeq ($(app), 2)
addr = 0x81000
endif
endif
endif
endif

LD_FILE = $(LDDIR)/eagle.app.v6.ld

ifneq ($(boot), none)
ifneq ($(app),0)
LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).$(flash).app$(app).ld
BIN_NAME = user$(app).$(flash).$(boot)
endif
else
app = 0
endif

CSRCS ?= $(wildcard *.c)
ASRCs ?= $(wildcard *.s)
Expand Down Expand Up @@ -82,7 +201,51 @@ endef

$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
@mkdir -p $(BINODIR)
$(OBJCOPY) -O binary $< $@

ifeq ($(APP), 0)
@$(RM) -r ../bin/eagle.S ../bin/eagle.dump
@$(OBJDUMP) -x -s $< > ../bin/eagle.dump
@$(OBJDUMP) -S $< > ../bin/eagle.S
else
@$(RM) -r ../bin/upgrade/$(BIN_NAME).S ../bin/upgrade/$(BIN_NAME).dump
@$(OBJDUMP) -x -s $< > ../bin/upgrade/$(BIN_NAME).dump
@$(OBJDUMP) -S $< > ../bin/upgrade/$(BIN_NAME).S
endif

@$(OBJCOPY) --only-section .text -O binary $< eagle.app.v6.text.bin
@$(OBJCOPY) --only-section .data -O binary $< eagle.app.v6.data.bin
@$(OBJCOPY) --only-section .rodata -O binary $< eagle.app.v6.rodata.bin
@$(OBJCOPY) --only-section .irom0.text -O binary $< eagle.app.v6.irom0text.bin

@echo ""
@echo "!!!"

ifeq ($(app), 0)
@python ../tools/gen_appbin.py $< 0 $(mode) $(freqdiv) $(size)
@mv eagle.app.flash.bin ../bin/eagle.flash.bin
@mv eagle.app.v6.irom0text.bin ../bin/eagle.irom0text.bin
@rm eagle.app.v6.*
@echo "No boot needed."
@echo "Generate eagle.flash.bin and eagle.irom0text.bin successully in folder bin."
@echo "eagle.flash.bin-------->0x00000"
@echo "eagle.irom0text.bin---->0x40000"
else
ifeq ($(boot), new)
@python ../tools/gen_appbin.py $< 2 $(mode) $(freqdiv) $(size)
@echo "Support boot_v1.2 and +"
else
@python ../tools/gen_appbin.py $< 1 $(mode) $(freqdiv) $(size)
@echo "Support boot_v1.1 and +"
endif

@mv eagle.app.flash.bin ../bin/upgrade/$(BIN_NAME).bin
@rm eagle.app.v6.*
@echo "Generate $(BIN_NAME).bin successully in folder bin/upgrade."
@echo "boot.bin------------>0x00000"
@echo "$(BIN_NAME).bin--->$(addr)"
endif

@echo "!!!"

#############################################################
# Rules base
Expand Down
19 changes: 0 additions & 19 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ ifeq ($(FLAVOR),release)
TARGET_LDFLAGS += -g -O0
endif

LD_FILE = $(LDDIR)/eagle.app.v6.ld

ifeq ($(APP), 1)
LD_FILE = $(LDDIR)/eagle.app.v6.app1.ld
endif

ifeq ($(APP), 2)
LD_FILE = $(LDDIR)/eagle.app.v6.app2.ld
endif

COMPONENTS_eagle.app.v6 = \
user/libuser.a

Expand Down Expand Up @@ -124,15 +114,6 @@ INCLUDES := $(INCLUDES) -I $(PDIR)include
PDIR := ../$(PDIR)
sinclude $(PDIR)Makefile

#########################################################################
#
# generate bin file
#

$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
@mkdir -p $(BINODIR)
$(OBJCOPY) -O binary $< $@

.PHONY: FORCE
FORCE:

130 changes: 112 additions & 18 deletions app/gen_misc.bat
Original file line number Diff line number Diff line change
@@ -1,27 +1,121 @@
@echo off
set BACKPATH=%PATH%
set PATH=%BACKPATH%;%CD%\..\tools
@echo on

del /F ..\bin\eagle.app.v6.flash.bin ..\bin\eagle.app.v6.irom0text.bin ..\bin\eagle.app.v6.dump ..\bin\eagle.app.v6.S
echo Please follow below steps(1-5) to generate specific bin(s):
echo STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)
set input=default
set /p input=enter(0/1/2, default 2):

cd .output\eagle\debug\image
if %input% equ 0 (
set boot=old
) else (
if %input% equ 1 (
set boot=new
) else (
set boot=none
)
)

xt-objdump -x -s eagle.app.v6.out > ..\..\..\..\..\bin\eagle.app.v6.dump
xt-objdump -S eagle.app.v6.out > ..\..\..\..\..\bin\eagle.app.v6.S
echo boot mode: %boot%
echo.

xt-objcopy --only-section .text -O binary eagle.app.v6.out eagle.app.v6.text.bin
xt-objcopy --only-section .data -O binary eagle.app.v6.out eagle.app.v6.data.bin
xt-objcopy --only-section .rodata -O binary eagle.app.v6.out eagle.app.v6.rodata.bin
xt-objcopy --only-section .irom0.text -O binary eagle.app.v6.out eagle.app.v6.irom0text.bin
echo STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
set input=default
set /p input=enter (0/1/2, default 0):

gen_appbin.py eagle.app.v6.out v6
if %input% equ 1 (
if %boot% equ none (
set app=0
echo choose no boot before
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
) else (
set app=1
echo generate bin: user1.bin
)
) else (
if %input% equ 2 (
if %boot% equ none (
set app=0
echo choose no boot before
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
) else (
set app=2
echo generate bin: user2.bin
)
) else (
if %boot% neq none (
set boot=none
echo ignore boot
)
set app=0
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
))

xcopy /y eagle.app.v6.irom0text.bin ..\..\..\..\..\bin\
xcopy /y eagle.app.v6.flash.bin ..\..\..\..\..\bin\
echo.

cd ..\..\..\..\
echo STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
set input=default
set /p input=enter (0/1/2/3, default 2):

if %input% equ 0 (
set spi_speed=20
) else (
if %input% equ 1 (
set spi_speed=26.7
) else (
if %input% equ 3 (
set spi_speed=80
) else (
set spi_speed=40
)))

echo spi speed: %spi_speed% MHz
echo.

echo STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
set input=default
set /p input=enter (0/1/2/3, default 0):

if %input% equ 1 (
set spi_mode=QOUT
) else (
if %input% equ 2 (
set spi_mode=DIO
) else (
if %input% equ 3 (
set spi_mode=DOUT
) else (
set spi_mode=QIO
)))

echo spi mode: %spi_mode%
echo.

echo STEP 5: choose spi size(0=256KB, 1=512KB, 2=1024KB, 3=2048KB, 4=4096KB)
set input=default
set /p input=enter (0/1/2/3/4, default 1):

if %input% equ 0 (
set spi_size=256
) else (
if %input% equ 2 (
set spi_size=1024
) else (
if %input% equ 3 (
set spi_size=2048
) else (
if %input% equ 4 (
set spi_size=4096
) else (
set spi_size=512
))))

echo spi size: %spi_size% KB

touch user/user_main.c

echo.
echo start...
echo.

make BOOT=%boot% APP=%app% SPI_SPEED=%spi_speed% SPI_MODE=%spi_mode% SPI_SIZE=%spi_size%

@echo off
set PATH=%BACKPATH%
@echo on
Loading

0 comments on commit ec75c85

Please sign in to comment.