Skip to content

Commit 88fcf53

Browse files
U-owner-PC\ownerU-owner-PC\owner
authored andcommitted
Merge remote-tracking branch 'upstream/master'
2 parents 3e291c1 + 8648ff5 commit 88fcf53

File tree

11 files changed

+103
-38
lines changed

11 files changed

+103
-38
lines changed

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K/nRF51822.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
; *(InRoot$$Sections)
66
; .ANY (+RO)
77
; }
8-
; RW_IRAM1 0x20000000 0x00004000 {
8+
; RW_IRAM1 0x20000000 0x00008000 {
99
; .ANY (+RW +ZI)
1010
; }
1111
;}

libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/PeripheralNames.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ typedef enum {
5353
UART_3 = (int)USART3_BASE,
5454
UART_4 = (int)UART4_BASE,
5555
UART_5 = (int)UART5_BASE,
56-
UART_6 = (int)USART6_BASE
56+
UART_6 = (int)USART6_BASE,
57+
UART_7 = (int)UART7_BASE,
58+
UART_8 = (int)UART8_BASE
5759
} UARTName;
5860

5961
#define STDIO_UART_TX PD_8

libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/PeripheralPins.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,14 @@ const PinMap PinMap_PWM[] = {
133133
const PinMap PinMap_UART_TX[] = {
134134
{PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
135135
{PD_8, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
136+
{PF_7, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)},
136137
{NC, NC, 0}
137138
};
138139

139140
const PinMap PinMap_UART_RX[] = {
140141
{PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
141142
{PD_9, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
143+
{PF_6, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)},
142144
{NC, NC, 0}
143145
};
144146

libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/serial_api.c

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
#include <string.h>
3838
#include "PeripheralPins.h"
3939

40-
#define UART_NUM (6)
40+
#define UART_NUM (8)
4141

42-
static uint32_t serial_irq_ids[UART_NUM] = {0, 0, 0, 0, 0, 0};
42+
static uint32_t serial_irq_ids[UART_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
4343

4444
static uart_irq_handler irq_handler;
4545

@@ -111,6 +111,18 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
111111
__USART6_CLK_ENABLE();
112112
obj->index = 5;
113113
break;
114+
#if defined(UART7_BASE)
115+
case UART_7:
116+
__UART7_CLK_ENABLE();
117+
obj->index = 6;
118+
break;
119+
#endif
120+
#if defined(UART8_BASE)
121+
case UART_8:
122+
__UART8_CLK_ENABLE();
123+
obj->index = 7;
124+
break;
125+
#endif
114126
}
115127

116128
// Configure the UART pins
@@ -181,6 +193,20 @@ void serial_free(serial_t *obj)
181193
__USART6_RELEASE_RESET();
182194
__USART6_CLK_DISABLE();
183195
break;
196+
#if defined(UART7_BASE)
197+
case UART_7:
198+
__UART7_FORCE_RESET();
199+
__UART7_RELEASE_RESET();
200+
__UART7_CLK_DISABLE();
201+
break;
202+
#endif
203+
#if defined(UART8_BASE)
204+
case UART_8:
205+
__UART8_FORCE_RESET();
206+
__UART8_RELEASE_RESET();
207+
__UART8_CLK_DISABLE();
208+
break;
209+
#endif
184210
}
185211
// Configure GPIOs
186212
pin_function(obj->pin_tx, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0));
@@ -281,6 +307,20 @@ static void uart6_irq(void)
281307
uart_irq(UART_6, 5);
282308
}
283309

310+
#if defined(UART7_BASE)
311+
static void uart7_irq(void)
312+
{
313+
uart_irq(UART_7, 6);
314+
}
315+
#endif
316+
317+
#if defined(UART8_BASE)
318+
static void uart8_irq(void)
319+
{
320+
uart_irq(UART_8, 7);
321+
}
322+
#endif
323+
284324
void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id)
285325
{
286326
irq_handler = handler;
@@ -326,6 +366,18 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
326366
irq_n = USART6_IRQn;
327367
vector = (uint32_t)&uart6_irq;
328368
break;
369+
#if defined(UART7_BASE)
370+
case UART_7:
371+
irq_n = UART7_IRQn;
372+
vector = (uint32_t)&uart7_irq;
373+
break;
374+
#endif
375+
#if defined(UART8_BASE)
376+
case UART_8:
377+
irq_n = UART8_IRQn;
378+
vector = (uint32_t)&uart8_irq;
379+
break;
380+
#endif
329381
}
330382

331383
if (enable) {

workspace_tools/export_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_export(toolchain, target, expected_error=None):
5555
temp_dir = join(base_dir, "temp")
5656
mkdir(temp_dir)
5757

58-
zip_path, report = export(USER_PRJ, USR_PRJ_NAME, toolchain, target, base_dir, temp_dir, False, fake_build_url_resolver)
58+
zip_path, report = export(USER_PRJ, USR_PRJ_NAME, toolchain, target, base_dir, temp_dir, False, None, fake_build_url_resolver)
5959

6060
if report['success']:
6161
move(zip_path, join(EXPORT_DIR, "export_%s_%s.zip" % (toolchain, target)))

workspace_tools/host_tests/rtc_auto.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ def test(self, selftest):
3838
sec = int(m.groups()[0])
3939
time_str = m.groups()[1]
4040
correct_time_str = strftime("%Y-%m-%d %H:%M:%S %p", gmtime(float(sec)))
41-
test_result = test_result and (time_str == correct_time_str)
42-
result_msg = "OK" if (time_str == correct_time_str and sec > 0 and sec > sec_prev) else "FAIL"
41+
single_result = time_str == correct_time_str and sec > 0 and sec > sec_prev
42+
test_result = test_result and single_result
43+
result_msg = "OK" if single_result else "FAIL"
4344
selftest.notify("HOST: [%s] [%s] received time %+d sec after %.2f sec... %s"% (sec, time_str, sec - sec_prev, delta, result_msg))
4445
sec_prev = sec
4546
else:

workspace_tools/host_tests/tcpecho_client_auto.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
from sys import stdout
2121
from SocketServer import BaseRequestHandler, TCPServer
2222

23-
SERVER_IP = str(socket.gethostbyname(socket.getfqdn()))
24-
SERVER_PORT = 7
25-
2623
class TCPEchoClient_Handler(BaseRequestHandler):
2724
def handle(self):
2825
""" One handle per connection
@@ -67,6 +64,22 @@ def send_server_ip_port(self, selftest, ip_address, port_no):
6764
selftest.notify(c.strip())
6865

6966
def test(self, selftest):
67+
# We need to discover SERVEP_IP and set up SERVER_PORT
68+
# Note: Port 7 is Echo Protocol:
69+
#
70+
# Port number rationale:
71+
#
72+
# The Echo Protocol is a service in the Internet Protocol Suite defined
73+
# in RFC 862. It was originally proposed for testing and measurement
74+
# of round-trip times[citation needed] in IP networks.
75+
#
76+
# A host may connect to a server that supports the Echo Protocol using
77+
# the Transmission Control Protocol (TCP) or the User Datagram Protocol
78+
# (UDP) on the well-known port number 7. The server sends back an
79+
# identical copy of the data it received.
80+
SERVER_IP = str(socket.gethostbyname(socket.getfqdn()))
81+
SERVER_PORT = 7
82+
7083
# Returning none will suppress host test from printing success code
7184
server = TCPServer((SERVER_IP, SERVER_PORT), TCPEchoClient_Handler)
7285
print "HOST: Listening for TCP connections: " + SERVER_IP + ":" + str(SERVER_PORT)

workspace_tools/host_tests/udpecho_client_auto.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
from sys import stdout
2121
from SocketServer import BaseRequestHandler, UDPServer
2222

23-
SERVER_IP = str(socket.gethostbyname(socket.getfqdn()))
24-
SERVER_PORT = 7
25-
2623
class UDPEchoClient_Handler(BaseRequestHandler):
2724
def handle(self):
2825
""" One handle per connection
@@ -57,6 +54,22 @@ def send_server_ip_port(self, selftest, ip_address, port_no):
5754
return selftest.RESULT_PASSIVE
5855

5956
def test(self, selftest):
57+
# We need to discover SERVEP_IP and set up SERVER_PORT
58+
# Note: Port 7 is Echo Protocol:
59+
#
60+
# Port number rationale:
61+
#
62+
# The Echo Protocol is a service in the Internet Protocol Suite defined
63+
# in RFC 862. It was originally proposed for testing and measurement
64+
# of round-trip times[citation needed] in IP networks.
65+
#
66+
# A host may connect to a server that supports the Echo Protocol using
67+
# the Transmission Control Protocol (TCP) or the User Datagram Protocol
68+
# (UDP) on the well-known port number 7. The server sends back an
69+
# identical copy of the data it received.
70+
SERVER_IP = str(socket.gethostbyname(socket.getfqdn()))
71+
SERVER_PORT = 7
72+
6073
# Returning none will suppress host test from printing success code
6174
server = UDPServer((SERVER_IP, SERVER_PORT), UDPEchoClient_Handler)
6275
print "HOST: Listening for UDP connections..."

workspace_tools/singletest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,16 @@ def get_version():
137137
test_spec = None
138138
MUTs = None
139139

140-
if opts.auto_detect:
140+
if hasattr(opts, 'auto_detect') and opts.auto_detect:
141+
# If auto_detect attribute is present, we assume other auto-detection
142+
# parameters like 'toolchains_filter' are also set.
141143
print "MBEDLS: Detecting connected mbed-enabled devices... "
142144

143145
if get_module_avail('mbed_lstools'):
144146
mbeds = mbed_lstools.create()
145147
muts_list = mbeds.list_mbeds()
146148
for mut in muts_list:
147-
print "MBEDLS: Detected %s, port: %s, mounted: %s"% (mut['platform_name'],
149+
print "MBEDLS: Detected %s, port: %s, mounted: %s"% (mut['platform_name'],
148150
mut['serial_port'],
149151
mut['mount_point'])
150152

workspace_tools/targets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,8 @@ def __init__(self):
415415
self.detect_code = ["0230"]
416416

417417
class TEENSY3_1(Target):
418+
OUTPUT_EXT = '.hex'
419+
418420
def __init__(self):
419421
Target.__init__(self)
420422
self.core = "Cortex-M4"
@@ -423,7 +425,6 @@ def __init__(self):
423425
self.is_disk_virtual = True
424426
self.detect_code = ["0230"]
425427

426-
OUTPUT_EXT = '.hex'
427428

428429
def init_hooks(self, hook, toolchain_name):
429430
if toolchain_name in ['ARM_STD', 'ARM_MICRO', 'GCC_ARM']:

workspace_tools/toolchains/__init__.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import re
1919
import sys
20-
import colorama
2120
from os import stat, walk
2221
from copy import copy
2322
from time import time, sleep
@@ -50,23 +49,6 @@ def print_notify(event, silent=False):
5049
if not silent:
5150
print '%s: %s' % (event['action'].title(), basename(event['file']))
5251

53-
def print_notify_color(event, silent=False):
54-
""" Default command line notification with colors
55-
"""
56-
from colorama import Fore, Back, Style
57-
58-
if event['type'] in ['info', 'debug']:
59-
print Fore.GREEN + event['message'] + Fore.RESET
60-
61-
elif event['type'] == 'cc':
62-
event['severity'] = event['severity'].title()
63-
event['file'] = basename(event['file'])
64-
print Fore.YELLOW + '[%(severity)s] %(file)s@%(line)s: %(message)s'% event + Fore.RESET
65-
66-
elif event['type'] == 'progress':
67-
if not silent:
68-
print '%s: %s' % (event['action'].title(), basename(event['file']))
69-
7052
def print_notify_verbose(event, silent=False):
7153
""" Default command line notification with more verbose mode
7254
"""
@@ -239,7 +221,7 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False)
239221

240222
self.legacy_ignore_dirs = LEGACY_IGNORE_DIRS - set([target.name, LEGACY_TOOLCHAIN_NAMES[self.name]])
241223

242-
self.notify_fun = notify if notify is not None else print_notify_color
224+
self.notify_fun = notify if notify is not None else print_notify
243225
self.options = options if options is not None else []
244226

245227
self.macros = macros or []
@@ -731,9 +713,6 @@ def tool_error(self, message):
731713
def var(self, key, value):
732714
self.notify({'type': 'var', 'key': key, 'val': value})
733715

734-
from colorama import init
735-
init()
736-
737716
from workspace_tools.settings import ARM_BIN
738717
from workspace_tools.settings import GCC_ARM_PATH, GCC_CR_PATH, GCC_CS_PATH, CW_EWL_PATH, CW_GCC_PATH
739718
from workspace_tools.settings import IAR_PATH

0 commit comments

Comments
 (0)