Commit c091e691 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by rojer

CC3200 build cleanup; commonized fw_meta targets

Some yak shaving along the way

PUBLISHED_FROM=09c7cfbd98dcec961970dfad3f38e67912a5b06c
parent 35f633b5
# -*- mode: makefile -*-
# This file is executed inside Docker build container.
# It can be used without container too if SDK_PATH and V7_PATH are configured.
# It can be used without container too if SDK_PATH is configured.
PLATFORM = CC3200
SDK_PATH ?= /cc3200-sdk
......@@ -10,36 +10,18 @@ BUILD_DIR ?= ./build
FW_DIR ?= ./out
SLFS_PATH ?= ./slfs
BINDIR = ${FW_DIR}
OBJDIR = ${BUILD_DIR}
BINDIR = $(FW_DIR)
OBJDIR = $(BUILD_DIR)
include ${SDK_PATH}/tools/gcc_scripts/makedefs
include $(SDK_PATH)/tools/gcc_scripts/makedefs
.PHONY: all clean flash
PROG = cc3200_example
IPATH = . ../.. \
$(REPO_PATH) \
${SDK_PATH} \
${SDK_PATH}/inc \
${SDK_PATH}/driverlib \
${SDK_PATH}/oslib \
${SDK_PATH}/simplelink \
${SDK_PATH}/simplelink/include \
${SDK_PATH}/third_party/FreeRTOS/source \
${SDK_PATH}/third_party/FreeRTOS/source/include \
${SDK_PATH}/third_party/FreeRTOS/source/portable/GCC/ARM_CM4
VPATH = ../.. ${SDK_PATH}/driverlib \
${SDK_PATH}/example/common \
${SDK_PATH}/oslib \
${SDK_PATH}/simplelink \
${SDK_PATH}/simplelink/source \
${SDK_PATH}/third_party/FreeRTOS/source \
${SDK_PATH}/third_party/FreeRTOS/source/portable/GCC/ARM_CM4 \
${SDK_PATH}/third_party/FreeRTOS/source/portable/MemMang \
${COMMON_PATH}/platforms/cc3200 \
IPATH = . ../.. $(REPO_PATH)
VPATH = ../..
MONGOOSE_FEATURES = \
-DMG_CC3200 \
......@@ -60,38 +42,36 @@ MONGOOSE_FEATURES = \
SDK_FLAGS = -DTARGET_IS_CC3200 -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED
DISABLED_SDK_WARNINGS = -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable
CFLAGS += -Os -Wall -Werror \
$(SDK_FLAGS) -DCS_PLATFORM=4 -DCC3200_FS_SLFS \
${MONGOOSE_FEATURES} ${CFLAGS_EXTRA}
$(MONGOOSE_FEATURES) $(CFLAGS_EXTRA)
FW_ELF = ${FW_DIR}/${PROG}.axf
FW_BIN = ${FW_DIR}/${PROG}.bin
FW_MANIFEST = ${FW_DIR}/manifest.json
FW_ZIP = ${FW_DIR}/firmware.zip
BUILD_INFO_JSON = ${OBJDIR}/build_info.json
FW_ELF = $(FW_DIR)/$(PROG).axf
FW_BIN = $(FW_DIR)/$(PROG).bin
FW_MANIFEST = $(FW_DIR)/manifest.json
FW_ZIP = $(FW_DIR)/firmware.zip
BUILD_INFO_JSON = $(OBJDIR)/build_info.json
SLFS_FILES = $(wildcard $(SLFS_PATH)/*)
.PHONY: all clean flash
all: ${OBJDIR} ${SYS_CONFIG_C} ${FW_DIR} ${FW_ZIP}
all: $(OBJDIR) $(FW_DIR) $(FW_ZIP)
clean:
@rm -rf ${OBJDIR} ${wildcard *~}
@rm -rf ${FW_DIR} ${wildcard *~}
@rm -rf $(OBJDIR) $(wildcard *~)
@rm -rf $(FW_DIR) $(wildcard *~)
${OBJDIR}:
$(OBJDIR):
@echo " MKDIR $@"
@mkdir -p ${OBJDIR} ${FS_BUILD_DIR}
@mkdir -p $(OBJDIR) $(FS_BUILD_DIR)
${FW_DIR}:
$(FW_DIR):
@echo " MKDIR $@"
@mkdir -p ${FW_DIR}
@mkdir -p $(FW_DIR)
${FW_ZIP}: ${FW_ELF} ${FW_BIN} ${SLFS_FILES}
@echo " Code size: $(shell ls -l ${FW_BIN} | awk '{print $$5}')"
@echo " GEN ${FW_MANIFEST}"
$(FW_ZIP): $(FW_ELF) $(FW_BIN) $(SLFS_FILES)
@echo " Code size: $(shell ls -l $(FW_BIN) | awk '{print $$5}')"
@echo " GEN $(FW_MANIFEST)"
@$(COMMON_PATH)/tools/fw_meta.py gen_build_info \
--json_output=$(BUILD_INFO_JSON)
@cp -v $(SLFS_FILES) out/
......@@ -108,25 +88,33 @@ ${FW_ZIP}: ${FW_ELF} ${FW_BIN} ${SLFS_FILES}
--src_dir=$(FW_DIR) \
--output=$@
APP_OBJS = $(OBJDIR)/main.o \
${OBJDIR}/cc3200_fs.o ${OBJDIR}/cc3200_fs_slfs.o ${OBJDIR}/cc3200_libc.o \
${OBJDIR}/cc3200_socket.o \
${OBJDIR}/mongoose.o \
${OBJDIR}/startup_gcc.o \
${OBJDIR}/timers.o ${OBJDIR}/list.o ${OBJDIR}/queue.o ${OBJDIR}/tasks.o ${OBJDIR}/port.o ${OBJDIR}/heap_3.o ${OBJDIR}/osi_freertos.o \
${OBJDIR}/socket.o ${OBJDIR}/wlan.o ${OBJDIR}/driver.o ${OBJDIR}/device.o ${OBJDIR}/netapp.o ${OBJDIR}/netcfg.o ${OBJDIR}/cc_pal.o ${OBJDIR}/fs.o \
${OBJDIR}/cpu.o ${OBJDIR}/i2c.o ${OBJDIR}/interrupt.o ${OBJDIR}/pin.o ${OBJDIR}/prcm.o ${OBJDIR}/spi.o ${OBJDIR}/uart.o ${OBJDIR}/udma.o ${OBJDIR}/utils.o
CC3200_PLATFORM_SRCS = cc3200_fs.c cc3200_fs_slfs.c cc3200_libc.c cc3200_socket.c
VPATH += $(COMMON_PATH)/platforms/cc3200
FREERTOS_SRCS = timers.c list.c queue.c tasks.c port.c heap_3.c osi_freertos.c
DRIVER_SRCS = cpu.c i2c.c interrupt.c pin.c prcm.c spi.c uart.c udma.c utils.c
SL_SRCS = socket.c wlan.c driver.c device.c netapp.c netcfg.c cc_pal.c fs.c
SDK_SRCS = startup_gcc.c $(FREERTOS_SRCS) $(DRIVER_SRCS) $(SL_SRCS)
IPATH += $(SDK_PATH) $(SDK_PATH)/inc $(SDK_PATH)/driverlib $(SDK_PATH)/oslib \
$(SDK_PATH)/simplelink $(SDK_PATH)/simplelink/include \
$(SDK_PATH)/third_party/FreeRTOS/source \
$(SDK_PATH)/third_party/FreeRTOS/source/include \
$(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4
VPATH += $(SDK_PATH)/driverlib $(SDK_PATH)/example/common $(SDK_PATH)/oslib \
$(SDK_PATH)/simplelink $(SDK_PATH)/simplelink/source \
$(SDK_PATH)/third_party/FreeRTOS/source \
$(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4 \
$(SDK_PATH)/third_party/FreeRTOS/source/portable/MemMang \
APP_SRCS = main.c mongoose.c $(CC3200_PLATFORM_SRCS) $(SDK_SRCS)
APP_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(APP_SRCS)))
${FW_ELF}: ${APP_OBJS}
$(FW_ELF): $(APP_OBJS)
SCATTERgcc_${PROG} = ${PROG}.ld
ENTRY_${PROG} = ResetISR
SCATTERgcc_$(PROG) = $(PROG).ld
ENTRY_$(PROG) = ResetISR
# Target specific warning inhibitions
# Disable certain warnings on SDK sources, we have no control over them anyway.
build/wlan.o: CFLAGS += $(DISABLED_SDK_WARNINGS)
build/driver.o: CFLAGS += $(DISABLED_SDK_WARNINGS)
build/fs.o: CFLAGS += $(DISABLED_SDK_WARNINGS)
build/spi.o: CFLAGS += $(DISABLED_SDK_WARNINGS)
build/prcm.o: CFLAGS += $(DISABLED_SDK_WARNINGS)
build/spiffs_hydrogen.o: CFLAGS += -Wno-unused-function
SDK_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SDK_SRCS)))
$(SDK_OBJS): CFLAGS += -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable
......@@ -144,8 +144,7 @@ int main() {
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
//cs_log_set_level(LL_INFO);
cs_log_set_level(LL_VERBOSE_DEBUG);
cs_log_set_level(LL_INFO);
VStartSimpleLinkSpawnTask(8);
osi_TaskCreate(mg_task, (const signed char *) "mg", 8192, NULL, 3, NULL);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment