From 3dcdba16362a30a3bee9e2d2bf4a57995bba697e Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Tue, 17 Mar 2015 02:13:23 +0100 Subject: [PATCH] [NUCLEO_F303RE] exporter for GCC_ARM and CoIDE Added exporter to GCC_ARM and CoIDE. --- workspace_tools/export/coide.py | 1 + .../export/coide_nucleo_f303re.coproj.tmpl | 90 +++++++++++++++++++ .../export/gcc_arm_nucleo_f303re.tmpl | 78 ++++++++++++++++ workspace_tools/export/gccarm.py | 1 + 4 files changed, 170 insertions(+) create mode 100644 workspace_tools/export/coide_nucleo_f303re.coproj.tmpl create mode 100644 workspace_tools/export/gcc_arm_nucleo_f303re.tmpl diff --git a/workspace_tools/export/coide.py b/workspace_tools/export/coide.py index aa3b916718..c25d90d128 100644 --- a/workspace_tools/export/coide.py +++ b/workspace_tools/export/coide.py @@ -35,6 +35,7 @@ class CoIDE(Exporter): 'NUCLEO_F091RC', 'NUCLEO_F103RB', 'NUCLEO_F302R8', + 'NUCLEO_F303RE', 'NUCLEO_F334R8', 'NUCLEO_F401RE', 'NUCLEO_F411RE', diff --git a/workspace_tools/export/coide_nucleo_f303re.coproj.tmpl b/workspace_tools/export/coide_nucleo_f303re.coproj.tmpl new file mode 100644 index 0000000000..0995181701 --- /dev/null +++ b/workspace_tools/export/coide_nucleo_f303re.coproj.tmpl @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + {% for file in source_files %} + + {% endfor %} + {% for file in header_files %} + + {% endfor %} + + diff --git a/workspace_tools/export/gcc_arm_nucleo_f303re.tmpl b/workspace_tools/export/gcc_arm_nucleo_f303re.tmpl new file mode 100644 index 0000000000..224ceb2fae --- /dev/null +++ b/workspace_tools/export/gcc_arm_nucleo_f303re.tmpl @@ -0,0 +1,78 @@ +# This file was automagically generated by mbed.org. For more information, +# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded + +GCC_BIN = +PROJECT = {{name}} +OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %} +SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %} +INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %} +LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %} +LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %} +LINKER_SCRIPT = {{linker_script}} + +############################################################################### +AS = $(GCC_BIN)arm-none-eabi-as +CC = $(GCC_BIN)arm-none-eabi-gcc +CPP = $(GCC_BIN)arm-none-eabi-g++ +LD = $(GCC_BIN)arm-none-eabi-gcc +OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy +OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump +SIZE = $(GCC_BIN)arm-none-eabi-size + +CPU = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=$(FLOAT_ABI) +CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer +CC_FLAGS += -MMD -MP +CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} + +LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -Wl,--wrap,main +LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref +LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys + +ifeq ($(HARDFP),1) + FLOAT_ABI = hard +else + FLOAT_ABI = softfp +endif + +ifeq ($(DEBUG), 1) + CC_FLAGS += -DDEBUG -O0 +else + CC_FLAGS += -DNDEBUG -Os +endif + +all: $(PROJECT).bin $(PROJECT).hex + +clean: + rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS) + +.s.o: + $(AS) $(CPU) -o $@ $< + +.c.o: + $(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $< + +.cpp.o: + $(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $< + + +$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) + $(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS) + $(SIZE) $@ + +$(PROJECT).bin: $(PROJECT).elf + @$(OBJCOPY) -O binary $< $@ + +$(PROJECT).hex: $(PROJECT).elf + @$(OBJCOPY) -O ihex $< $@ + +$(PROJECT).lst: $(PROJECT).elf + @$(OBJDUMP) -Sdh $< > $@ + +lst: $(PROJECT).lst + +size: + $(SIZE) $(PROJECT).elf + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) + diff --git a/workspace_tools/export/gccarm.py b/workspace_tools/export/gccarm.py index 995c0881f3..a18d98ce60 100644 --- a/workspace_tools/export/gccarm.py +++ b/workspace_tools/export/gccarm.py @@ -64,6 +64,7 @@ class GccArm(Exporter): 'NUCLEO_F091RC', 'NUCLEO_F103RB', 'NUCLEO_F302R8', + 'NUCLEO_F303RE', 'NUCLEO_F334R8', 'DISCO_L053C8', 'NUCLEO_L053R8',