mirror of
https://github.com/rene-dev/stmbl.git
synced 2026-02-05 18:01:21 +08:00
fix gen stuff, working
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
#============================================================================
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
@$(PYTHON) $(FRAMEWORK_DIR)/tools/create_cmd.py $@ $(SOURCES) $(LIBSOURCES) $(COMPS) $(SHAREDSOURCES)
|
||||
@@ -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))))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user