mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #357 from dinau/lpc23xx-gcc-arm-export
[LPC2368][GCC_ARM] Added export functionalitypull/351/merge
commit
8d5ef96c67
|
@ -77,7 +77,6 @@ __mbed_dcc_irq:
|
||||||
Reset_Handler:
|
Reset_Handler:
|
||||||
.extern __libc_init_array
|
.extern __libc_init_array
|
||||||
.extern SystemInit
|
.extern SystemInit
|
||||||
.extern __wrap_main
|
|
||||||
LDR R0, =SystemInit
|
LDR R0, =SystemInit
|
||||||
MOV LR, PC
|
MOV LR, PC
|
||||||
BX R0
|
BX R0
|
||||||
|
@ -86,7 +85,7 @@ Reset_Handler:
|
||||||
MOV LR, PC
|
MOV LR, PC
|
||||||
BX R0
|
BX R0
|
||||||
|
|
||||||
LDR R0, =__wrap_main
|
LDR R0, =main
|
||||||
BX R0
|
BX R0
|
||||||
|
|
||||||
__mbed_reset:
|
__mbed_reset:
|
||||||
|
|
|
@ -225,7 +225,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
|
||||||
stop_bits -= 1;
|
stop_bits -= 1;
|
||||||
data_bits -= 5;
|
data_bits -= 5;
|
||||||
|
|
||||||
int parity_enable, parity_select;
|
int parity_enable = 0, parity_select = 0;
|
||||||
switch (parity) {
|
switch (parity) {
|
||||||
case ParityNone: parity_enable = 0; parity_select = 0; break;
|
case ParityNone: parity_enable = 0; parity_select = 0; break;
|
||||||
case ParityOdd : parity_enable = 1; parity_select = 0; break;
|
case ParityOdd : parity_enable = 1; parity_select = 0; break;
|
||||||
|
|
|
@ -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=arm7tdmi-s
|
||||||
|
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
|
||||||
|
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
|
||||||
|
LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref -Wl,--entry=_start
|
||||||
|
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) -dh $< > $@
|
||||||
|
|
||||||
|
lst: $(PROJECT).lst
|
||||||
|
|
||||||
|
size:
|
||||||
|
$(SIZE) $(PROJECT).elf
|
||||||
|
|
||||||
|
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
|
||||||
|
-include $(DEPS)
|
||||||
|
|
|
@ -42,6 +42,7 @@ class GccArm(Exporter):
|
||||||
'UBLOX_C027',
|
'UBLOX_C027',
|
||||||
'ARCH_PRO',
|
'ARCH_PRO',
|
||||||
'NRF51822',
|
'NRF51822',
|
||||||
|
'LPC2368',
|
||||||
]
|
]
|
||||||
|
|
||||||
DOT_IN_RELATIVE_PATH = True
|
DOT_IN_RELATIVE_PATH = True
|
||||||
|
|
|
@ -99,6 +99,7 @@ if __name__ == '__main__':
|
||||||
('gcc_arm', 'LPC1114'),
|
('gcc_arm', 'LPC1114'),
|
||||||
('gcc_arm', 'LPC11U35_401'),
|
('gcc_arm', 'LPC11U35_401'),
|
||||||
('gcc_arm', 'LPC11U35_501'),
|
('gcc_arm', 'LPC11U35_501'),
|
||||||
|
('gcc_arm', 'LPC2368'),
|
||||||
|
|
||||||
('gcc_arm', 'STM32F407'),
|
('gcc_arm', 'STM32F407'),
|
||||||
('gcc_arm', 'DISCO_F100RB'),
|
('gcc_arm', 'DISCO_F100RB'),
|
||||||
|
|
|
@ -173,7 +173,7 @@ class GCC_ARM(GCC):
|
||||||
|
|
||||||
# Use latest gcc nanolib
|
# Use latest gcc nanolib
|
||||||
self.ld.append("--specs=nano.specs")
|
self.ld.append("--specs=nano.specs")
|
||||||
if target.name in ["LPC1768", "LPC4088", "LPC4330", "UBLOX_C027"]:
|
if target.name in ["LPC1768", "LPC4088", "LPC4330", "UBLOX_C027", "LPC2368"]:
|
||||||
self.ld.extend(["-u", "_printf_float", "-u", "_scanf_float"])
|
self.ld.extend(["-u", "_printf_float", "-u", "_scanf_float"])
|
||||||
|
|
||||||
self.sys_libs.append("nosys")
|
self.sys_libs.append("nosys")
|
||||||
|
|
Loading…
Reference in New Issue