diff --git a/.travis.yml b/.travis.yml index 66276770..17bdad7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ before_install: - sudo apt-get -qq update - sudo apt-get install gcc-arm-embedded script: -- make deploy +- make -C stmbl notifications: irc: channels: diff --git a/framework/base.mak b/framework/base.mak index a7b2cff1..d7f8d369 100644 --- a/framework/base.mak +++ b/framework/base.mak @@ -85,7 +85,7 @@ LDFLAGS += -Wl,-Map=build/fw.map,--cref LDFLAGS += -Wl,--gc-sections # LDFLAGS += -specs=nano.specs -u _printf_float -u _scanf_float -LDFLAGS += -lc -specs=nosys.specs +# LDFLAGS += -lc -specs=nosys.specs LDFLAGS += -T$(LDSCRIPT) #============================================================================ diff --git a/framework/libs/CMSIS/lib.mak b/framework/libs/CMSIS/lib.mak index eeb27c58..84a5466b 100644 --- a/framework/libs/CMSIS/lib.mak +++ b/framework/libs/CMSIS/lib.mak @@ -20,14 +20,14 @@ ifneq (,$(findstring CMSIS, $(LIBS))) ifneq (,$(findstring STM32F4, $(CPU))) # cpu define - #ifneq (,$(findstring STM32F40, $(CPU))) - # CPUDEF = STM32F405xG - #endif + ifneq (,$(findstring STM32F40, $(CPU))) + CPUDEF = STM32F40_41xxx + endif # peripheral include INCDIRS := $(INCDIRS) $(LIBPATH)/Device/ST/STM32F4xx/Include - LIBSOURCES := $(LIBSOURCES) $(LIBPATH)/Device/ST/STM32F4xx/Source/system_stm32f4xx.c + #LIBSOURCES := $(LIBSOURCES) $(LIBPATH)/Device/ST/STM32F4xx/Source/system_stm32f4xx.c LIBSOURCES := $(LIBSOURCES) $(LIBPATH)/Device/ST/STM32F4xx/Source/startup_stm32f40_41xxx.s endif diff --git a/framework/libs/cmd/lib.mak b/framework/libs/cmd/lib.mak index c6f0f6c6..7c85619e 100644 --- a/framework/libs/cmd/lib.mak +++ b/framework/libs/cmd/lib.mak @@ -8,7 +8,7 @@ ifneq (,$(findstring CMD, $(LIBS))) GENINCS += build/gen/inc/commandslist.h endif -build/gen/inc/commandslist.h: $(FRAMEWORK_DIR)/tools/create_cmd.py $(SOURCES) +build/gen/inc/commandslist.h: $(FRAMEWORK_DIR)/tools/create_cmd.py $(SOURCES) $(LIBSOURCES) $(COMPS) $(SHAREDSOURCES) @echo Generating commands list @$(MKDIR) -p $(dir $@) - @$(PYTHON) $(FRAMEWORK_DIR)/tools/create_cmd.py $@ $(SOURCES) $(LIBSOURCES) $(SHAREDSOURCES) \ No newline at end of file + @$(PYTHON) $(FRAMEWORK_DIR)/tools/create_cmd.py $@ $(SOURCES) $(LIBSOURCES) $(COMPS) $(SHAREDSOURCES) \ No newline at end of file diff --git a/framework/libs/hal/lib.mak b/framework/libs/hal/lib.mak index 6ea0d40d..6c02f014 100644 --- a/framework/libs/hal/lib.mak +++ b/framework/libs/hal/lib.mak @@ -21,6 +21,7 @@ endif SRC_COMP_OBJECTS = $(subst src/comps/,,$(addprefix build/src_comps/,$(addsuffix .o,$(basename $(SRC_COMPS))))) SHARED_COMP_OBJECTS = $(subst ../shared/src/comps/,,$(addprefix build/shared_comps/,$(addsuffix .o,$(basename $(SHARED_COMPS))))) LIB_COMP_OBJECTS = $(subst ../../framework/comps/,,$(addprefix build/lib_comps/,$(addsuffix .o,$(basename $(LIB_COMPS))))) +COMPS = $(SRC_COMPS) $(SHARED_COMPS) $(LIB_COMPS) INCDIRS += $(subst ../shared/src/comps/,,$(addprefix build/gen/inc/shared_comps/,$(dir $(SHARED_COMPS)))) INCDIRS += $(subst ../../framework/comps/,,$(addprefix build/gen/inc/lib_comps/,$(dir $(LIB_COMPS)))) diff --git a/framework/libs/st_hal_f3/lib.mak b/framework/libs/st_hal_f3/lib.mak index 1ef4675e..d34c9dba 100644 --- a/framework/libs/st_hal_f3/lib.mak +++ b/framework/libs/st_hal_f3/lib.mak @@ -3,10 +3,6 @@ ifneq (,$(findstring STM32F3, $(CPU))) # lib path LIBPATH = $(FRAMEWORK_DIR)/libs/st_hal_f3 $(info using LIB: $(LIBPATH)) - # cpu define - ifneq (,$(findstring STM32F303, $(CPU))) - CPUDEF = STM32F303xC - endif # check cpu define ifeq (, $(CPUDEF)) diff --git a/framework/libs/st_spl_f4/lib.mak b/framework/libs/st_spl_f4/lib.mak index 2f7389f3..092169d9 100644 --- a/framework/libs/st_spl_f4/lib.mak +++ b/framework/libs/st_spl_f4/lib.mak @@ -6,11 +6,6 @@ ifneq (,$(findstring STM32F4, $(CPU))) CPPFLAGS += -DUSE_STDPERIPH_DRIVER - # cpu define - ifneq (,$(findstring STM32F40, $(CPU))) - CPUDEF = STM32F40_41xxx - endif - # check cpu define ifeq (, $(CPUDEF)) $(error missing CPU definition for $(CPU)) diff --git a/stmbl/f3/Makefile b/stmbl/f3/Makefile index 0fca2511..2bee5c41 100644 --- a/stmbl/f3/Makefile +++ b/stmbl/f3/Makefile @@ -9,6 +9,7 @@ ADDRESS = 0x08004000 CFLAGS += -DHAL_MAX_PINS=256 CFLAGS += -DHAL_MAX_COMPS=16 CFLAGS += -DHAL_MAX_CTX=1024 +LDFLAGS += -lc -specs=nosys.specs LIBS = ST_HAL LIBS += CMSIS diff --git a/stmbl/f4/Makefile b/stmbl/f4/Makefile index 49d51edd..4fb5a477 100644 --- a/stmbl/f4/Makefile +++ b/stmbl/f4/Makefile @@ -8,6 +8,10 @@ ADDRESS = 0x08010000 HWVERSION = v4 +CFLAGS += -DHAL_MAX_PINS=1024 +CFLAGS += -DHAL_MAX_COMPS=16 +CFLAGS += -DHAL_MAX_CTX=16384 + LIBS = ST_SPL LIBS += CMSIS LIBS += ST_USB @@ -46,6 +50,8 @@ LIB_COMPS += $(wildcard ../../framework/comps/motor_model/*.c) LIB_COMPS += $(wildcard ../../framework/comps/fb/*.c) LIB_COMPS += $(wildcard ../../framework/comps/misc/*.c) +# LIB_COMPS += $(wildcard ../../framework/comps/term.c) + INCDIRS += build/gen/inc/src_comps/hw/ ifeq ($(HWVERSION),v3) @@ -72,7 +78,10 @@ else endif -CONFIG_TEMPLATES += $(wildcard conf/template/*.txt) +CONFIG_TEMPLATES += $(wildcard ../../framework/conf/template/fb/*.txt) +CONFIG_TEMPLATES += $(wildcard ../../framework/conf/template/misc/*.txt) +CONFIG_TEMPLATES += $(wildcard ../../framework/conf/template/motor_ctr/*.txt) +CONFIG_TEMPLATES += $(wildcard ../../framework/conf/template/motor_model/*.txt) OBJECTS += ../f3/build/fw.o diff --git a/stmbl/f4/src/main.c b/stmbl/f4/src/main.c index df609086..3b9548cf 100644 --- a/stmbl/f4/src/main.c +++ b/stmbl/f4/src/main.c @@ -178,6 +178,7 @@ int main(void) { SCB->VTOR = (uint32_t)&g_pfnVectors; setup(); + hal_init(0.0002, 0.00005); // hal load comps load_comp(comp_by_name("term")); @@ -185,6 +186,7 @@ int main(void) { hal_parse("loadconf"); hal_parse("relink"); hal_parse("start"); + TIM_Cmd(TIM_MASTER, ENABLE); TIM_ITConfig(TIM_SLAVE, TIM_IT_Update, ENABLE); diff --git a/stmbl/f4/system_stm32f4xx.c b/stmbl/f4/src/system_stm32f4xx.c similarity index 100% rename from stmbl/f4/system_stm32f4xx.c rename to stmbl/f4/src/system_stm32f4xx.c