Skip to content

Commit 8ae57ce

Browse files
committed
KL25Z GCC_ARM export
1 parent 5aad98a commit 8ae57ce

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This file was automagically generated by mbed.org. For more information,
2+
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
3+
4+
GCC_BIN =
5+
PROJECT = {{name}}
6+
OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %}
7+
SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %}
8+
INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %}
9+
LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %}
10+
LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %}
11+
LINKER_SCRIPT = {{linker_script}}
12+
13+
###############################################################################
14+
AS = $(GCC_BIN)arm-none-eabi-as
15+
CC = $(GCC_BIN)arm-none-eabi-gcc
16+
CPP = $(GCC_BIN)arm-none-eabi-g++
17+
LD = $(GCC_BIN)arm-none-eabi-gcc
18+
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
19+
20+
CPU = -mcpu=cortex-m0plus -mthumb
21+
CC_FLAGS = $(CPU) -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
22+
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
23+
24+
LD_FLAGS = -mcpu=cortex-m0plus -mthumb -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float
25+
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
26+
27+
all: $(PROJECT).bin
28+
29+
clean:
30+
rm -f $(PROJECT).bin $(PROJECT).elf $(OBJECTS)
31+
32+
.s.o:
33+
$(AS) $(CPU) -o $@ $<
34+
35+
.c.o:
36+
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
37+
38+
.cpp.o:
39+
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 $(INCLUDE_PATHS) -o $@ $<
40+
41+
42+
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
43+
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
44+
45+
$(PROJECT).bin: $(PROJECT).elf
46+
$(OBJCOPY) -O binary $< $@

workspace_tools/export/gccarm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class GccArm(Exporter):
2222
NAME = 'GccArm'
2323
TOOLCHAIN = 'GCC_ARM'
24-
TARGETS = ['LPC1768']
24+
TARGETS = ['LPC1768','KL25Z']
2525
DOT_IN_RELATIVE_PATH = True
2626

2727
def generate(self):

0 commit comments

Comments
 (0)