Merge remote-tracking branch 'upstream/master'

pull/1023/head
U-owner-PC\owner 2015-02-23 08:11:48 -08:00
commit 88fcf53069
11 changed files with 103 additions and 38 deletions

View File

@ -5,7 +5,7 @@
; *(InRoot$$Sections)
; .ANY (+RO)
; }
; RW_IRAM1 0x20000000 0x00004000 {
; RW_IRAM1 0x20000000 0x00008000 {
; .ANY (+RW +ZI)
; }
;}

View File

@ -53,7 +53,9 @@ typedef enum {
UART_3 = (int)USART3_BASE,
UART_4 = (int)UART4_BASE,
UART_5 = (int)UART5_BASE,
UART_6 = (int)USART6_BASE
UART_6 = (int)USART6_BASE,
UART_7 = (int)UART7_BASE,
UART_8 = (int)UART8_BASE
} UARTName;
#define STDIO_UART_TX PD_8

View File

@ -133,12 +133,14 @@ const PinMap PinMap_PWM[] = {
const PinMap PinMap_UART_TX[] = {
{PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
{PD_8, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
{PF_7, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)},
{NC, NC, 0}
};
const PinMap PinMap_UART_RX[] = {
{PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
{PD_9, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
{PF_6, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)},
{NC, NC, 0}
};

View File

@ -37,9 +37,9 @@
#include <string.h>
#include "PeripheralPins.h"
#define UART_NUM (6)
#define UART_NUM (8)
static uint32_t serial_irq_ids[UART_NUM] = {0, 0, 0, 0, 0, 0};
static uint32_t serial_irq_ids[UART_NUM] = {0, 0, 0, 0, 0, 0, 0, 0};
static uart_irq_handler irq_handler;
@ -111,6 +111,18 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
__USART6_CLK_ENABLE();
obj->index = 5;
break;
#if defined(UART7_BASE)
case UART_7:
__UART7_CLK_ENABLE();
obj->index = 6;
break;
#endif
#if defined(UART8_BASE)
case UART_8:
__UART8_CLK_ENABLE();
obj->index = 7;
break;
#endif
}
// Configure the UART pins
@ -181,6 +193,20 @@ void serial_free(serial_t *obj)
__USART6_RELEASE_RESET();
__USART6_CLK_DISABLE();
break;
#if defined(UART7_BASE)
case UART_7:
__UART7_FORCE_RESET();
__UART7_RELEASE_RESET();
__UART7_CLK_DISABLE();
break;
#endif
#if defined(UART8_BASE)
case UART_8:
__UART8_FORCE_RESET();
__UART8_RELEASE_RESET();
__UART8_CLK_DISABLE();
break;
#endif
}
// Configure GPIOs
pin_function(obj->pin_tx, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0));
@ -281,6 +307,20 @@ static void uart6_irq(void)
uart_irq(UART_6, 5);
}
#if defined(UART7_BASE)
static void uart7_irq(void)
{
uart_irq(UART_7, 6);
}
#endif
#if defined(UART8_BASE)
static void uart8_irq(void)
{
uart_irq(UART_8, 7);
}
#endif
void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id)
{
irq_handler = handler;
@ -326,6 +366,18 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
irq_n = USART6_IRQn;
vector = (uint32_t)&uart6_irq;
break;
#if defined(UART7_BASE)
case UART_7:
irq_n = UART7_IRQn;
vector = (uint32_t)&uart7_irq;
break;
#endif
#if defined(UART8_BASE)
case UART_8:
irq_n = UART8_IRQn;
vector = (uint32_t)&uart8_irq;
break;
#endif
}
if (enable) {

View File

@ -55,7 +55,7 @@ def test_export(toolchain, target, expected_error=None):
temp_dir = join(base_dir, "temp")
mkdir(temp_dir)
zip_path, report = export(USER_PRJ, USR_PRJ_NAME, toolchain, target, base_dir, temp_dir, False, fake_build_url_resolver)
zip_path, report = export(USER_PRJ, USR_PRJ_NAME, toolchain, target, base_dir, temp_dir, False, None, fake_build_url_resolver)
if report['success']:
move(zip_path, join(EXPORT_DIR, "export_%s_%s.zip" % (toolchain, target)))

View File

@ -38,8 +38,9 @@ class RTCTest():
sec = int(m.groups()[0])
time_str = m.groups()[1]
correct_time_str = strftime("%Y-%m-%d %H:%M:%S %p", gmtime(float(sec)))
test_result = test_result and (time_str == correct_time_str)
result_msg = "OK" if (time_str == correct_time_str and sec > 0 and sec > sec_prev) else "FAIL"
single_result = time_str == correct_time_str and sec > 0 and sec > sec_prev
test_result = test_result and single_result
result_msg = "OK" if single_result else "FAIL"
selftest.notify("HOST: [%s] [%s] received time %+d sec after %.2f sec... %s"% (sec, time_str, sec - sec_prev, delta, result_msg))
sec_prev = sec
else:

View File

@ -20,9 +20,6 @@ import socket
from sys import stdout
from SocketServer import BaseRequestHandler, TCPServer
SERVER_IP = str(socket.gethostbyname(socket.getfqdn()))
SERVER_PORT = 7
class TCPEchoClient_Handler(BaseRequestHandler):
def handle(self):
""" One handle per connection
@ -67,6 +64,22 @@ class TCPEchoClientTest():
selftest.notify(c.strip())
def test(self, selftest):
# We need to discover SERVEP_IP and set up SERVER_PORT
# Note: Port 7 is Echo Protocol:
#
# Port number rationale:
#
# The Echo Protocol is a service in the Internet Protocol Suite defined
# in RFC 862. It was originally proposed for testing and measurement
# of round-trip times[citation needed] in IP networks.
#
# A host may connect to a server that supports the Echo Protocol using
# the Transmission Control Protocol (TCP) or the User Datagram Protocol
# (UDP) on the well-known port number 7. The server sends back an
# identical copy of the data it received.
SERVER_IP = str(socket.gethostbyname(socket.getfqdn()))
SERVER_PORT = 7
# Returning none will suppress host test from printing success code
server = TCPServer((SERVER_IP, SERVER_PORT), TCPEchoClient_Handler)
print "HOST: Listening for TCP connections: " + SERVER_IP + ":" + str(SERVER_PORT)

View File

@ -20,9 +20,6 @@ import socket
from sys import stdout
from SocketServer import BaseRequestHandler, UDPServer
SERVER_IP = str(socket.gethostbyname(socket.getfqdn()))
SERVER_PORT = 7
class UDPEchoClient_Handler(BaseRequestHandler):
def handle(self):
""" One handle per connection
@ -57,6 +54,22 @@ class UDPEchoClientTest():
return selftest.RESULT_PASSIVE
def test(self, selftest):
# We need to discover SERVEP_IP and set up SERVER_PORT
# Note: Port 7 is Echo Protocol:
#
# Port number rationale:
#
# The Echo Protocol is a service in the Internet Protocol Suite defined
# in RFC 862. It was originally proposed for testing and measurement
# of round-trip times[citation needed] in IP networks.
#
# A host may connect to a server that supports the Echo Protocol using
# the Transmission Control Protocol (TCP) or the User Datagram Protocol
# (UDP) on the well-known port number 7. The server sends back an
# identical copy of the data it received.
SERVER_IP = str(socket.gethostbyname(socket.getfqdn()))
SERVER_PORT = 7
# Returning none will suppress host test from printing success code
server = UDPServer((SERVER_IP, SERVER_PORT), UDPEchoClient_Handler)
print "HOST: Listening for UDP connections..."

View File

@ -137,14 +137,16 @@ if __name__ == '__main__':
test_spec = None
MUTs = None
if opts.auto_detect:
if hasattr(opts, 'auto_detect') and opts.auto_detect:
# If auto_detect attribute is present, we assume other auto-detection
# parameters like 'toolchains_filter' are also set.
print "MBEDLS: Detecting connected mbed-enabled devices... "
if get_module_avail('mbed_lstools'):
mbeds = mbed_lstools.create()
muts_list = mbeds.list_mbeds()
for mut in muts_list:
print "MBEDLS: Detected %s, port: %s, mounted: %s"% (mut['platform_name'],
print "MBEDLS: Detected %s, port: %s, mounted: %s"% (mut['platform_name'],
mut['serial_port'],
mut['mount_point'])

View File

@ -415,6 +415,8 @@ class K20D50M(Target):
self.detect_code = ["0230"]
class TEENSY3_1(Target):
OUTPUT_EXT = '.hex'
def __init__(self):
Target.__init__(self)
self.core = "Cortex-M4"
@ -423,7 +425,6 @@ class TEENSY3_1(Target):
self.is_disk_virtual = True
self.detect_code = ["0230"]
OUTPUT_EXT = '.hex'
def init_hooks(self, hook, toolchain_name):
if toolchain_name in ['ARM_STD', 'ARM_MICRO', 'GCC_ARM']:

View File

@ -17,7 +17,6 @@ limitations under the License.
import re
import sys
import colorama
from os import stat, walk
from copy import copy
from time import time, sleep
@ -50,23 +49,6 @@ def print_notify(event, silent=False):
if not silent:
print '%s: %s' % (event['action'].title(), basename(event['file']))
def print_notify_color(event, silent=False):
""" Default command line notification with colors
"""
from colorama import Fore, Back, Style
if event['type'] in ['info', 'debug']:
print Fore.GREEN + event['message'] + Fore.RESET
elif event['type'] == 'cc':
event['severity'] = event['severity'].title()
event['file'] = basename(event['file'])
print Fore.YELLOW + '[%(severity)s] %(file)s@%(line)s: %(message)s'% event + Fore.RESET
elif event['type'] == 'progress':
if not silent:
print '%s: %s' % (event['action'].title(), basename(event['file']))
def print_notify_verbose(event, silent=False):
""" Default command line notification with more verbose mode
"""
@ -239,7 +221,7 @@ class mbedToolchain:
self.legacy_ignore_dirs = LEGACY_IGNORE_DIRS - set([target.name, LEGACY_TOOLCHAIN_NAMES[self.name]])
self.notify_fun = notify if notify is not None else print_notify_color
self.notify_fun = notify if notify is not None else print_notify
self.options = options if options is not None else []
self.macros = macros or []
@ -731,9 +713,6 @@ class mbedToolchain:
def var(self, key, value):
self.notify({'type': 'var', 'key': key, 'val': value})
from colorama import init
init()
from workspace_tools.settings import ARM_BIN
from workspace_tools.settings import GCC_ARM_PATH, GCC_CR_PATH, GCC_CS_PATH, CW_EWL_PATH, CW_GCC_PATH
from workspace_tools.settings import IAR_PATH