From: Mart Lubbers Date: Mon, 3 Apr 2017 11:57:25 +0000 (+0200) Subject: separate in directories X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=2e196d4e484c3945f7e6bd1c680a2021613bece7;p=mTask.git separate in directories --- diff --git a/.gitmodules b/.gitmodules index 5195bdd..2ee1383 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,5 +2,5 @@ path = CleanSerial url = https://gitlab.science.ru.nl/mlubbers/CleanSerial [submodule "int/ChibiOS"] - path = client/ChibiOS + path = client/stm32/ChibiOS url = https://github.com/ChibiOS/ChibiOS.git diff --git a/client/Makefile b/client/Makefile index 3e2db2e..652910b 100644 --- a/client/Makefile +++ b/client/Makefile @@ -1,235 +1,4 @@ -############################################################################## -# Build global options -# NOTE: Can be overridden externally. -# - -# Compiler options here. -ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -endif - -# C specific options here (added to USE_OPT). -ifeq ($(USE_COPT),) - USE_COPT = -endif - -# C++ specific options here (added to USE_OPT). -ifeq ($(USE_CPPOPT),) - USE_CPPOPT = -fno-rtti -endif - -# Enable this if you want the linker to remove unused code and data -ifeq ($(USE_LINK_GC),) - USE_LINK_GC = yes -endif - -# Linker extra options here. -ifeq ($(USE_LDOPT),) - USE_LDOPT = -endif - -# Enable this if you want link time optimizations (LTO) -ifeq ($(USE_LTO),) - USE_LTO = yes -endif - -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - -# Enable this if you want to see the full log while compiling. -ifeq ($(USE_VERBOSE_COMPILE),) - USE_VERBOSE_COMPILE = no -endif - -# If enabled, this option makes the build process faster by not compiling -# modules not used in the current configuration. -ifeq ($(USE_SMART_BUILD),) - USE_SMART_BUILD = yes -endif - -# -# Build global options -############################################################################## - -############################################################################## -# Architecture or project specific options -# - -# Stack size to be allocated to the Cortex-M process stack. This stack is -# the stack used by the main() thread. -ifeq ($(USE_PROCESS_STACKSIZE),) - USE_PROCESS_STACKSIZE = 0x400 -endif - -# Stack size to the allocated to the Cortex-M main/exceptions stack. This -# stack is used for processing interrupts and exceptions. -ifeq ($(USE_EXCEPTIONS_STACKSIZE),) - USE_EXCEPTIONS_STACKSIZE = 0x400 -endif - -# Enables the use of FPU (no, softfp, hard). -ifeq ($(USE_FPU),) - USE_FPU = no -endif - -# FPU-related options. -ifeq ($(USE_FPU_OPT),) - USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv5-d16 -endif - -# -# Architecture or project specific options -############################################################################## - -############################################################################## -# Project, sources and paths -# - -# Define project name here -PROJECT = mTask - -# Imported source files and paths -CHIBIOS = ./ChibiOS -# Startup files. -include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk -# HAL-OSAL files (optional). -include $(CHIBIOS)/os/hal/hal.mk -include $(CHIBIOS)/os/hal/ports/STM32/STM32F7xx/platform.mk -include $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.mk -include $(CHIBIOS)/os/hal/osal/rt/osal.mk -# RTOS files (optional). -include $(CHIBIOS)/os/rt/rt.mk -include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk -# Other files (optional). -include $(CHIBIOS)/test/rt/test.mk - -# Define linker script file here -LDSCRIPT= $(STARTUPLD)/STM32F76xxI.ld - -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(STARTUPSRC) \ - $(KERNSRC) \ - $(PORTSRC) \ - $(OSALSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(TESTSRC) \ - $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ - $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ - $(filter-out interface_linux.c,$(wildcard *.c)) - -# C++ sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) - -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m7 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -AR = $(TRGT)ar -OD = $(TRGT)objdump -SZ = $(TRGT)size -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Werror - -# Define C++ warning options here -CPPWARN = -Wall -Wextra -Wundef - -# -# Compiler settings -############################################################################## - -############################################################################## -# Start of user section -# - -# List all user C define here, like -D_DEBUG=1 -UDEFS = -DSTM #-DDEBUG - -# Define ASM defines here -UADEFS = - -# List all user directories here -UINCDIR = - -# List the user directory to look for the libraries here -ULIBDIR = - -# List all user libraries here -ULIBS = - -# End of user defines -############################################################################## - -RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC -include $(RULESPATH)/rules.mk - -flash: build/$(PROJECT).bin - sudo `which openocd` \ - -f interface/stlink-v2-1.cfg\ - -c "transport select hla_swd"\ - -f target/stm32f7x.cfg \ - -c init\ - -c "reset halt"\ - -c "flash write_image erase "$<" 0x08000000"\ - -c "reset run"\ - -c shutdown +all: + make -C nodemcu + make -C stm32 + make -C linux diff --git a/client/Makefile.NodeMCU b/client/Makefile.NodeMCU deleted file mode 100644 index 09c18bf..0000000 --- a/client/Makefile.NodeMCU +++ /dev/null @@ -1,21 +0,0 @@ -CC = xtensa-lx106-elf-gcc -CFLAGS = -DNODEMCU -I. -mlongcalls -Wall -Wextra -Werror -DDEBUG -LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -lc -Wl,--end-group -lgcc -I/home/mrl/projects/esp-open-sdk/sdk/include -L/home/mrl/projects/esp-open-sdk/sdk/lib -LDFLAGS = -Teagle.app.v6.ld - -OBJS:=interpret.o sds.o task.o main.o interface.o spec.o - -main-0x00000.bin: main - esptool.py elf2image $^ - -main: $(OBJS) - $(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) $(OUTPUT_OPTION) - -interface.o: interface_nodemcu.c - $(CC) $(CFLAGS) -c $< -o $@ - -#FLASh: %-0x00000.bin -# esptool.py write_flash 0 blinky-0x00000.bin 0x40000 blinky-0x40000.bin - -clean: - $(RM) main $(OBJS) diff --git a/client/Makefile.linux b/client/Makefile.linux deleted file mode 100644 index 8e1bfed..0000000 --- a/client/Makefile.linux +++ /dev/null @@ -1,14 +0,0 @@ -CFLAGS:=-DLINUX -g -Wall -Wextra -DDEBUG -PROG:=main -OBJS:=interpret.o sds.o task.o main.o interface.o spec.o - -all: $(PROG) - -interface.o: interface_linux.c - $(CC) $(CFLAGS) -c $< -o $@ - -$(PROG): $(OBJS) - $(CC) $(LDFLAGS) -o $@ $(OBJS) - -clean: - $(RM) $(OBJS) $(PROG) diff --git a/client/main.c b/client/client.c similarity index 91% rename from client/main.c rename to client/client.c index 4919d9d..8fa596f 100644 --- a/client/main.c +++ b/client/client.c @@ -5,11 +5,6 @@ #ifdef LINUX #include -#elif defined NODEMCU -#include "ets_sys.h" -#include "osapi.h" -#include "gpio.h" -#include "os_type.h" #endif #include "interpret.h" @@ -78,7 +73,7 @@ void loop(void) read_message(); //Run tasks - cyclestart = millis(); + cyclestart = getmillis(); for(ct = 0; ct -#include - -bool input_available(void) -{ - return false; -} - -uint8_t read_byte(void) -{ - return 0; -} - -void write_byte(uint8_t b) -{ - (void)b; -} - -long millis(void) -{ - return 0; -} - -void delay(long ms) -{ - (void) ms; -} - -void setup(void) -{ - -} - -void debug(char *fmt, ...) -{ - (void)fmt; -} - -void pdie(char *s) -{ - (void)s; -} - -void die(char *fmt, ...) -{ - (void)fmt; -} diff --git a/client/linux/Makefile b/client/linux/Makefile new file mode 100644 index 0000000..ad6deff --- /dev/null +++ b/client/linux/Makefile @@ -0,0 +1,11 @@ +CFLAGS:=-DLINUX -g -Wall -Wextra -DDEBUG +PROG:=client +OBJS:=interpret.o sds.o task.o client.o interface.o spec.o + +all: $(PROG) + +$(PROG): $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) + +clean: + $(RM) $(OBJS) $(PROG) diff --git a/client/linux/client b/client/linux/client new file mode 100755 index 0000000..4b9b984 Binary files /dev/null and b/client/linux/client differ diff --git a/client/linux/client.c b/client/linux/client.c new file mode 120000 index 0000000..e47e797 --- /dev/null +++ b/client/linux/client.c @@ -0,0 +1 @@ +../client.c \ No newline at end of file diff --git a/client/interface_linux.c b/client/linux/interface.c similarity index 98% rename from client/interface_linux.c rename to client/linux/interface.c index acfd0b8..971fb0f 100644 --- a/client/interface_linux.c +++ b/client/linux/interface.c @@ -13,6 +13,7 @@ #include #include "interface.h" + struct timeval tv1; int sock_fd = -1; int fd = -1; @@ -32,7 +33,7 @@ void usage(FILE *o, char *arg0){ "-p PORT Custom port number, default: 8123\n" , arg0); } -long millis(void) { +long getmillis(void) { if (gettimeofday(&tv1, NULL) == -1) pdie("gettimeofday"); return tv1.tv_sec*1000 + tv1.tv_usec/1000; @@ -91,7 +92,7 @@ uint8_t read_apin(uint8_t i) (void) i; } -void delay(long ms) +void msdelay(long ms) { usleep(ms*1000); } diff --git a/client/linux/interface.h b/client/linux/interface.h new file mode 120000 index 0000000..b854400 --- /dev/null +++ b/client/linux/interface.h @@ -0,0 +1 @@ +../interface.h \ No newline at end of file diff --git a/client/linux/interpret.c b/client/linux/interpret.c new file mode 120000 index 0000000..213f9b8 --- /dev/null +++ b/client/linux/interpret.c @@ -0,0 +1 @@ +../interpret.c \ No newline at end of file diff --git a/client/linux/interpret.h b/client/linux/interpret.h new file mode 120000 index 0000000..a3858d4 --- /dev/null +++ b/client/linux/interpret.h @@ -0,0 +1 @@ +../interpret.h \ No newline at end of file diff --git a/client/linux/mTaskSymbols.h b/client/linux/mTaskSymbols.h new file mode 120000 index 0000000..482ac01 --- /dev/null +++ b/client/linux/mTaskSymbols.h @@ -0,0 +1 @@ +../mTaskSymbols.h \ No newline at end of file diff --git a/client/linux/sds.c b/client/linux/sds.c new file mode 120000 index 0000000..9d106bb --- /dev/null +++ b/client/linux/sds.c @@ -0,0 +1 @@ +../sds.c \ No newline at end of file diff --git a/client/linux/sds.h b/client/linux/sds.h new file mode 120000 index 0000000..f6b82b5 --- /dev/null +++ b/client/linux/sds.h @@ -0,0 +1 @@ +../sds.h \ No newline at end of file diff --git a/client/linux/spec.c b/client/linux/spec.c new file mode 120000 index 0000000..3a0ed1c --- /dev/null +++ b/client/linux/spec.c @@ -0,0 +1 @@ +../spec.c \ No newline at end of file diff --git a/client/linux/spec.h b/client/linux/spec.h new file mode 120000 index 0000000..bbf3789 --- /dev/null +++ b/client/linux/spec.h @@ -0,0 +1 @@ +../spec.h \ No newline at end of file diff --git a/client/linux/task.c b/client/linux/task.c new file mode 120000 index 0000000..e4f6627 --- /dev/null +++ b/client/linux/task.c @@ -0,0 +1 @@ +../task.c \ No newline at end of file diff --git a/client/linux/task.h b/client/linux/task.h new file mode 120000 index 0000000..d8ffa8e --- /dev/null +++ b/client/linux/task.h @@ -0,0 +1 @@ +../task.h \ No newline at end of file diff --git a/client/nodemcu/Makefile b/client/nodemcu/Makefile new file mode 100644 index 0000000..ffd72dd --- /dev/null +++ b/client/nodemcu/Makefile @@ -0,0 +1,2 @@ +all: + diff --git a/client/nodemcu/interface.c b/client/nodemcu/interface.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/client/nodemcu/interface.c @@ -0,0 +1 @@ + diff --git a/client/nodemcu/interface.h b/client/nodemcu/interface.h new file mode 120000 index 0000000..b854400 --- /dev/null +++ b/client/nodemcu/interface.h @@ -0,0 +1 @@ +../interface.h \ No newline at end of file diff --git a/client/nodemcu/interpret.c b/client/nodemcu/interpret.c new file mode 120000 index 0000000..213f9b8 --- /dev/null +++ b/client/nodemcu/interpret.c @@ -0,0 +1 @@ +../interpret.c \ No newline at end of file diff --git a/client/nodemcu/interpret.h b/client/nodemcu/interpret.h new file mode 120000 index 0000000..a3858d4 --- /dev/null +++ b/client/nodemcu/interpret.h @@ -0,0 +1 @@ +../interpret.h \ No newline at end of file diff --git a/client/nodemcu/mTaskSymbols.h b/client/nodemcu/mTaskSymbols.h new file mode 120000 index 0000000..482ac01 --- /dev/null +++ b/client/nodemcu/mTaskSymbols.h @@ -0,0 +1 @@ +../mTaskSymbols.h \ No newline at end of file diff --git a/client/nodemcu/nodemcu.ino b/client/nodemcu/nodemcu.ino new file mode 120000 index 0000000..e47e797 --- /dev/null +++ b/client/nodemcu/nodemcu.ino @@ -0,0 +1 @@ +../client.c \ No newline at end of file diff --git a/client/nodemcu/sds.c b/client/nodemcu/sds.c new file mode 120000 index 0000000..9d106bb --- /dev/null +++ b/client/nodemcu/sds.c @@ -0,0 +1 @@ +../sds.c \ No newline at end of file diff --git a/client/nodemcu/sds.h b/client/nodemcu/sds.h new file mode 120000 index 0000000..f6b82b5 --- /dev/null +++ b/client/nodemcu/sds.h @@ -0,0 +1 @@ +../sds.h \ No newline at end of file diff --git a/client/nodemcu/spec.c b/client/nodemcu/spec.c new file mode 120000 index 0000000..3a0ed1c --- /dev/null +++ b/client/nodemcu/spec.c @@ -0,0 +1 @@ +../spec.c \ No newline at end of file diff --git a/client/nodemcu/spec.h b/client/nodemcu/spec.h new file mode 120000 index 0000000..bbf3789 --- /dev/null +++ b/client/nodemcu/spec.h @@ -0,0 +1 @@ +../spec.h \ No newline at end of file diff --git a/client/nodemcu/task.c b/client/nodemcu/task.c new file mode 120000 index 0000000..e4f6627 --- /dev/null +++ b/client/nodemcu/task.c @@ -0,0 +1 @@ +../task.c \ No newline at end of file diff --git a/client/nodemcu/task.h b/client/nodemcu/task.h new file mode 120000 index 0000000..d8ffa8e --- /dev/null +++ b/client/nodemcu/task.h @@ -0,0 +1 @@ +../task.h \ No newline at end of file diff --git a/client/spec.c b/client/spec.c index 75def00..fdc626b 100644 --- a/client/spec.c +++ b/client/spec.c @@ -1,4 +1,3 @@ -//TODO #include "spec.h" #include "interface.h" diff --git a/client/spec.h b/client/spec.h index a8e0d7d..a7adebc 100644 --- a/client/spec.h +++ b/client/spec.h @@ -1,9 +1,6 @@ #ifndef SPEC_H #define SPEC_H -#include -#include - void spec_send(void); #endif diff --git a/client/ChibiOS b/client/stm32/ChibiOS similarity index 100% rename from client/ChibiOS rename to client/stm32/ChibiOS diff --git a/client/stm32/Makefile b/client/stm32/Makefile new file mode 100644 index 0000000..99a26a5 --- /dev/null +++ b/client/stm32/Makefile @@ -0,0 +1,235 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C specific options here (added to USE_OPT). +ifeq ($(USE_COPT),) + USE_COPT = +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# Linker extra options here. +ifeq ($(USE_LDOPT),) + USE_LDOPT = +endif + +# Enable this if you want link time optimizations (LTO) +ifeq ($(USE_LTO),) + USE_LTO = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable this if you want to see the full log while compiling. +ifeq ($(USE_VERBOSE_COMPILE),) + USE_VERBOSE_COMPILE = no +endif + +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) + USE_SMART_BUILD = yes +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Stack size to be allocated to the Cortex-M process stack. This stack is +# the stack used by the main() thread. +ifeq ($(USE_PROCESS_STACKSIZE),) + USE_PROCESS_STACKSIZE = 0x400 +endif + +# Stack size to the allocated to the Cortex-M main/exceptions stack. This +# stack is used for processing interrupts and exceptions. +ifeq ($(USE_EXCEPTIONS_STACKSIZE),) + USE_EXCEPTIONS_STACKSIZE = 0x400 +endif + +# Enables the use of FPU (no, softfp, hard). +ifeq ($(USE_FPU),) + USE_FPU = no +endif + +# FPU-related options. +ifeq ($(USE_FPU_OPT),) + USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv5-d16 +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = mTask + +# Imported source files and paths +CHIBIOS = ./ChibiOS +# Startup files. +include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk +# HAL-OSAL files (optional). +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/hal/ports/STM32/STM32F7xx/platform.mk +include $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.mk +include $(CHIBIOS)/os/hal/osal/rt/osal.mk +# RTOS files (optional). +include $(CHIBIOS)/os/rt/rt.mk +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk +# Other files (optional). +include $(CHIBIOS)/test/rt/test.mk + +# Define linker script file here +LDSCRIPT= $(STARTUPLD)/STM32F76xxI.ld + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(STARTUPSRC) \ + $(KERNSRC) \ + $(PORTSRC) \ + $(OSALSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(TESTSRC) \ + $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ + $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ + $(filter-out interface_nodemcu.c,$(filter-out interface_linux.c,$(wildcard *.c))) + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = +ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) + +INCDIR = $(CHIBIOS)/os/license \ + $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m7 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +AR = $(TRGT)ar +OD = $(TRGT)objdump +SZ = $(TRGT)size +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Werror + +# Define C++ warning options here +CPPWARN = -Wall -Wextra -Wundef + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = -DSTM #-DDEBUG + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# End of user defines +############################################################################## + +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC +include $(RULESPATH)/rules.mk + +flash: build/$(PROJECT).bin + sudo `which openocd` \ + -f interface/stlink-v2-1.cfg\ + -c "transport select hla_swd"\ + -f target/stm32f7x.cfg \ + -c init\ + -c "reset halt"\ + -c "flash write_image erase "$<" 0x08000000"\ + -c "reset run"\ + -c shutdown diff --git a/client/chconf.h b/client/stm32/chconf.h similarity index 100% rename from client/chconf.h rename to client/stm32/chconf.h diff --git a/client/stm32/client.c b/client/stm32/client.c new file mode 120000 index 0000000..e47e797 --- /dev/null +++ b/client/stm32/client.c @@ -0,0 +1 @@ +../client.c \ No newline at end of file diff --git a/client/halconf.h b/client/stm32/halconf.h similarity index 100% rename from client/halconf.h rename to client/stm32/halconf.h diff --git a/client/interface.c b/client/stm32/interface.c similarity index 97% rename from client/interface.c rename to client/stm32/interface.c index 432671c..4caf47e 100644 --- a/client/interface.c +++ b/client/stm32/interface.c @@ -77,11 +77,11 @@ void led_off(uint8_t i) } } -long millis(void){ +long getmillis(void){ return ST2MS(chVTGetSystemTime()); } -void delay(long ms) +void msdelay(long ms) { chThdSleepMilliseconds(ms); } @@ -117,7 +117,7 @@ void die(char *fmt, ...) palWriteLine(LINE_LED2, PAL_HIGH); palWriteLine(LINE_LED3, PAL_HIGH); while(1){ - delay(100); + msdelay(100); } (void)fmt; } diff --git a/client/stm32/interface.h b/client/stm32/interface.h new file mode 120000 index 0000000..b854400 --- /dev/null +++ b/client/stm32/interface.h @@ -0,0 +1 @@ +../interface.h \ No newline at end of file diff --git a/client/stm32/interpret.c b/client/stm32/interpret.c new file mode 120000 index 0000000..213f9b8 --- /dev/null +++ b/client/stm32/interpret.c @@ -0,0 +1 @@ +../interpret.c \ No newline at end of file diff --git a/client/stm32/interpret.h b/client/stm32/interpret.h new file mode 120000 index 0000000..a3858d4 --- /dev/null +++ b/client/stm32/interpret.h @@ -0,0 +1 @@ +../interpret.h \ No newline at end of file diff --git a/client/stm32/mTaskSymbols.h b/client/stm32/mTaskSymbols.h new file mode 120000 index 0000000..482ac01 --- /dev/null +++ b/client/stm32/mTaskSymbols.h @@ -0,0 +1 @@ +../mTaskSymbols.h \ No newline at end of file diff --git a/client/mcuconf.h b/client/stm32/mcuconf.h similarity index 100% rename from client/mcuconf.h rename to client/stm32/mcuconf.h diff --git a/client/stm32/sds.c b/client/stm32/sds.c new file mode 120000 index 0000000..9d106bb --- /dev/null +++ b/client/stm32/sds.c @@ -0,0 +1 @@ +../sds.c \ No newline at end of file diff --git a/client/stm32/sds.h b/client/stm32/sds.h new file mode 120000 index 0000000..f6b82b5 --- /dev/null +++ b/client/stm32/sds.h @@ -0,0 +1 @@ +../sds.h \ No newline at end of file diff --git a/client/stm32/spec.c b/client/stm32/spec.c new file mode 120000 index 0000000..3a0ed1c --- /dev/null +++ b/client/stm32/spec.c @@ -0,0 +1 @@ +../spec.c \ No newline at end of file diff --git a/client/stm32/spec.h b/client/stm32/spec.h new file mode 120000 index 0000000..bbf3789 --- /dev/null +++ b/client/stm32/spec.h @@ -0,0 +1 @@ +../spec.h \ No newline at end of file diff --git a/client/stm32/task.c b/client/stm32/task.c new file mode 120000 index 0000000..e4f6627 --- /dev/null +++ b/client/stm32/task.c @@ -0,0 +1 @@ +../task.c \ No newline at end of file diff --git a/client/stm32/task.h b/client/stm32/task.h new file mode 120000 index 0000000..d8ffa8e --- /dev/null +++ b/client/stm32/task.h @@ -0,0 +1 @@ +../task.h \ No newline at end of file diff --git a/client/user_config.h b/client/user_config.h deleted file mode 100644 index e69de29..0000000