fix gen stuff, working

This commit is contained in:
crinq
2020-10-12 17:54:43 +02:00
parent 98efef9205
commit 7d092319fc
11 changed files with 22 additions and 18 deletions

View File

@@ -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:

View File

@@ -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)
#============================================================================

View File

@@ -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

View File

@@ -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)

View File

@@ -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))))

View File

@@ -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))

View File

@@ -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))

View File

@@ -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

View File

@@ -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

View File

@@ -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);