From df25f500234dba4ac05b79eb4928787b63d3a892 Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Wed, 31 Dec 2014 16:08:01 +0100 Subject: [PATCH 1/4] [DISCO/NUCLEO_L053xx] exporter to CoIDE --- workspace_tools/export/coide.py | 2 + .../export/coide_disco_l053c8.coproj.tmpl | 168 ++++++++++++++++++ .../export/coide_nucleo_l053r8.coproj.tmpl | 168 ++++++++++++++++++ 3 files changed, 338 insertions(+) create mode 100644 workspace_tools/export/coide_disco_l053c8.coproj.tmpl create mode 100644 workspace_tools/export/coide_nucleo_l053r8.coproj.tmpl diff --git a/workspace_tools/export/coide.py b/workspace_tools/export/coide.py index f7de7f66ce..2006b4b143 100644 --- a/workspace_tools/export/coide.py +++ b/workspace_tools/export/coide.py @@ -29,6 +29,7 @@ class CoIDE(Exporter): 'ARCH_PRO', 'UBLOX_C027', 'DISCO_F407VG', + 'NUCLEO_L053R8', 'NUCLEO_L152RE', 'NUCLEO_F030R8', 'NUCLEO_F072RB', @@ -36,6 +37,7 @@ class CoIDE(Exporter): 'NUCLEO_F334R8', 'NUCLEO_F401RE', 'NUCLEO_F411RE', + 'DISCO_L053C8', 'DISCO_F429ZI', 'DISCO_F334C8', 'DISCO_F303VC', diff --git a/workspace_tools/export/coide_disco_l053c8.coproj.tmpl b/workspace_tools/export/coide_disco_l053c8.coproj.tmpl new file mode 100644 index 0000000000..8857942c79 --- /dev/null +++ b/workspace_tools/export/coide_disco_l053c8.coproj.tmpl @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + {% for file in source_files %} + + {% endfor %} + {% for file in header_files %} + + {% endfor %} + + diff --git a/workspace_tools/export/coide_nucleo_l053r8.coproj.tmpl b/workspace_tools/export/coide_nucleo_l053r8.coproj.tmpl new file mode 100644 index 0000000000..fd18d262c3 --- /dev/null +++ b/workspace_tools/export/coide_nucleo_l053r8.coproj.tmpl @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + {% for file in source_files %} + + {% endfor %} + {% for file in header_files %} + + {% endfor %} + + From 2d61dff9c42eccb6b9c53f319940b7b881ae8eb2 Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Wed, 31 Dec 2014 16:34:20 +0100 Subject: [PATCH 2/4] [Nucleo_F103RB] exporter to gcc_arm and coide --- workspace_tools/export/coide.py | 1 + .../export/coide_nucleo_f103rb.coproj.tmpl | 168 ++++++++++++++++++ .../export/gcc_arm_nucleo_f103rb.tmpl | 71 ++++++++ workspace_tools/export/gccarm.py | 1 + 4 files changed, 241 insertions(+) create mode 100644 workspace_tools/export/coide_nucleo_f103rb.coproj.tmpl create mode 100644 workspace_tools/export/gcc_arm_nucleo_f103rb.tmpl diff --git a/workspace_tools/export/coide.py b/workspace_tools/export/coide.py index 2006b4b143..205cdad497 100644 --- a/workspace_tools/export/coide.py +++ b/workspace_tools/export/coide.py @@ -33,6 +33,7 @@ class CoIDE(Exporter): 'NUCLEO_L152RE', 'NUCLEO_F030R8', 'NUCLEO_F072RB', + 'NUCLEO_F103RB', 'NUCLEO_F302R8', 'NUCLEO_F334R8', 'NUCLEO_F401RE', diff --git a/workspace_tools/export/coide_nucleo_f103rb.coproj.tmpl b/workspace_tools/export/coide_nucleo_f103rb.coproj.tmpl new file mode 100644 index 0000000000..ce2c8fd862 --- /dev/null +++ b/workspace_tools/export/coide_nucleo_f103rb.coproj.tmpl @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + {% for file in source_files %} + + {% endfor %} + {% for file in header_files %} + + {% endfor %} + + diff --git a/workspace_tools/export/gcc_arm_nucleo_f103rb.tmpl b/workspace_tools/export/gcc_arm_nucleo_f103rb.tmpl new file mode 100644 index 0000000000..8a9f703b28 --- /dev/null +++ b/workspace_tools/export/gcc_arm_nucleo_f103rb.tmpl @@ -0,0 +1,71 @@ +# 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-m3 -mthumb +CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti +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 ($(DEBUG), 1) + CC_FLAGS += -DDEBUG -O0 +else + CC_FLAGS += -DNDEBUG -Os +endif + +all: $(PROJECT).bin $(PROJECT).hex size + +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 $(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) + +$(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 bb0d2413d4..9f3d3bf110 100644 --- a/workspace_tools/export/gccarm.py +++ b/workspace_tools/export/gccarm.py @@ -59,6 +59,7 @@ class GccArm(Exporter): 'NUCLEO_F030R8', 'NUCLEO_F070RB', 'NUCLEO_F072RB', + 'NUCLEO_F103RB', 'NUCLEO_F302R8', 'NUCLEO_F334R8', 'DISCO_L053C8', From d9ae0369f9e0920a1eab00ca60806fd4b73685d4 Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Wed, 31 Dec 2014 17:17:50 +0100 Subject: [PATCH 3/4] [DISCO_F100RB] exporter to coide --- workspace_tools/export/coide.py | 1 + .../export/coide_disco_f100rb.coproj.tmpl | 168 ++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 workspace_tools/export/coide_disco_f100rb.coproj.tmpl diff --git a/workspace_tools/export/coide.py b/workspace_tools/export/coide.py index 205cdad497..7ea652872d 100644 --- a/workspace_tools/export/coide.py +++ b/workspace_tools/export/coide.py @@ -39,6 +39,7 @@ class CoIDE(Exporter): 'NUCLEO_F401RE', 'NUCLEO_F411RE', 'DISCO_L053C8', + 'DISCO_F100RB', 'DISCO_F429ZI', 'DISCO_F334C8', 'DISCO_F303VC', diff --git a/workspace_tools/export/coide_disco_f100rb.coproj.tmpl b/workspace_tools/export/coide_disco_f100rb.coproj.tmpl new file mode 100644 index 0000000000..f289ff5ec1 --- /dev/null +++ b/workspace_tools/export/coide_disco_f100rb.coproj.tmpl @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + {% for file in source_files %} + + {% endfor %} + {% for file in header_files %} + + {% endfor %} + + From aaede9c070cf301a34faf33807c289d7c3cf8903 Mon Sep 17 00:00:00 2001 From: ohagendorf Date: Wed, 31 Dec 2014 17:46:32 +0100 Subject: [PATCH 4/4] [DISCO_F051R8] exporter to coide and a naming correction In PeripheralNames.h the PWM timer name was wrong. Changed from TIMxx to PWMxx. --- .../TARGET_DISCO_F051R8/PeripheralNames.h | 10 +- workspace_tools/export/coide.py | 1 + .../export/coide_disco_f051r8.coproj.tmpl | 168 ++++++++++++++++++ 3 files changed, 174 insertions(+), 5 deletions(-) create mode 100644 workspace_tools/export/coide_disco_f051r8.coproj.tmpl diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F051R8/PeripheralNames.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F051R8/PeripheralNames.h index eabfa62c03..f18c4775e0 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F051R8/PeripheralNames.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F051R8/PeripheralNames.h @@ -65,11 +65,11 @@ typedef enum { } I2CName; typedef enum { - TIM_3 = (int)TIM3_BASE, - TIM_14 = (int)TIM14_BASE, - TIM_15 = (int)TIM15_BASE, - TIM_16 = (int)TIM16_BASE, - TIM_17 = (int)TIM17_BASE + PWM_3 = (int)TIM3_BASE, + PWM_14 = (int)TIM14_BASE, + PWM_15 = (int)TIM15_BASE, + PWM_16 = (int)TIM16_BASE, + PWM_17 = (int)TIM17_BASE } PWMName; #ifdef __cplusplus diff --git a/workspace_tools/export/coide.py b/workspace_tools/export/coide.py index 7ea652872d..b3f4dde64b 100644 --- a/workspace_tools/export/coide.py +++ b/workspace_tools/export/coide.py @@ -39,6 +39,7 @@ class CoIDE(Exporter): 'NUCLEO_F401RE', 'NUCLEO_F411RE', 'DISCO_L053C8', + 'DISCO_F051R8', 'DISCO_F100RB', 'DISCO_F429ZI', 'DISCO_F334C8', diff --git a/workspace_tools/export/coide_disco_f051r8.coproj.tmpl b/workspace_tools/export/coide_disco_f051r8.coproj.tmpl new file mode 100644 index 0000000000..ee4100b84a --- /dev/null +++ b/workspace_tools/export/coide_disco_f051r8.coproj.tmpl @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + {% for file in source_files %} + + {% endfor %} + {% for file in header_files %} + + {% endfor %} + +