From 6465ea4730ae7cfe48334f768f14ebd8a2b196e6 Mon Sep 17 00:00:00 2001 From: Rene Hopf Date: Wed, 2 Dec 2015 01:59:17 +0100 Subject: [PATCH] moved shared stuff to shared, sections in linker script --- Makefile | 4 ++-- {stm32f103/src => shared}/common.c | 0 {stm32f103/inc => shared}/common.h | 0 {src => shared}/crc.c | 0 {src => shared}/crc.h | 0 src/setup.h | 2 +- stm32f103/Makefile | 5 +++-- stm32f103/stm32_flash.ld | 3 ++- 8 files changed, 8 insertions(+), 6 deletions(-) rename {stm32f103/src => shared}/common.c (100%) rename {stm32f103/inc => shared}/common.h (100%) rename {src => shared}/crc.c (100%) rename {src => shared}/crc.h (100%) diff --git a/Makefile b/Makefile index 28620e80..88ce6325 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ #ld gcollection #komische flags -SRCS = main.c stm32f4xx_it.c system_stm32f4xx.c printf.c scanf.c setup.c hal.c misc.c eeprom.c link.c crc.c stm32f103/src/common.c version.c syscalls.c +SRCS = main.c stm32f4xx_it.c system_stm32f4xx.c printf.c scanf.c setup.c hal.c misc.c eeprom.c link.c version.c syscalls.c shared/crc.c shared/common.c #USB SRCS += ub_lib/stm32_ub_usb_cdc.c ub_lib/usb_cdc_lolevel/usb_core.c ub_lib/usb_cdc_lolevel/usb_dcd_int.c ub_lib/usb_cdc_lolevel/usbd_req.c ub_lib/usb_cdc_lolevel/usbd_cdc_core.c ub_lib/usb_cdc_lolevel/usbd_core.c ub_lib/usb_cdc_lolevel/usb_dcd.c ub_lib/usb_cdc_lolevel/usbd_cdc_vcp.c ub_lib/usb_cdc_lolevel/usbd_desc.c ub_lib/usb_cdc_lolevel/usbd_ioreq.c ub_lib/usb_cdc_lolevel/usb_bsp.c ub_lib/usb_cdc_lolevel/usbd_usr.c #SRCS = main.c system.c @@ -40,7 +40,7 @@ vpath %.a lib ROOT=$(shell pwd) -CFLAGS += -Iinc -Ilib -Ilib/inc -Istm32f103/inc +CFLAGS += -Iinc -Ilib -Ilib/inc -Ishared CFLAGS += -Ilib/inc/core -Ilib/inc/peripherals SRCS += lib/startup_stm32f4xx.s # add startup file to build diff --git a/stm32f103/src/common.c b/shared/common.c similarity index 100% rename from stm32f103/src/common.c rename to shared/common.c diff --git a/stm32f103/inc/common.h b/shared/common.h similarity index 100% rename from stm32f103/inc/common.h rename to shared/common.h diff --git a/src/crc.c b/shared/crc.c similarity index 100% rename from src/crc.c rename to shared/crc.c diff --git a/src/crc.h b/shared/crc.h similarity index 100% rename from src/crc.h rename to shared/crc.h diff --git a/src/setup.h b/src/setup.h index fe639f59..b63ccb2d 100644 --- a/src/setup.h +++ b/src/setup.h @@ -13,7 +13,7 @@ #include "stm32f4xx_conf.h" #include "misc.h" #include "version.h" -#include "../../stm32f103/inc/common.h" +#include "common.h" #include "defines_res.h" #include "stm32_ub_usb_cdc.h" diff --git a/stm32f103/Makefile b/stm32f103/Makefile index 4f710a04..86ea83ab 100755 --- a/stm32f103/Makefile +++ b/stm32f103/Makefile @@ -38,7 +38,7 @@ GDB = $(SYSTEM)-gdb SIZE = $(SYSTEM)-size # INCLUDES = -I$(SRCDIR) $(LIBINC) -INCLUDES = $(LIBINC) +INCLUDES = $(LIBINC) -I../shared CFLAGS = $(CPU) $(CMSIS_OPT) $(OTHER_OPT) -Wall -fno-common -fno-strict-aliasing -O2 $(INCLUDES) -g -Wfatal-errors -g -std=c99 -fdiagnostics-color=always ASFLAGS = $(CFLAGS) -x assembler-with-cpp LDFLAGS = -Wl,--gc-sections,-Map=$*.map,-cref -T $(LDSCRIPT) $(CPU) @@ -55,7 +55,8 @@ OBJS = $(sort \ $(patsubst %.c,%.o,$(wildcard src/*.c)) \ $(patsubst %.s,%.o,$(wildcard src/*.s)) \ $(STARTUP_OBJ) \ - $(SYSTEM_OBJ)) + $(SYSTEM_OBJ) \ + ../shared/common.o) all: $(BIN) diff --git a/stm32f103/stm32_flash.ld b/stm32f103/stm32_flash.ld index 89b0d362..51f2db51 100755 --- a/stm32f103/stm32_flash.ld +++ b/stm32f103/stm32_flash.ld @@ -38,7 +38,8 @@ _estack = 0x20002800; /* end of 4K RAM */ /* Generate a link error if heap and stack don't fit into RAM */ _Min_Heap_Size = 0; /* required amount of heap */ _Min_Stack_Size = 0x100; /* required amount of stack */ - +/* STM32F103R6T Low-density performance line 32kb flash 10kb ram */ +/* flash layout: 32x1 */ /* Specify the memory areas */ MEMORY {