Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
32ea83c2
Commit
32ea83c2
authored
Jan 10, 2015
by
Peter Magnusson
Browse files
adjustments for esptool.py.
Can now do make && make flash directly from root.
parent
2709258c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
32ea83c2
...
@@ -29,7 +29,7 @@ ifeq ($(OS),Windows_NT)
...
@@ -29,7 +29,7 @@ ifeq ($(OS),Windows_NT)
CPP
=
xtensa-lx106-elf-cpp
CPP
=
xtensa-lx106-elf-cpp
OBJCOPY
=
xtensa-lx106-elf-objcopy
OBJCOPY
=
xtensa-lx106-elf-objcopy
endif
endif
FIRMWAREDIR
=
..
\\
bin
\\
ESPPORT
=
com1
ifeq
($(PROCESSOR_ARCHITECTURE),AMD64)
ifeq
($(PROCESSOR_ARCHITECTURE),AMD64)
# ->AMD64
# ->AMD64
endif
endif
...
@@ -39,13 +39,13 @@ ifeq ($(OS),Windows_NT)
...
@@ -39,13 +39,13 @@ ifeq ($(OS),Windows_NT)
else
else
# We are under other system, may be Linux. Assume using gcc.
# We are under other system, may be Linux. Assume using gcc.
# Can we use -fdata-sections?
# Can we use -fdata-sections?
ESPPORT
=
/dev/ttyUSB0
CCFLAGS
+=
-Os
-ffunction-sections
-fno-jump-tables
CCFLAGS
+=
-Os
-ffunction-sections
-fno-jump-tables
AR
=
xtensa-lx106-elf-ar
AR
=
xtensa-lx106-elf-ar
CC
=
xtensa-lx106-elf-gcc
CC
=
xtensa-lx106-elf-gcc
NM
=
xtensa-lx106-elf-nm
NM
=
xtensa-lx106-elf-nm
CPP
=
xtensa-lx106-elf-cpp
CPP
=
xtensa-lx106-elf-cpp
OBJCOPY
=
xtensa-lx106-elf-objcopy
OBJCOPY
=
xtensa-lx106-elf-objcopy
FIRMWAREDIR
=
../bin/
UNAME_S
:=
$(
shell
uname
-s
)
UNAME_S
:=
$(
shell
uname
-s
)
ifeq
($(UNAME_S),Linux)
ifeq
($(UNAME_S),Linux)
# LINUX
# LINUX
...
@@ -65,6 +65,8 @@ else
...
@@ -65,6 +65,8 @@ else
endif
endif
endif
endif
#############################################################
#############################################################
ESPTOOL
=
python ../tools/esptool.py
FIRMWAREDIR
=
../bin/
CSRCS
?=
$(
wildcard
*
.c
)
CSRCS
?=
$(
wildcard
*
.c
)
ASRCs
?=
$(
wildcard
*
.s
)
ASRCs
?=
$(
wildcard
*
.s
)
...
@@ -137,7 +139,7 @@ endef
...
@@ -137,7 +139,7 @@ endef
$(BINODIR)/%.bin
:
$(IMAGEODIR)/%.out
$(BINODIR)/%.bin
:
$(IMAGEODIR)/%.out
@
mkdir
-p
$(BINODIR)
@
mkdir
-p
$(BINODIR)
../tools/esptool.py
elf2image
$<
-o
$(FIRMWAREDIR)
$(ESPTOOL)
elf2image
$<
-o
$(FIRMWAREDIR)
/
#############################################################
#############################################################
# Rules base
# Rules base
...
@@ -154,6 +156,13 @@ clobber: $(SPECIAL_CLOBBER)
...
@@ -154,6 +156,13 @@ clobber: $(SPECIAL_CLOBBER)
$(
foreach
d,
$(SUBDIRS)
,
$(MAKE)
-C
$(d)
clobber
;
)
$(
foreach
d,
$(SUBDIRS)
,
$(MAKE)
-C
$(d)
clobber
;
)
$(RM)
-r
$(ODIR)
$(RM)
-r
$(ODIR)
flash
:
ifndef
PDIR
$(MAKE)
-C
./app flash
else
$(ESPTOOL)
--port
$(ESPPORT)
write_flash 0x00000
$(FIRMWAREDIR)
/0x00000.bin 0x10000
$(FIRMWAREDIR)
/0x10000.bin
endif
.subdirs
:
.subdirs
:
@
set
-e
;
$(
foreach
d,
$(SUBDIRS)
,
$(MAKE)
-C
$(d)
;
)
@
set
-e
;
$(
foreach
d,
$(SUBDIRS)
,
$(MAKE)
-C
$(d)
;
)
...
...
app/Makefile
View file @
32ea83c2
...
@@ -152,23 +152,6 @@ INCLUDES += -I ./
...
@@ -152,23 +152,6 @@ INCLUDES += -I ./
PDIR
:=
../
$(PDIR)
PDIR
:=
../
$(PDIR)
sinclude
$(PDIR)Makefile
sinclude
$(PDIR)Makefile
#########################################################################
#
# generate bin file
#
ifeq
($(OS),Windows_NT)
PORT
=
com1
else
PORT
=
/dev/ttyUSB0
endif
$(BINODIR)/%.bin
:
$(IMAGEODIR)/%.out
@
mkdir
-p
$(BINODIR)
../tools/esptool.py elf2image
$<
-o
$(FIRMWAREDIR)
flash
:
../tools/esptool.py
-p
$(PORT)
write_flash 0x00000 ../bin/0x00000.bin 0x10000 ../bin/0x10000.bin
.PHONY
:
FORCE
.PHONY
:
FORCE
FORCE
:
FORCE
:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment