From 2b57ae9c23a1d8069d59ea3eeba28aa9943572f8 Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Wed, 3 Jul 2013 19:39:19 +0200 Subject: [PATCH] KL25 + KL05 - no pull down, pullup for INPUT pins by default - pull down removal - ARMCC - debug information option --- .../hal/Freescale/TARGET_KL05Z/PinNames.h | 4 +- .../hal/Freescale/TARGET_KL05Z/analogin_api.c | 2 +- .../hal/Freescale/TARGET_KL05Z/gpio_api.c | 6 +- .../hal/Freescale/TARGET_KL05Z/i2c_api.c | 8 +- .../hal/Freescale/TARGET_KL05Z/pinmap.c | 4 +- .../hal/Freescale/TARGET_KL05Z/pwmout_api.c | 9 +- .../hal/Freescale/TARGET_KL05Z/serial_api.c | 2 +- .../hal/Freescale/TARGET_KL05Z/us_ticker.c | 20 +- .../hal/Freescale/TARGET_KL25Z/PinNames.h | 4 +- .../hal/Freescale/TARGET_KL25Z/gpio_api.c | 2 +- workspace_tools/targets.py.orig | 205 +++++ workspace_tools/tests.py.orig | 707 ++++++++++++++++++ workspace_tools/toolchains/arm.py | 2 + workspace_tools/txt.txt | 33 + 14 files changed, 981 insertions(+), 27 deletions(-) create mode 100644 workspace_tools/targets.py.orig create mode 100644 workspace_tools/tests.py.orig create mode 100644 workspace_tools/txt.txt diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/PinNames.h b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/PinNames.h index 51198dc8cc..041581fa53 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/PinNames.h +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/PinNames.h @@ -116,10 +116,10 @@ typedef enum { NC = (int)0xFFFFFFFF } PinName; +/* PullDown not available for KL05 */ typedef enum { PullNone = 0, - PullDown = 2, - PullUp = 3, + PullUp = 2, } PinMode; #ifdef __cplusplus diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/analogin_api.c b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/analogin_api.c index d56fdebe1f..33fb22d746 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/analogin_api.c +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/analogin_api.c @@ -78,7 +78,7 @@ uint16_t analogin_read_u16(analogin_t *obj) { // Wait Conversion Complete while ((ADC0->SC1[0] & ADC_SC1_COCO_MASK) != ADC_SC1_COCO_MASK); - // Return value (12bit !!) + // Return value (12bit) return (uint16_t)ADC0->R[0]; } diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/gpio_api.c b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/gpio_api.c index 405eab194a..566fff8ecf 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/gpio_api.c +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/gpio_api.c @@ -22,7 +22,9 @@ uint32_t gpio_set(PinName pin) { } void gpio_init(gpio_t *obj, PinName pin, PinDirection direction) { - if (pin == (uint32_t)NC) return; + if (pin == (uint32_t)NC) { + return; + } obj->pin = pin; obj->mask = gpio_set(pin); @@ -41,7 +43,7 @@ void gpio_init(gpio_t *obj, PinName pin, PinDirection direction) { pin_mode(pin, PullNone); break; case PIN_INPUT : - pin_mode(pin, PullDown); + pin_mode(pin, PullUp); //down not avail break; } } diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/i2c_api.c b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/i2c_api.c index 332b31722d..7b54b932a3 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/i2c_api.c +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/i2c_api.c @@ -56,13 +56,12 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl) { error("I2C pin mapping failed"); } - // enable power + // enable clocks switch ((int)obj->i2c) { case I2C_0: SIM->SCGC5 |= SIM_SCGC5_PORTB_MASK; SIM->SCGC4 |= SIM_SCGC4_I2C0_MASK; break; - } // set default frequency at 100k @@ -169,10 +168,11 @@ static int i2c_do_write(i2c_t *obj, int value) { } static int i2c_do_read(i2c_t *obj, char * data, int last) { - if (last) + if (last) { i2c_send_nack(obj); - else + } else { i2c_send_ack(obj); + } *data = (obj->i2c->D & 0xFF); diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/pinmap.c b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/pinmap.c index a7a3ee9adf..b029879f05 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/pinmap.c +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/pinmap.c @@ -17,7 +17,9 @@ #include "error.h" void pin_function(PinName pin, int function) { - if (pin == (uint32_t)NC) return; + if (pin == (uint32_t)NC) { + return; + } uint32_t port_n = (uint32_t)pin >> PORT_SHIFT; uint32_t pin_n = (uint32_t)(pin & 0x7C) >> 2; diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/pwmout_api.c b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/pwmout_api.c index 96bdc18ab3..cee212056a 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/pwmout_api.c +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/pwmout_api.c @@ -42,8 +42,9 @@ static const PinMap PinMap_PWM[] = { void pwmout_init(pwmout_t* obj, PinName pin) { // determine the channel PWMName pwm = (PWMName)pinmap_peripheral(pin, PinMap_PWM); - if (pwm == (uint32_t)NC) + if (pwm == (uint32_t)NC) { error("PwmOut pin mapping failed"); + } unsigned int port = (unsigned int)pin >> PORT_SHIFT; unsigned int tpm_n = (pwm >> TPM_SHIFT); @@ -55,7 +56,7 @@ void pwmout_init(pwmout_t* obj, PinName pin) { TPM_Type *tpm = (TPM_Type *)(TPM0_BASE + 0x1000 * tpm_n); tpm->SC = TPM_SC_CMOD(1) | TPM_SC_PS(6); // (48)MHz / 64 = (0.75)MHz - tpm->CONTROLS[ch_n].CnSC = (TPM_CnSC_MSB_MASK | TPM_CnSC_ELSB_MASK); /* No Interrupts; High True pulses on Edge Aligned PWM */ + tpm->CONTROLS[ch_n].CnSC = (TPM_CnSC_MSB_MASK | TPM_CnSC_ELSB_MASK); // No Interrupts; High True pulses on Edge Aligned PWM obj->CnV = &tpm->CONTROLS[ch_n].CnV; obj->MOD = &tpm->MOD; @@ -69,7 +70,9 @@ void pwmout_init(pwmout_t* obj, PinName pin) { pinmap_pinout(pin, PinMap_PWM); } -void pwmout_free(pwmout_t* obj) {} +void pwmout_free(pwmout_t* obj) { + +} void pwmout_write(pwmout_t* obj, float value) { if (value < 0.0) { diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/serial_api.c b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/serial_api.c index c151478489..94b6047af7 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/serial_api.c +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/serial_api.c @@ -25,6 +25,7 @@ #include "error.h" #define UART_CLOCK_HZ 47972352u +#define UART_NUM 1 static const PinMap PinMap_UART_TX[] = { {PTB1, UART_0, 2}, @@ -36,7 +37,6 @@ static const PinMap PinMap_UART_RX[] = { {NC , NC , 0} }; -#define UART_NUM 1 static uint32_t serial_irq_ids[UART_NUM] = {0}; static uart_irq_handler irq_handler; diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/us_ticker.c b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/us_ticker.c index 9b25a817c7..f4a99cf2b8 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/us_ticker.c +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL05Z/us_ticker.c @@ -29,7 +29,9 @@ static uint16_t us_ticker_int_remainder = 0; void us_ticker_init(void) { - if (us_ticker_inited) return; + if (us_ticker_inited) { + return; + } us_ticker_inited = 1; pit_init(); @@ -51,25 +53,23 @@ static void pit_init(void) { } uint32_t us_ticker_read() { - if (!us_ticker_inited) + if (!us_ticker_inited) { us_ticker_init(); + } // The PIT is a countdown timer return ~(PIT->CHANNEL[1].CVAL); } static void lptmr_init(void) { - /* Clock the timer */ SIM->SCGC5 |= SIM_SCGC5_LPTMR_MASK; - /* Reset */ LPTMR0->CSR = 0; - /* Set interrupt handler */ NVIC_SetVector(LPTimer_IRQn, (uint32_t)lptmr_isr); NVIC_EnableIRQ(LPTimer_IRQn); - /* Clock at (1)MHz -> (1)tick/us */ + // Clock at (1)MHz -> (1)tick/us LPTMR0->PSR = LPTMR_PSR_PCS(0); // MCGIRCLK -> 2MHz / presc 2 = 1MHz } @@ -82,16 +82,16 @@ void us_ticker_clear_interrupt(void) { } static void lptmr_set(unsigned short count) { - /* Reset */ + // Reset LPTMR0->CSR = 0; - /* Set the compare register */ + // Set the compare register LPTMR0->CMR = count; - /* Enable interrupt */ + // Enable interrupt LPTMR0->CSR |= LPTMR_CSR_TIE_MASK; - /* Start the timer */ + // Start the timer LPTMR0->CSR |= LPTMR_CSR_TEN_MASK; } diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL25Z/PinNames.h b/libraries/mbed/targets/hal/Freescale/TARGET_KL25Z/PinNames.h index 2fb37ebafd..e67c5a3221 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL25Z/PinNames.h +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL25Z/PinNames.h @@ -234,10 +234,10 @@ typedef enum { NC = (int)0xFFFFFFFF } PinName; +/* PullDown not available for KL25 */ typedef enum { PullNone = 0, - PullDown = 2, - PullUp = 3, + PullUp = 2, } PinMode; #ifdef __cplusplus diff --git a/libraries/mbed/targets/hal/Freescale/TARGET_KL25Z/gpio_api.c b/libraries/mbed/targets/hal/Freescale/TARGET_KL25Z/gpio_api.c index 523151fd87..d5dca3f536 100644 --- a/libraries/mbed/targets/hal/Freescale/TARGET_KL25Z/gpio_api.c +++ b/libraries/mbed/targets/hal/Freescale/TARGET_KL25Z/gpio_api.c @@ -38,7 +38,7 @@ void gpio_init(gpio_t *obj, PinName pin, PinDirection direction) { gpio_dir(obj, direction); switch (direction) { case PIN_OUTPUT: pin_mode(pin, PullNone); break; - case PIN_INPUT : pin_mode(pin, PullDown); break; + case PIN_INPUT : pin_mode(pin, PullUp); break; } } diff --git a/workspace_tools/targets.py.orig b/workspace_tools/targets.py.orig new file mode 100644 index 0000000000..46e8563eae --- /dev/null +++ b/workspace_tools/targets.py.orig @@ -0,0 +1,205 @@ +CORE_LABELS = { + "ARM7TDMI-S": "ARM7", + "Cortex-M0" : "M0", + "Cortex-M0+": "M0P", + "Cortex-M3" : "M3", + "Cortex-M4" : "M4" +} + + +class Target: + def __init__(self): + # ARM Core + self.core = None +<<<<<<< HEAD + + # The silicon vendor of this chip + self.vendor = None + +======= + +>>>>>>> master + # How much time (in seconds) it takes to the interface chip to flash a + # new image and reset the target chip + self.program_cycle_s = 1.5 + + # list of toolchains that are supported by the mbed SDK for this target + self.supported_toolchains = None +<<<<<<< HEAD + +======= + + # list of extra specific labels + self.extra_labels = [] + +>>>>>>> master + self.name = self.__class__.__name__ + + def get_labels(self): + return [self.name, CORE_LABELS[self.core]] + self.extra_labels + + +class LPC2368(Target): + def __init__(self): + Target.__init__(self) + + self.core = "ARM7TDMI-S" +<<<<<<< HEAD + self.vendor = "NXP" + +======= + + self.extra_labels = ['LPC23XX'] + +>>>>>>> master + self.supported_toolchains = ["ARM"] + + +class LPC1768(Target): + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M3" +<<<<<<< HEAD + self.vendor = "NXP" + +======= + + self.extra_labels = ['LPC176X'] + +>>>>>>> master + self.supported_toolchains = ["ARM", "GCC_ARM", "GCC_CS", "GCC_CR", "IAR"] + + +class LPC11U24(Target): + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M0" +<<<<<<< HEAD + self.vendor = "NXP" + +======= + + self.extra_labels = ['LPC11UXX'] + +>>>>>>> master + self.supported_toolchains = ["ARM", "uARM"] + + +class KL05Z(Target): + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M0+" + self.vendor = "Freescale" + + self.supported_toolchains = ["ARM"] + + self.program_cycle_s = 4 + + +class KL25Z(Target): + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M0+" +<<<<<<< HEAD + self.vendor = "Freescale" + +======= + +>>>>>>> master + self.supported_toolchains = ["ARM", "GCC_CW_EWL", "GCC_CW_NEWLIB"] + + self.program_cycle_s = 4 + + +class LPC812(Target): + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M0+" +<<<<<<< HEAD + self.vendor = "NXP" + +======= + + self.extra_labels = ['LPC81X'] + +>>>>>>> master + self.supported_toolchains = ["uARM"] + + self.program_cycle_s = 4 + + +class LPC4088(Target): + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M4" +<<<<<<< HEAD + self.vendor = "NXP" + + self.supported_toolchains = ["ARM", "GCC_CR"] + + +class MBED_MCU(Target): +======= + + self.extra_labels = ['LPC408X'] + + self.supported_toolchains = ["ARM", "GCC_CR"] + + +class LPC4330(Target): + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M4" + + self.extra_labels = ['LPC43XX'] + + self.supported_toolchains = ["ARM", "GCC_CR", "IAR"] + +class STM32F407(Target): +>>>>>>> master + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M4" + + self.extra_labels = ['STM32F4XX'] + + self.supported_toolchains = ["GCC_ARM"] + + +class MBED_MCU(Target): + def __init__(self): + Target.__init__(self) + + self.core = "Cortex-M0+" + + self.supported_toolchains = ["ARM"] + + +# Get a single instance for each target +TARGETS = [ + LPC2368(), + LPC1768(), + LPC11U24(), + KL05Z(), + KL25Z(), + LPC812(), + LPC4088(), + LPC4330(), + STM32F407(), + MBED_MCU() +] + +# Map each target name to its unique instance +TARGET_MAP = {} +for t in TARGETS: + TARGET_MAP[t.name] = t + +TARGET_NAMES = TARGET_MAP.keys() diff --git a/workspace_tools/tests.py.orig b/workspace_tools/tests.py.orig new file mode 100644 index 0000000000..9e2a9bfbf5 --- /dev/null +++ b/workspace_tools/tests.py.orig @@ -0,0 +1,707 @@ +from workspace_tools.paths import * +from workspace_tools.data.support import * + +TEST_CMSIS_LIB = join(TEST_DIR, "cmsis", "lib") +TEST_MBED_LIB = join(TEST_DIR, "mbed", "env") + +PERIPHERALS = join(TEST_DIR, "peripherals") +BENCHMARKS_DIR = join(TEST_DIR, "benchmarks") +SD = join(TEST_DIR, "sd") + +""" +Wiring: + * Ground: + * LPC1*: p1 + * KL25Z: GND + + * Vout + * LPC1*: p40 + * KL25Z: P3V3 + + * TMP102 (I2C): + * LPC1*: (SDA=p28 , SCL=p27) + * KL25Z: (SDA=PTC9, SCL=PTC8) + + * digital_loop (Digital(In|Out|InOut), InterruptIn): + * LPC1*: (p5 <-> p25 ) + * KL25Z: (PTA1 <-> PTC7) + + * port_loop (Port(In|Out|InOut)): + * LPC1*: (p5 <-> p25 ), (p6 <-> p26 ) + * KL25Z: (PTA1 <-> PTC7), (PTA2 <-> PTC0) + + * analog_loop (AnalogIn, AnalogOut): + * LPC1*: (p17 <-> p18 ) + * KL25Z: (PTE30 <-> PTC2) + + * SD (SPI): + * LPC1*: (mosi=p11 , miso=p12 , sclk=p13 , cs=p14 ) + * KL25Z: (mosi=PTD2, miso=PTD3, sclk=PTD1, cs=PTD0) + + * MMA7660 (I2C): + * LPC1*: (SDA=p28 , SCL=p27) +""" +TESTS = [ + # Automated MBED tests + { + "id": "MBED_A1", "description": "Basic", + "source_dir": join(TEST_DIR, "mbed", "basic"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + }, + { + "id": "MBED_A2", "description": "semihost file system", + "source_dir": join(TEST_DIR, "mbed", "file"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + "mcu": ["LPC1768", "LPC2368", "LPC11U24"] + }, + { + "id": "MBED_A3", "description": "C++ STL", + "source_dir": join(TEST_DIR, "mbed", "stl"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + }, + { + "id": "MBED_A4", "description": "I2C TMP102", + "source_dir": join(TEST_DIR, "mbed", "i2c_TMP102"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'TMP102')], + "automated": True, + "peripherals": ["TMP102"] + }, + { + "id": "MBED_A5", "description": "DigitalIn DigitalOut", + "source_dir": join(TEST_DIR, "mbed", "digitalin_digitalout"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + "peripherals": ["digital_loop"] + }, + { + "id": "MBED_A6", "description": "DigitalInOut", + "source_dir": join(TEST_DIR, "mbed", "digitalinout"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + "peripherals": ["digital_loop"] + }, + { + "id": "MBED_A7", "description": "InterruptIn", + "source_dir": join(TEST_DIR, "mbed", "interruptin"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + "peripherals": ["digital_loop"] + }, + { + "id": "MBED_A8", "description": "Analog", + "source_dir": join(TEST_DIR, "mbed", "analog"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + "peripherals": ["analog_loop"], + "mcu": ["LPC1768", "LPC2368", "KL25Z"] + }, + { + "id": "MBED_A9", "description": "Serial Echo at 115200", + "source_dir": join(TEST_DIR, "mbed", "echo"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "automated": True, + "host_test": "echo" + }, + { + "id": "MBED_A10", "description": "PortOut PortIn", + "source_dir": join(TEST_DIR, "mbed", "portout_portin"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "peripherals": ["port_loop"], + "supported": DEFAULT_SUPPORT, + "automated": True, + }, + { + "id": "MBED_A11", "description": "PortInOut", + "source_dir": join(TEST_DIR, "mbed", "portinout"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "peripherals": ["port_loop"], + "supported": DEFAULT_SUPPORT, + "automated": True, + }, + { + "id": "MBED_A12", "description": "SD File System", + "source_dir": join(TEST_DIR, "mbed", "sd"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, SD_FS, FAT_FS], + "automated": True, + "peripherals": ["SD"] + }, + { + "id": "MBED_A13", "description": "I2C MMA7660", + "source_dir": join(TEST_DIR, "mbed", "i2c_MMA7660"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'MMA7660')], + "automated": True, + "peripherals": ["MMA7660"] + }, + { + "id": "MBED_A14", "description": "I2C Master", + "source_dir": join(TEST_DIR, "mbed", "i2c_master"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], + "automated": True + }, + { + "id": "MBED_A15", "description": "I2C Slave", + "source_dir": join(TEST_DIR, "mbed", "i2c_slave"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], + "automated": True + }, + { + "id": "MBED_A16", "description": "SPI Master", + "source_dir": join(TEST_DIR, "mbed", "spi_master"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], + "automated": True + }, + { + "id": "MBED_A17", "description": "SPI Slave", + "source_dir": join(TEST_DIR, "mbed", "spi_slave"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], + "automated": True + }, + + # Size benchmarks + { + "id": "BENCHMARK_1", "description": "Size (c environment)", + "source_dir": join(BENCHMARKS_DIR, "cenv"), + "dependencies": [MBED_LIBRARIES] + }, + { + "id": "BENCHMARK_2", "description": "Size (float math)", + "source_dir": join(BENCHMARKS_DIR, "float_math"), + "dependencies": [MBED_LIBRARIES] + }, + { + "id": "BENCHMARK_3", "description": "Size (printf)", + "source_dir": join(BENCHMARKS_DIR, "printf"), + "dependencies": [MBED_LIBRARIES] + }, + { + "id": "BENCHMARK_4", "description": "Size (mbed libs)", + "source_dir": join(BENCHMARKS_DIR, "mbed"), + "dependencies": [MBED_LIBRARIES] + }, + { + "id": "BENCHMARK_5", "description": "Size (all)", + "source_dir": join(BENCHMARKS_DIR, "all"), + "dependencies": [MBED_LIBRARIES] + }, + + # Not automated MBED tests + { + "id": "MBED_1", "description": "I2C SRF08", + "source_dir": join(TEST_DIR, "mbed", "i2c_SRF08"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'SRF08')], + "peripherals": ["SRF08"] + }, + { + "id": "MBED_2", "description": "stdio", + "source_dir": join(TEST_DIR, "mbed", "stdio"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_3", "description": "PortOut", + "source_dir": join(TEST_DIR, "mbed", "portout"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_4", "description": "Sleep", + "source_dir": join(TEST_DIR, "mbed", "sleep"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + "duration": 30, + "mcu": ["LPC1768", "LPC11U24"] + }, + { + "id": "MBED_5", "description": "PWM", + "source_dir": join(TEST_DIR, "mbed", "pwm"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_6", "description": "SW Reset", + "source_dir": join(TEST_DIR, "mbed", "reset"), + "dependencies": [MBED_LIBRARIES], + "duration": 15 + }, + { + "id": "MBED_7", "description": "stdio benchmark", + "source_dir": join(TEST_DIR, "mbed", "stdio_benchmark"), + "dependencies": [MBED_LIBRARIES], + "duration": 40 + }, + { + "id": "MBED_8", "description": "SPI", + "source_dir": join(TEST_DIR, "mbed", "spi"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_9", "description": "Sleep Timeout", + "source_dir": join(TEST_DIR, "mbed", "sleep_timeout"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_10", "description": "Hello World", + "source_dir": join(TEST_DIR, "mbed", "hello"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_11", "description": "Ticker", + "source_dir": join(TEST_DIR, "mbed", "ticker"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_12", "description": "C++", + "source_dir": join(TEST_DIR, "mbed", "cpp"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_13", "description": "Heap & Stack", + "source_dir": join(TEST_DIR, "mbed", "heap_and_stack"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_14", "description": "Serial Interrupt", + "source_dir": join(TEST_DIR, "mbed", "serial_interrupt"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_15", "description": "RPC", + "source_dir": join(TEST_DIR, "mbed", "rpc"), + "dependencies": [MBED_LIBRARIES, join(LIB_DIR, "rpc")], + "host_test": "rpc", + }, + { + "id": "MBED_16", "description": "RTC", + "source_dir": join(TEST_DIR, "mbed", "rtc"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_17", "description": "Serial Interrupt 2", + "source_dir": join(TEST_DIR, "mbed", "serial_interrupt_2"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_18", "description": "Local FS Directory", + "source_dir": join(TEST_DIR, "mbed", "dir"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_19", "description": "SD FS Directory", + "source_dir": join(TEST_DIR, "mbed", "dir_sd"), + "dependencies": [MBED_LIBRARIES, SD_FS, FAT_FS], + "peripherals": ["SD"] + }, + { + "id": "MBED_20", "description": "InterruptIn 2", + "source_dir": join(TEST_DIR, "mbed", "interruptin_2"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_21", "description": "freopen Stream", + "source_dir": join(TEST_DIR, "mbed", "freopen"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "MBED_22", "description": "Semihost", + "source_dir": join(TEST_DIR, "mbed", "semihost"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_23", "description": "Ticker 2", + "source_dir": join(TEST_DIR, "mbed", "ticker_2"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_24", "description": "Timeout", + "source_dir": join(TEST_DIR, "mbed", "timeout"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_25", "description": "Time us", + "source_dir": join(TEST_DIR, "mbed", "time_us"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_26", "description": "Integer constant division", + "source_dir": join(TEST_DIR, "mbed", "div"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], + }, + { + "id": "MBED_27", "description": "SPI ADXL345", + "source_dir": join(TEST_DIR, "mbed", "spi_ADXL345"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'ADXL345')], + "automated": True, + "peripherals": ["ADXL345"] + }, + + # CMSIS RTOS tests + { + "id": "CMSIS_RTOS_1", "description": "Basic", + "source_dir": join(TEST_DIR, "rtos", "cmsis", "basic"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "CMSIS_RTOS_2", "description": "Mutex", + "source_dir": join(TEST_DIR, "rtos", "cmsis", "mutex"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + "duration": 20 + }, + { + "id": "CMSIS_RTOS_3", "description": "Semaphore", + "source_dir": join(TEST_DIR, "rtos", "cmsis", "semaphore"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + "duration": 20 + }, + { + "id": "CMSIS_RTOS_4", "description": "Signals", + "source_dir": join(TEST_DIR, "rtos", "cmsis", "signals"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "CMSIS_RTOS_5", "description": "Queue", + "source_dir": join(TEST_DIR, "rtos", "cmsis", "queue"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + "duration": 20 + }, + { + "id": "CMSIS_RTOS_6", "description": "Mail", + "source_dir": join(TEST_DIR, "rtos", "cmsis", "mail"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + "duration": 20 + }, + { + "id": "CMSIS_RTOS_7", "description": "Timer", + "source_dir": join(TEST_DIR, "rtos", "cmsis", "timer"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "CMSIS_RTOS_8", "description": "ISR", + "source_dir": join(TEST_DIR, "rtos", "cmsis", "isr"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + + # mbed RTOS tests + { + "id": "RTOS_1", "description": "Basic", + "source_dir": join(TEST_DIR, "rtos", "mbed", "basic"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "RTOS_2", "description": "Mutex", + "source_dir": join(TEST_DIR, "rtos", "mbed", "mutex"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + "duration": 20 + }, + { + "id": "RTOS_3", "description": "Semaphore", + "source_dir": join(TEST_DIR, "rtos", "mbed", "semaphore"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "RTOS_4", "description": "Signals", + "source_dir": join(TEST_DIR, "rtos", "mbed", "signals"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "RTOS_5", "description": "Queue", + "source_dir": join(TEST_DIR, "rtos", "mbed", "queue"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "RTOS_6", "description": "Mail", + "source_dir": join(TEST_DIR, "rtos", "mbed", "mail"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "RTOS_7", "description": "Timer", + "source_dir": join(TEST_DIR, "rtos", "mbed", "timer"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "RTOS_8", "description": "ISR", + "source_dir": join(TEST_DIR, "rtos", "mbed", "isr"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES], + }, + { + "id": "RTOS_9", "description": "File", + "source_dir": join(TEST_DIR, "rtos", "mbed", "file"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, TEST_MBED_LIB, SD_FS, FAT_FS], + }, + + # Networking Tests + { + "id": "NET_1", "description": "TCP client hello world", + "source_dir": join(TEST_DIR, "net", "helloworld", "tcpclient"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_2", "description": "UDP client hello world", + "source_dir": join(TEST_DIR, "net", "helloworld", "udpclient"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_3", "description": "TCP echo server", + "source_dir": join(TEST_DIR, "net", "echo", "tcp_server"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_4", "description": "TCP echo client", + "source_dir": join(TEST_DIR, "net", "echo", "tcp_client"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_5", "description": "UDP echo server", + "source_dir": join(TEST_DIR, "net", "echo", "udp_server"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_6", "description": "UDP echo client", + "source_dir": join(TEST_DIR, "net", "echo", "udp_client"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_7", "description": "HTTP client", + "source_dir": join(TEST_DIR, "net", "protocols", "HTTPClient_HelloWorld"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_8", "description": "NTP client", + "source_dir": join(TEST_DIR, "net", "protocols", "NTPClient_HelloWorld"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_9", "description": "Multicast Send", + "source_dir": join(TEST_DIR, "net", "helloworld", "multicast_send"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_10", "description": "Multicast Receive", + "source_dir": join(TEST_DIR, "net", "helloworld", "multicast_receive"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_11", "description": "Broadcast Send", + "source_dir": join(TEST_DIR, "net", "helloworld", "broadcast_send"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_12", "description": "Broadcast Receive", + "source_dir": join(TEST_DIR, "net", "helloworld", "broadcast_receive"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "NET_13", "description": "TCP client echo loop", + "source_dir": join(TEST_DIR, "net", "echo", "tcp_client_loop"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, ETH_LIBRARY], + "supported": CORTEX_ARM_SUPPORT, + }, + + # Vodafone tests + { + "id": "VF_1", "description": "HTTP client", + "source_dir": join(TEST_DIR, "net", "vodafone", "HTTPClient_HelloWorld"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, VODAFONE_LIBRARY, TEST_MBED_LIB], + "supported": CORTEX_ARM_SUPPORT, + "automated": False, + }, + { + "id": "VF_2", "description": "USSD & SMS Test", + "source_dir": join(TEST_DIR, "net", "vodafone", "USSD_SMS_HelloWorld"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, VODAFONE_LIBRARY, TEST_MBED_LIB], + "supported": CORTEX_ARM_SUPPORT, + "automated": False, + }, + + # USB Tests + { + "id": "USB_1", "description": "Mouse", + "source_dir": join(TEST_DIR, "usb", "device", "basic"), + "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "USB_2", "description": "Keyboard", + "source_dir": join(TEST_DIR, "usb", "device", "keyboard"), + "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "USB_3", "description": "Mouse_Keyboard", + "source_dir": join(TEST_DIR, "usb", "device", "keyboard"), + "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "USB_4", "description": "Serial Port", + "source_dir": join(TEST_DIR, "usb", "device", "serial"), + "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "USB_5", "description": "Generic HID", + "source_dir": join(TEST_DIR, "usb", "device", "raw_hid"), + "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "USB_6", "description": "MIDI", + "source_dir": join(TEST_DIR, "usb", "device", "midi"), + "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + { + "id": "USB_7", "description": "AUDIO", + "source_dir": join(TEST_DIR, "usb", "device", "audio"), + "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + + # CMSIS DSP + { + "id": "CMSIS_DSP_1", "description": "FIR", + "source_dir": join(TEST_DIR, "dsp", "cmsis", "fir_f32"), + "dependencies": [MBED_LIBRARIES, DSP_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + + # mbed DSP + { + "id": "DSP_1", "description": "FIR", + "source_dir": join(TEST_DIR, "dsp", "mbed", "fir_f32"), + "dependencies": [MBED_LIBRARIES, DSP_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + }, + + # KL25Z + { + "id": "KL25Z_1", "description": "LPTMR", + "source_dir": join(TEST_DIR, "KL25Z", "lptmr"), + "dependencies": [MBED_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + "mcu": ["KL25Z"], + }, + { + "id": "KL25Z_2", "description": "PIT", + "source_dir": join(TEST_DIR, "KL25Z", "pit"), + "dependencies": [MBED_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + "mcu": ["KL25Z"], + }, + { + "id": "KL25Z_3", "description": "TSI Touch Sensor", + "source_dir": join(TEST_DIR, "mbed", "tsi"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'TSI')], + "mcu": ["KL25Z"], + }, + { + "id": "KL25Z_4", "description": "RTC", + "source_dir": join(TEST_DIR, "KL25Z", "rtc"), + "dependencies": [MBED_LIBRARIES], + "mcu": ["KL25Z"], + }, + { + "id": "KL25Z_5", "description": "MMA8451Q accelerometer", + "source_dir": join(TEST_DIR, "mbed", "i2c_MMA8451Q"), + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'MMA8451Q')], + "mcu": ["KL25Z"], + }, +<<<<<<< HEAD + + # KL05Z + { + "id": "KL05Z_1", "description": "KL05Z: LPTMR", + "source_dir": join(TEST_DIR, "KL05Z", "lptmr"), + "dependencies": [MBED_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + "mcu": ["KL05Z"], + }, + { + "id": "KL05Z_2", "description": "KL05Z: PIT", + "source_dir": join(TEST_DIR, "KL05Z", "pit"), + "dependencies": [MBED_LIBRARIES], + "supported": CORTEX_ARM_SUPPORT, + "mcu": ["KL05Z"], + }, + + { + "id": "KL05Z_4", "description": "KL05Z: RTC", + "source_dir": join(TEST_DIR, "KL05Z", "rtc"), + "dependencies": [MBED_LIBRARIES], + "mcu": ["KL05Z"], + }, + + # LPC812 + { + "id": "LPC812_1", "description": "LPC812: Blinky", + "source_dir": join(TEST_DIR, "lpc812", "blinky"), + "dependencies": [MBED_LIBRARIES], + "mcu": ["LPC812"], + }, + + # MBED_MCU + { + "id": "MBED_MCU_1", "description": "MBED_MCU: BASIC", + "source_dir": join(TEST_DIR, "mbed", "mbed_mcu_basic"), + "dependencies": [MBED_LIBRARIES], + }, + +======= + +>>>>>>> master + # Examples + { + "id": "EXAMPLE_1", "description": "/dev/null", + "source_dir": join(TEST_DIR, "mbed", "dev_null"), + "dependencies": [MBED_LIBRARIES], + }, + { + "id": "EXAMPLE_2", "description": "FS + RTOS", + "source_dir": join(TEST_DIR, "mbed", "fs"), + "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, TEST_MBED_LIB, SD_FS, FAT_FS], + }, +] + +class Test: + DEFAULTS = { + 'dependencies': None, + 'duration': 10, + 'host_test': 'host_test', + 'automated': False, + 'peripherals': None, + 'extra_files': None + } + def __init__(self, n): + self.n = n + self.__dict__.update(Test.DEFAULTS) + self.__dict__.update(TESTS[n]) + + def is_supported(self, target, toolchain): + if not hasattr(self, 'supported'): + return True + return (target in self.supported) and (toolchain in self.supported[target]) + + def get_description(self): + if hasattr(self, 'description'): + return self.description + else: + return self.id + + def __cmp__(self, other): + return cmp(self.n, other.n) + + def __str__(self): + return "[%3d] %s: %s" % (self.n, self.id, self.get_description()) + + +TEST_MAP = dict([(test['id'], Test(i)) for i, test in enumerate(TESTS)]) diff --git a/workspace_tools/toolchains/arm.py b/workspace_tools/toolchains/arm.py index 00f3e2f9bd..acbe7f51c4 100644 --- a/workspace_tools/toolchains/arm.py +++ b/workspace_tools/toolchains/arm.py @@ -31,6 +31,8 @@ class ARM(mbedToolchain): if "save-asm" in self.options: common.extend(["--asm", "--interleave"]) + elif "debug-info" in self.options: + common.extend(["--debug"]) common_c = [ "--md", "--no_depend_system_headers", diff --git a/workspace_tools/txt.txt b/workspace_tools/txt.txt new file mode 100644 index 0000000000..d9b25ad0ef --- /dev/null +++ b/workspace_tools/txt.txt @@ -0,0 +1,33 @@ + +>>> BUILD LIBRARY CMSIS (KL05Z, ARM) +Copy: cmsis.h +Copy: MKL05Z4.sct +Compile: cmsis_nvic.c +Compile: system_MKL05Z4.c +[Warning] system_MKL05Z4.c@29: #2532-D: support for trigraphs is disabled +Copy: cmsis_nvic.o +Copy: system_MKL05Z4.o + +>>> BUILD LIBRARY MBED (KL05Z, ARM) +Copy: gpio_object.h +Copy: PeripheralNames.h +Copy: PinNames.h +Compile: board.c +Compile: exit.c +Compile: mbed_interface.c +Compile: pinmap_common.c +Compile: rtc_time.c +Compile: semihost_api.c +Compile: us_ticker_api.c +Compile: analogin_api.c +[Error] analogin_api.c@37: #20: identifier "PTBA7" is undefined +"C:\git_projects\github\mbed\libraries\mbed\targets\hal\Freescale\TARGET_KL05Z\analogin_api.c", line 37: Error: #20: identifier "PTBA7" is undefined +C:\git_projects\github\mbed\libraries\mbed\targets\hal\Freescale\TARGET_KL05Z\analogin_api.c: 0 warnings, 1 error + + + +Completed in: (4.06)s + + +Build failures: + * ARM::KL05Z