Skip to content

Commit e86d75f

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents f210d81 + e2574eb commit e86d75f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+326
-32
lines changed

libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11U35_401/LPC11U35.ld

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ SECTIONS
4040
{
4141
KEEP(*(.isr_vector))
4242
*(.text.Reset_Handler)
43-
*(.text.SystemInit)
4443

4544
/* Only vectors and code running at reset are safe to be in first 512
4645
bytes since RAM can be mapped into this area for RAM based interrupt

libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11U35_501/LPC11U35.ld

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ SECTIONS
4040
{
4141
KEEP(*(.isr_vector))
4242
*(.text.Reset_Handler)
43-
*(.text.SystemInit)
4443

4544
/* Only vectors and code running at reset are safe to be in first 512
4645
bytes since RAM can be mapped into this area for RAM based interrupt

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/serial_api.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ serial_t stdio_uart;
7676
struct serial_global_data_s {
7777
uint32_t serial_irq_id;
7878
gpio_t sw_rts, sw_cts;
79-
uint8_t rx_irq_set_flow, rx_irq_set_api;
79+
uint8_t count, rx_irq_set_flow, rx_irq_set_api;
8080
};
8181

8282
static struct serial_global_data_s uart_data[UART_NUM];
@@ -100,7 +100,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
100100
case UART_2: LPC_SC->PCONP |= 1 << 24; break;
101101
case UART_3: LPC_SC->PCONP |= 1 << 25; break;
102102
}
103-
103+
104104
// enable fifos and default rx trigger level
105105
obj->uart->FCR = 1 << 0 // FIFO Enable - 0 = Disables, 1 = Enabled
106106
| 0 << 1 // Rx Fifo Reset
@@ -357,17 +357,24 @@ int serial_getc(serial_t *obj) {
357357
void serial_putc(serial_t *obj, int c) {
358358
while (!serial_writable(obj));
359359
obj->uart->THR = c;
360+
uart_data[obj->index].count++;
360361
}
361362

362363
int serial_readable(serial_t *obj) {
363364
return obj->uart->LSR & 0x01;
364365
}
365366

366367
int serial_writable(serial_t *obj) {
368+
int isWritable = 1;
367369
if (NC != uart_data[obj->index].sw_cts.pin)
368-
return (gpio_read(&uart_data[obj->index].sw_cts) == 0) && (obj->uart->LSR & 0x40); //If flow control: writable if CTS low + UART done
369-
else
370-
return obj->uart->LSR & 0x20; //No flow control: writable if space in holding register
370+
isWritable = (gpio_read(&uart_data[obj->index].sw_cts) == 0) && (obj->uart->LSR & 0x40); //If flow control: writable if CTS low + UART done
371+
else {
372+
if (obj->uart->LSR & 0x20)
373+
uart_data[obj->index].count = 0;
374+
else if (uart_data[obj->index].count >= 16)
375+
isWritable = 0;
376+
}
377+
return isWritable;
371378
}
372379

373380
void serial_clear(serial_t *obj) {

libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4XX/PinNames.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ typedef enum {
4343
PF_0, PF_1, PF_2, PF_3, PF_4, PF_5, PF_6, PF_7, PF_8, PF_9, PF_10, PF_11, PF_12, PF_13, PF_14, PF_15,
4444
PH_0, PH_1, PH_2, PH_3, PH_4, PH_5, PH_6, PH_7, PH_8, PH_9, PH_10, PH_11,
4545

46+
LED3 = PD_13,
47+
LED4 = PD_12,
48+
LED5 = PD_14,
49+
LED6 = PD_15,
50+
4651
// Not connected
4752
NC = (int)0xFFFFFFFF
4853
} PinName;

libraries/tests/mbed/ticker/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include "mbed.h"
22

3+
#if defined(TARGET_STM32F407)
4+
#define LED1 LED3
5+
#endif
6+
37
Ticker flipper_1;
48
DigitalOut led1(LED1);
59
int led1_state = 0;
@@ -19,6 +23,8 @@ Ticker flipper_2;
1923
# define LED_NAME LED2
2024
#elif defined(TARGET_KL46Z)
2125
# define LED_NAME LED2
26+
#elif defined(TARGET_STM32F407)
27+
# define LED_NAME LED4
2228
#else
2329
# define LED_NAME PTE31
2430
#endif

workspace_tools/export/codered.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@
2020

2121
class CodeRed(Exporter):
2222
NAME = 'CodeRed'
23-
TARGETS = ['LPC1768', 'LPC4088','LPC1114','LPC11U35_401','LPC11U35_501']
2423
TOOLCHAIN = 'GCC_CR'
2524

25+
TARGETS = [
26+
'LPC1768',
27+
'LPC4088',
28+
'LPC1114',
29+
'LPC11U35_401',
30+
'LPC11U35_501',
31+
]
32+
2633
def generate(self):
2734
libraries = []
2835
for lib in self.resources.libraries:

workspace_tools/export/codesourcery.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020

2121
class CodeSourcery(Exporter):
2222
NAME = 'CodeSourcery'
23-
TARGETS = ['LPC1768']
2423
TOOLCHAIN = 'GCC_CS'
24+
25+
TARGETS = [
26+
'LPC1768',
27+
]
28+
2529
DOT_IN_RELATIVE_PATH = True
2630

2731
def generate(self):

workspace_tools/export/coide.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@
2020

2121
class CoIDE(Exporter):
2222
NAME = 'CoIDE'
23+
TOOLCHAIN = 'GCC_ARM'
24+
25+
TARGETS = [
26+
'KL25Z',
27+
'KL05Z',
28+
]
29+
2330
# seems like CoIDE currently supports only one type
2431
FILE_TYPES = {
2532
'c_sources':'1',
2633
'cpp_sources':'1',
2734
's_sources':'1'
2835
}
29-
TARGETS = ['KL25Z','KL05Z']
30-
TOOLCHAIN = 'GCC_ARM'
3136

3237
def generate(self):
3338
self.resources.win_to_unix()

workspace_tools/export/ds5_5.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,22 @@
2020

2121
class DS5_5(Exporter):
2222
NAME = 'DS5'
23-
TARGETS = ['LPC1768', 'LPC11U24', 'LPC812']
23+
24+
TARGETS = [
25+
'LPC1768',
26+
'LPC11U24',
27+
'LPC812',
28+
]
29+
30+
USING_MICROLIB = [
31+
'LPC812',
32+
]
33+
2434
FILE_TYPES = {
2535
'c_sources':'1',
2636
'cpp_sources':'8',
2737
's_sources':'2'
2838
}
29-
USING_MICROLIB = ['LPC812']
3039

3140
def get_toolchain(self):
3241
return 'uARM' if (self.target in self.USING_MICROLIB) else 'ARM'

workspace_tools/export/gcc_arm_lpc1114.tmpl

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ CC = $(GCC_BIN)arm-none-eabi-gcc
1616
CPP = $(GCC_BIN)arm-none-eabi-g++
1717
LD = $(GCC_BIN)arm-none-eabi-gcc
1818
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
19+
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
20+
SIZE = $(GCC_BIN)arm-none-eabi-size
1921

2022
CPU = -mcpu=cortex-m0 -mthumb
2123
CC_FLAGS = $(CPU) -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
2224
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2325

2426
LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs
27+
LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref
2528
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
2629

27-
all: $(PROJECT).bin
30+
all: $(PROJECT).bin $(PROJECT).hex size
2831

2932
clean:
30-
rm -f $(PROJECT).bin $(PROJECT).elf $(OBJECTS)
33+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
3134

3235
.s.o:
3336
$(AS) $(CPU) -o $@ $<
@@ -41,6 +44,22 @@ clean:
4144

4245
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
4346
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
47+
@echo ""
48+
@echo "*****"
49+
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
50+
@echo "*****"
51+
@echo ""
4452

4553
$(PROJECT).bin: $(PROJECT).elf
46-
$(OBJCOPY) -O binary $< $@
54+
@$(OBJCOPY) -O binary $< $@
55+
56+
$(PROJECT).hex: $(PROJECT).elf
57+
@$(OBJCOPY) -O ihex $< $@
58+
59+
$(PROJECT).lst: $(PROJECT).elf
60+
@$(OBJDUMP) -Sdh $< > $@
61+
62+
lst: $(PROJECT).lst
63+
64+
size:
65+
$(SIZE) $(PROJECT).elf
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
20+
SIZE = $(GCC_BIN)arm-none-eabi-size
21+
22+
CPU = -mcpu=cortex-m0 -mthumb
23+
CC_FLAGS = $(CPU) -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
24+
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
25+
26+
LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs
27+
LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref
28+
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
29+
30+
all: $(PROJECT).bin $(PROJECT).hex size
31+
32+
clean:
33+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
34+
35+
.s.o:
36+
$(AS) $(CPU) -o $@ $<
37+
38+
.c.o:
39+
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
40+
41+
.cpp.o:
42+
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 $(INCLUDE_PATHS) -o $@ $<
43+
44+
45+
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
46+
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
47+
@echo ""
48+
@echo "*****"
49+
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
50+
@echo "*****"
51+
@echo ""
52+
53+
$(PROJECT).bin: $(PROJECT).elf
54+
@$(OBJCOPY) -O binary $< $@
55+
56+
$(PROJECT).hex: $(PROJECT).elf
57+
@$(OBJCOPY) -O ihex $< $@
58+
59+
$(PROJECT).lst: $(PROJECT).elf
60+
@$(OBJDUMP) -Sdh $< > $@
61+
62+
lst: $(PROJECT).lst
63+
64+
size:
65+
$(SIZE) $(PROJECT).elf
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
20+
SIZE = $(GCC_BIN)arm-none-eabi-size
21+
22+
CPU = -mcpu=cortex-m0 -mthumb
23+
CC_FLAGS = $(CPU) -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
24+
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
25+
26+
LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs
27+
LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref
28+
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
29+
30+
all: $(PROJECT).bin $(PROJECT).hex size
31+
32+
clean:
33+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
34+
35+
.s.o:
36+
$(AS) $(CPU) -o $@ $<
37+
38+
.c.o:
39+
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
40+
41+
.cpp.o:
42+
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 $(INCLUDE_PATHS) -o $@ $<
43+
44+
45+
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
46+
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
47+
@echo ""
48+
@echo "*****"
49+
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
50+
@echo "*****"
51+
@echo ""
52+
53+
$(PROJECT).bin: $(PROJECT).elf
54+
@$(OBJCOPY) -O binary $< $@
55+
56+
$(PROJECT).hex: $(PROJECT).elf
57+
@$(OBJCOPY) -O ihex $< $@
58+
59+
$(PROJECT).lst: $(PROJECT).elf
60+
@$(OBJDUMP) -Sdh $< > $@
61+
62+
lst: $(PROJECT).lst
63+
64+
size:
65+
$(SIZE) $(PROJECT).elf

0 commit comments

Comments
 (0)