2015-02-06 14:35:48 +00:00
|
|
|
APP_INC = -I.
|
2017-08-11 03:22:19 +01:00
|
|
|
APP_INC += -I$(TOP)
|
2015-02-06 14:35:48 +00:00
|
|
|
APP_INC += -Ifatfs/src
|
|
|
|
APP_INC += -Ifatfs/src/drivers
|
|
|
|
APP_INC += -IFreeRTOS
|
|
|
|
APP_INC += -IFreeRTOS/Source/include
|
|
|
|
APP_INC += -IFreeRTOS/Source/portable/GCC/ARM_CM3
|
|
|
|
APP_INC += -Iftp
|
|
|
|
APP_INC += -Ihal
|
|
|
|
APP_INC += -Ihal/inc
|
|
|
|
APP_INC += -Imisc
|
|
|
|
APP_INC += -Imods
|
2017-08-11 03:22:19 +01:00
|
|
|
APP_INC += -I$(TOP)/drivers/cc3100/inc
|
2015-02-06 14:35:48 +00:00
|
|
|
APP_INC += -Isimplelink
|
|
|
|
APP_INC += -Isimplelink/oslib
|
|
|
|
APP_INC += -Itelnet
|
|
|
|
APP_INC += -Iutil
|
|
|
|
APP_INC += -Ibootmgr
|
|
|
|
APP_INC += -I$(BUILD)
|
2015-02-10 12:11:27 +00:00
|
|
|
APP_INC += -I$(BUILD)/genhdr
|
2017-09-06 05:09:13 +01:00
|
|
|
APP_INC += -I$(TOP)/ports/stm32
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
APP_CPPDEFINES = -Dgcc -DTARGET_IS_CC3200 -DSL_FULL -DUSE_FREERTOS
|
|
|
|
|
|
|
|
APP_FATFS_SRC_C = $(addprefix fatfs/src/,\
|
|
|
|
drivers/sflash_diskio.c \
|
|
|
|
drivers/sd_diskio.c \
|
|
|
|
)
|
|
|
|
|
|
|
|
APP_RTOS_SRC_C = $(addprefix FreeRTOS/Source/,\
|
|
|
|
croutine.c \
|
|
|
|
event_groups.c \
|
|
|
|
list.c \
|
|
|
|
queue.c \
|
|
|
|
tasks.c \
|
|
|
|
timers.c \
|
|
|
|
portable/GCC/ARM_CM3/port.c \
|
|
|
|
portable/MemMang/heap_4.c \
|
|
|
|
)
|
|
|
|
|
|
|
|
APP_FTP_SRC_C = $(addprefix ftp/,\
|
|
|
|
ftp.c \
|
|
|
|
updater.c \
|
|
|
|
)
|
|
|
|
|
|
|
|
APP_HAL_SRC_C = $(addprefix hal/,\
|
|
|
|
adc.c \
|
|
|
|
aes.c \
|
|
|
|
cc3200_hal.c \
|
|
|
|
cpu.c \
|
|
|
|
crc.c \
|
|
|
|
des.c \
|
|
|
|
gpio.c \
|
|
|
|
i2c.c \
|
|
|
|
i2s.c \
|
|
|
|
interrupt.c \
|
|
|
|
pin.c \
|
|
|
|
prcm.c \
|
|
|
|
sdhost.c \
|
|
|
|
shamd5.c \
|
|
|
|
spi.c \
|
|
|
|
startup_gcc.c \
|
|
|
|
systick.c \
|
|
|
|
timer.c \
|
|
|
|
uart.c \
|
|
|
|
utils.c \
|
|
|
|
wdt.c \
|
|
|
|
)
|
|
|
|
|
|
|
|
APP_MISC_SRC_C = $(addprefix misc/,\
|
2015-06-06 17:42:51 +01:00
|
|
|
antenna.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
FreeRTOSHooks.c \
|
|
|
|
help.c \
|
2015-09-22 22:20:29 +01:00
|
|
|
mpirq.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
mperror.c \
|
|
|
|
)
|
|
|
|
|
|
|
|
APP_MODS_SRC_C = $(addprefix mods/,\
|
2015-09-27 12:45:48 +01:00
|
|
|
modmachine.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
modnetwork.c \
|
2022-08-18 07:24:27 +01:00
|
|
|
modos.c \
|
|
|
|
modsocket.c \
|
|
|
|
modssl.c \
|
2015-10-14 08:46:18 +01:00
|
|
|
modwipy.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
modwlan.c \
|
2015-02-19 20:03:21 +00:00
|
|
|
pybadc.c \
|
2015-02-09 18:38:02 +00:00
|
|
|
pybpin.c \
|
2015-03-04 12:52:39 +00:00
|
|
|
pybi2c.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
pybrtc.c \
|
2017-01-29 04:15:16 +00:00
|
|
|
pybflash.c \
|
2015-02-21 13:10:33 +00:00
|
|
|
pybsd.c \
|
2015-02-27 15:50:06 +00:00
|
|
|
pybsleep.c \
|
2015-03-19 14:17:39 +00:00
|
|
|
pybspi.c \
|
2015-05-09 16:46:16 +01:00
|
|
|
pybtimer.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
pybuart.c \
|
2015-02-25 10:08:51 +00:00
|
|
|
pybwdt.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
)
|
|
|
|
|
2015-02-21 19:55:57 +00:00
|
|
|
APP_CC3100_SRC_C = $(addprefix drivers/cc3100/src/,\
|
|
|
|
device.c \
|
|
|
|
driver.c \
|
|
|
|
flowcont.c \
|
|
|
|
fs.c \
|
|
|
|
netapp.c \
|
|
|
|
netcfg.c \
|
|
|
|
socket.c \
|
|
|
|
wlan.c \
|
|
|
|
)
|
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
APP_SL_SRC_C = $(addprefix simplelink/,\
|
|
|
|
oslib/osi_freertos.c \
|
|
|
|
cc_pal.c \
|
2020-03-02 11:35:22 +00:00
|
|
|
)
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
APP_TELNET_SRC_C = $(addprefix telnet/,\
|
|
|
|
telnet.c \
|
|
|
|
)
|
2020-03-02 11:35:22 +00:00
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
APP_UTIL_SRC_C = $(addprefix util/,\
|
2015-05-19 23:23:13 +01:00
|
|
|
cryptohash.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
fifo.c \
|
|
|
|
gccollect.c \
|
|
|
|
random.c \
|
|
|
|
socketfifo.c \
|
|
|
|
)
|
2020-03-02 11:35:22 +00:00
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
APP_UTIL_SRC_S = $(addprefix util/,\
|
2020-04-23 07:12:55 +01:00
|
|
|
cortex_m3_get_sp.s \
|
2015-03-04 12:52:39 +00:00
|
|
|
sleeprestore.s \
|
2015-02-06 14:35:48 +00:00
|
|
|
)
|
2020-03-02 11:35:22 +00:00
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
APP_MAIN_SRC_C = \
|
|
|
|
main.c \
|
|
|
|
mptask.c \
|
2016-05-27 17:35:46 +01:00
|
|
|
mpthreadport.c \
|
2017-01-29 04:15:16 +00:00
|
|
|
serverstask.c \
|
|
|
|
fatfs_port.c \
|
2020-03-02 11:35:22 +00:00
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
APP_LIB_SRC_C = $(addprefix lib/,\
|
2017-01-29 04:15:16 +00:00
|
|
|
oofatfs/ff.c \
|
2019-02-25 12:46:17 +00:00
|
|
|
oofatfs/ffunicode.c \
|
2021-07-09 05:19:15 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
APP_SHARED_SRC_C = $(addprefix shared/,\
|
2015-04-10 20:02:07 +01:00
|
|
|
libc/string0.c \
|
2021-07-09 05:19:15 +01:00
|
|
|
readline/readline.c \
|
2015-05-03 19:26:08 +01:00
|
|
|
netutils/netutils.c \
|
2015-05-11 01:00:19 +01:00
|
|
|
timeutils/timeutils.c \
|
2021-07-09 05:19:15 +01:00
|
|
|
runtime/gchelper_native.c \
|
|
|
|
runtime/pyexec.c \
|
|
|
|
runtime/interrupt_char.c \
|
|
|
|
runtime/stdout_helpers.c \
|
|
|
|
runtime/sys_stdio_mphal.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
)
|
2020-03-02 11:35:22 +00:00
|
|
|
|
2017-09-06 05:09:13 +01:00
|
|
|
APP_STM_SRC_C = $(addprefix ports/stm32/,\
|
2015-02-06 14:35:48 +00:00
|
|
|
bufhelper.c \
|
|
|
|
irq.c \
|
|
|
|
)
|
|
|
|
|
|
|
|
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(APP_FATFS_SRC_C:.c=.o) $(APP_RTOS_SRC_C:.c=.o) $(APP_FTP_SRC_C:.c=.o) $(APP_HAL_SRC_C:.c=.o) $(APP_MISC_SRC_C:.c=.o))
|
2015-02-21 19:55:57 +00:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(APP_MODS_SRC_C:.c=.o) $(APP_CC3100_SRC_C:.c=.o) $(APP_SL_SRC_C:.c=.o) $(APP_TELNET_SRC_C:.c=.o) $(APP_UTIL_SRC_C:.c=.o) $(APP_UTIL_SRC_S:.s=.o))
|
2021-07-09 05:19:15 +01:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(APP_MAIN_SRC_C:.c=.o) $(APP_SHARED_SRC_C:.c=.o) $(APP_LIB_SRC_C:.c=.o) $(APP_STM_SRC_C:.c=.o))
|
2023-01-23 20:53:39 +00:00
|
|
|
OBJ += $(BUILD)/shared/runtime/gchelper_thumb2.o
|
2015-02-06 14:35:48 +00:00
|
|
|
OBJ += $(BUILD)/pins.o
|
|
|
|
|
py: Add rules for automated extraction of qstrs from sources.
- add template rule that converts a specified source file into a qstring file
- add special rule for generating a central header that contains all
extracted/autogenerated strings - defined by QSTR_DEFS_COLLECTED
variable. Each platform appends a list of sources that may contain
qstrings into a new build variable: SRC_QSTR. Any autogenerated
prerequisities are should be appened to SRC_QSTR_AUTO_DEPS variable.
- remove most qstrings from py/qstrdefs, keep only qstrings that
contain special characters - these cannot be easily detected in the
sources without additional annotations
- remove most manual qstrdefs, use qstrdef autogen for: py, cc3200,
stmhal, teensy, unix, windows, pic16bit:
- remove all micropython generic qstrdefs except for the special strings that contain special characters (e.g. /,+,<,> etc.)
- remove all port specific qstrdefs except for special strings
- append sources for qstr generation in platform makefiles (SRC_QSTR)
2016-03-10 09:22:41 +00:00
|
|
|
# List of sources for qstr extraction
|
2022-07-01 20:28:58 +01:00
|
|
|
SRC_QSTR += $(APP_MODS_SRC_C) $(APP_MISC_SRC_C) $(APP_STM_SRC_C) $(APP_SHARED_SRC_C) $(APP_HAL_SRC_C)
|
py: Add rules for automated extraction of qstrs from sources.
- add template rule that converts a specified source file into a qstring file
- add special rule for generating a central header that contains all
extracted/autogenerated strings - defined by QSTR_DEFS_COLLECTED
variable. Each platform appends a list of sources that may contain
qstrings into a new build variable: SRC_QSTR. Any autogenerated
prerequisities are should be appened to SRC_QSTR_AUTO_DEPS variable.
- remove most qstrings from py/qstrdefs, keep only qstrings that
contain special characters - these cannot be easily detected in the
sources without additional annotations
- remove most manual qstrdefs, use qstrdef autogen for: py, cc3200,
stmhal, teensy, unix, windows, pic16bit:
- remove all micropython generic qstrdefs except for the special strings that contain special characters (e.g. /,+,<,> etc.)
- remove all port specific qstrdefs except for special strings
- append sources for qstr generation in platform makefiles (SRC_QSTR)
2016-03-10 09:22:41 +00:00
|
|
|
# Append any auto-generated sources that are needed by sources listed in
|
|
|
|
# SRC_QSTR
|
|
|
|
SRC_QSTR_AUTO_DEPS +=
|
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
# Add the linker script
|
|
|
|
LINKER_SCRIPT = application.lds
|
|
|
|
LDFLAGS += -T $(LINKER_SCRIPT)
|
|
|
|
|
|
|
|
# Add the application specific CFLAGS
|
|
|
|
CFLAGS += $(APP_CPPDEFINES) $(APP_INC)
|
|
|
|
|
|
|
|
# Disable strict aliasing for the simplelink driver
|
2015-02-21 19:55:57 +00:00
|
|
|
$(BUILD)/drivers/cc3100/src/driver.o: CFLAGS += -fno-strict-aliasing
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
# Check if we would like to debug the port code
|
|
|
|
ifeq ($(BTYPE), release)
|
2016-02-21 20:05:58 +00:00
|
|
|
CFLAGS += -DNDEBUG
|
2015-02-06 14:35:48 +00:00
|
|
|
else
|
|
|
|
ifeq ($(BTYPE), debug)
|
2020-12-23 12:41:56 +00:00
|
|
|
CFLAGS += -DDEBUG
|
2015-02-06 14:35:48 +00:00
|
|
|
else
|
|
|
|
$(error Invalid BTYPE specified)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
SHELL = bash
|
|
|
|
APP_SIGN = appsign.sh
|
2015-06-24 14:23:03 +01:00
|
|
|
UPDATE_WIPY ?= tools/update-wipy.py
|
|
|
|
WIPY_IP ?= '192.168.1.1'
|
|
|
|
WIPY_USER ?= 'micro'
|
|
|
|
WIPY_PWD ?= 'python'
|
2015-02-06 14:35:48 +00:00
|
|
|
|
2023-08-24 06:44:16 +01:00
|
|
|
all: $(BUILD)/firmware.zip
|
2015-02-06 14:35:48 +00:00
|
|
|
|
2016-12-28 22:23:09 +00:00
|
|
|
.PHONY: deploy-ota
|
2015-06-24 14:23:03 +01:00
|
|
|
|
2016-12-28 22:23:09 +00:00
|
|
|
deploy-ota: $(BUILD)/mcuimg.bin
|
2015-06-24 14:23:03 +01:00
|
|
|
$(ECHO) "Writing $< to the board"
|
|
|
|
$(Q)$(PYTHON) $(UPDATE_WIPY) --verify --ip $(WIPY_IP) --user $(WIPY_USER) --password $(WIPY_PWD) --file $<
|
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
$(BUILD)/application.axf: $(OBJ) $(LINKER_SCRIPT)
|
|
|
|
$(ECHO) "LINK $@"
|
|
|
|
$(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
|
|
|
|
$(Q)$(SIZE) $@
|
|
|
|
|
|
|
|
$(BUILD)/application.bin: $(BUILD)/application.axf
|
|
|
|
$(ECHO) "Create $@"
|
|
|
|
$(Q)$(OBJCOPY) -O binary $< $@
|
|
|
|
|
2015-04-10 20:02:07 +01:00
|
|
|
$(BUILD)/mcuimg.bin: $(BUILD)/application.bin
|
2015-02-06 14:35:48 +00:00
|
|
|
$(ECHO) "Create $@"
|
2015-10-28 10:09:45 +00:00
|
|
|
$(Q)$(SHELL) $(APP_SIGN) $(BUILD)
|
2015-02-06 14:35:48 +00:00
|
|
|
|
2023-08-24 06:44:16 +01:00
|
|
|
$(BUILD)/firmware.zip: $(BUILD)/mcuimg.bin
|
|
|
|
$(ECHO) "Create $@"
|
|
|
|
$(Q)$(ZIP) -j $@ $<
|
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
MAKE_PINS = boards/make-pins.py
|
|
|
|
BOARD_PINS = boards/$(BOARD)/pins.csv
|
|
|
|
AF_FILE = boards/cc3200_af.csv
|
|
|
|
PREFIX_FILE = boards/cc3200_prefix.c
|
|
|
|
GEN_PINS_SRC = $(BUILD)/pins.c
|
|
|
|
GEN_PINS_HDR = $(HEADER_BUILD)/pins.h
|
|
|
|
GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
|
2015-02-14 15:35:29 +00:00
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
# Making OBJ use an order-only dependency on the generated pins.h file
|
|
|
|
# has the side effect of making the pins.h file before we actually compile
|
|
|
|
# any of the objects. The normal dependency generation will deal with the
|
|
|
|
# case when pins.h is modified. But when it doesn't exist, we don't know
|
|
|
|
# which source files might need it.
|
|
|
|
$(OBJ): | $(GEN_PINS_HDR)
|
|
|
|
|
|
|
|
# Call make-pins.py to generate both pins_gen.c and pins.h
|
|
|
|
$(GEN_PINS_SRC) $(GEN_PINS_HDR) $(GEN_PINS_QSTR): $(BOARD_PINS) $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) | $(HEADER_BUILD)
|
|
|
|
$(ECHO) "Create $@"
|
|
|
|
$(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) --qstr $(GEN_PINS_QSTR) > $(GEN_PINS_SRC)
|
|
|
|
|
|
|
|
$(BUILD)/pins.o: $(BUILD)/pins.c
|
|
|
|
$(call compile_c)
|