mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Added NUCLEO_F103RB, NUCLEO_L152RE, NUCLEO_F302R8, NUCLEO_F030R8, NUCLEO_F401RE defines to timer tests. Fixed bug related to Nucleo not responding to singletest.py test execution
							parent
							
								
									60b6b2c007
								
							
						
					
					
						commit
						044b5131cb
					
				| 
						 | 
					@ -33,7 +33,11 @@ I2C i2c(P0_10, P0_11);
 | 
				
			||||||
#elif defined(TARGET_LPC1549)
 | 
					#elif defined(TARGET_LPC1549)
 | 
				
			||||||
I2C i2c(P0_23, P0_22);
 | 
					I2C i2c(P0_23, P0_22);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(TARGET_NUCLEO_F103RB) || defined(TARGET_NUCLEO_L152RE)
 | 
					#elif defined(TARGET_NUCLEO_F103RB) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_L152RE) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F302R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F030R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F401RE)
 | 
				
			||||||
I2C i2c(I2C_SDA, I2C_SCL);
 | 
					I2C i2c(I2C_SDA, I2C_SCL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(TARGET_K64F)
 | 
					#elif defined(TARGET_K64F)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,7 +42,11 @@ I2C i2c(P0_10, P0_11);
 | 
				
			||||||
#elif defined(TARGET_LPC1549)
 | 
					#elif defined(TARGET_LPC1549)
 | 
				
			||||||
I2C i2c(P0_23, P0_22);
 | 
					I2C i2c(P0_23, P0_22);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(TARGET_NUCLEO_F103RB)
 | 
					#elif defined(TARGET_NUCLEO_F103RB) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_L152RE) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F302R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F030R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F401RE)
 | 
				
			||||||
I2C i2c(I2C_SDA, I2C_SCL);
 | 
					I2C i2c(I2C_SDA, I2C_SCL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(TARGET_K64F)
 | 
					#elif defined(TARGET_K64F)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,11 @@ DigitalOut out(PTA1);
 | 
				
			||||||
#elif defined(TARGET_K64F)
 | 
					#elif defined(TARGET_K64F)
 | 
				
			||||||
DigitalOut out(PTA1);
 | 
					DigitalOut out(PTA1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(TARGET_NUCLEO_L152RE)
 | 
					#elif defined(TARGET_NUCLEO_F103RB) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_L152RE) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F302R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F030R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F401RE)
 | 
				
			||||||
DigitalOut out(PA_3);
 | 
					DigitalOut out(PA_3);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -34,8 +38,10 @@ void print_char(char c = '*')
 | 
				
			||||||
    fflush(stdout);
 | 
					    fflush(stdout);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void togglePin (void) {
 | 
					void togglePin(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
    static int ticker_count = 0;
 | 
					    static int ticker_count = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (ticker_count == MS_INTERVALS) {
 | 
					    if (ticker_count == MS_INTERVALS) {
 | 
				
			||||||
        print_char();
 | 
					        print_char();
 | 
				
			||||||
        ticker_count = 0;
 | 
					        ticker_count = 0;
 | 
				
			||||||
| 
						 | 
					@ -45,9 +51,9 @@ void togglePin (void) {
 | 
				
			||||||
    ticker_count++;
 | 
					    ticker_count++;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main() {
 | 
					int main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
    tick.attach_us(togglePin, 1000);
 | 
					    tick.attach_us(togglePin, 1000);
 | 
				
			||||||
    while (true) {
 | 
					    while (true)
 | 
				
			||||||
        wait(1);
 | 
					        wait(1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,7 +15,11 @@ DigitalOut out(PTA1);
 | 
				
			||||||
#elif defined(TARGET_LPC812)
 | 
					#elif defined(TARGET_LPC812)
 | 
				
			||||||
DigitalOut out(D10);
 | 
					DigitalOut out(D10);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(TARGET_NUCLEO_L152RE)
 | 
					#elif defined(TARGET_NUCLEO_F103RB) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_L152RE) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F302R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F030R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F401RE)
 | 
				
			||||||
DigitalOut out(LED1);
 | 
					DigitalOut out(LED1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -32,10 +36,10 @@ void print_char(char c = '*')
 | 
				
			||||||
    fflush(stdout);
 | 
					    fflush(stdout);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main() {
 | 
					int main()
 | 
				
			||||||
    while (true) {
 | 
					 | 
				
			||||||
        for (int i = 0; i < MS_INTERVALS; i++)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    while (true) {
 | 
				
			||||||
 | 
					        for (int i = 0; i < MS_INTERVALS; i++) {
 | 
				
			||||||
            wait_us(1000);
 | 
					            wait_us(1000);
 | 
				
			||||||
            out = !out;
 | 
					            out = !out;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,11 @@ DigitalOut out(LED2);
 | 
				
			||||||
#elif defined(TARGET_K64F)
 | 
					#elif defined(TARGET_K64F)
 | 
				
			||||||
DigitalOut out(LED1);
 | 
					DigitalOut out(LED1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(TARGET_NUCLEO_L152RE)
 | 
					#elif defined(TARGET_NUCLEO_F103RB) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_L152RE) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F302R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F030R8) || \
 | 
				
			||||||
 | 
					    defined(TARGET_NUCLEO_F401RE)
 | 
				
			||||||
DigitalOut out(LED1);
 | 
					DigitalOut out(LED1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -39,8 +43,10 @@ void print_char(char c = '*')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void toggleOff(void);
 | 
					void toggleOff(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void toggleOn (void) {
 | 
					void toggleOn(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
    static int toggle_counter = 0;
 | 
					    static int toggle_counter = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    out = 1;
 | 
					    out = 1;
 | 
				
			||||||
    led = 1;
 | 
					    led = 1;
 | 
				
			||||||
    if (toggle_counter == MS_INTERVALS) {
 | 
					    if (toggle_counter == MS_INTERVALS) {
 | 
				
			||||||
| 
						 | 
					@ -51,13 +57,15 @@ void toggleOn (void) {
 | 
				
			||||||
    timer.attach_us(toggleOff, 500);
 | 
					    timer.attach_us(toggleOff, 500);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void toggleOff(void) {
 | 
					void toggleOff(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
    out = 0;
 | 
					    out = 0;
 | 
				
			||||||
    led = 0;
 | 
					    led = 0;
 | 
				
			||||||
    timer.attach_us(toggleOn, 500);
 | 
					    timer.attach_us(toggleOn, 500);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main() {
 | 
					int main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
    toggleOn();
 | 
					    toggleOn();
 | 
				
			||||||
    while (1) ;
 | 
					    while (1) ;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,7 @@ volatile int max_queue_len = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void udp_server_task(void const *argument)
 | 
					void udp_server_task(void const *argument)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    DigitalOut indicator(LED1);
 | 
				
			||||||
    UDPSocket server;
 | 
					    UDPSocket server;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    server.bind(ECHO_SERVER_PORT);
 | 
					    server.bind(ECHO_SERVER_PORT);
 | 
				
			||||||
| 
						 | 
					@ -61,6 +62,7 @@ void udp_server_task(void const *argument)
 | 
				
			||||||
            max_queue_len = datagram_queue.size() > max_queue_len ? datagram_queue.size() : max_queue_len;
 | 
					            max_queue_len = datagram_queue.size() > max_queue_len ? datagram_queue.size() : max_queue_len;
 | 
				
			||||||
            received_packets++;
 | 
					            received_packets++;
 | 
				
			||||||
            cli_serv_mutex.unlock(); // LOCK
 | 
					            cli_serv_mutex.unlock(); // LOCK
 | 
				
			||||||
 | 
					            indicator = !indicator;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -71,6 +73,7 @@ void udp_client_task(void const *argument)
 | 
				
			||||||
        // Waiting for HOST port notification
 | 
					        // Waiting for HOST port notification
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    DigitalOut indicator(LED2);
 | 
				
			||||||
    UDPSocket socket;
 | 
					    UDPSocket socket;
 | 
				
			||||||
    socket.init();
 | 
					    socket.init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -93,6 +96,7 @@ void udp_client_task(void const *argument)
 | 
				
			||||||
            //printf("[udp_client_task] Forwarded datagram: %s\r\n", datagram.c_str());
 | 
					            //printf("[udp_client_task] Forwarded datagram: %s\r\n", datagram.c_str());
 | 
				
			||||||
            socket.sendTo(echo_server, (char *)datagram.c_str(), datagram.length());
 | 
					            socket.sendTo(echo_server, (char *)datagram.c_str(), datagram.length());
 | 
				
			||||||
            forwarded_packets++;
 | 
					            forwarded_packets++;
 | 
				
			||||||
 | 
					            indicator = !indicator;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -76,7 +76,7 @@ import re
 | 
				
			||||||
from prettytable import PrettyTable
 | 
					from prettytable import PrettyTable
 | 
				
			||||||
from serial import Serial
 | 
					from serial import Serial
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from os.path import join, abspath, dirname, exists
 | 
					from os.path import join, abspath, dirname, exists, basename
 | 
				
			||||||
from shutil import copy
 | 
					from shutil import copy
 | 
				
			||||||
from subprocess import call
 | 
					from subprocess import call
 | 
				
			||||||
from time import sleep, time
 | 
					from time import sleep, time
 | 
				
			||||||
| 
						 | 
					@ -100,7 +100,7 @@ ROOT = abspath(join(dirname(__file__), ".."))
 | 
				
			||||||
sys.path.insert(0, ROOT)
 | 
					sys.path.insert(0, ROOT)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Imports related to mbed build pi
 | 
					# Imports related to mbed build pi
 | 
				
			||||||
from workspace_tools.utils import delete_dir_files
 | 
					from workspace_tools.utils import delete_dir_files, copy_file
 | 
				
			||||||
from workspace_tools.settings import MUTs
 | 
					from workspace_tools.settings import MUTs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -227,11 +227,14 @@ class SingleTestRunner(object):
 | 
				
			||||||
            return (test_result, target_name, toolchain_name,
 | 
					            return (test_result, target_name, toolchain_name,
 | 
				
			||||||
                    test_id, test_description, round(elapsed_time, 2), duration)
 | 
					                    test_id, test_description, round(elapsed_time, 2), duration)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not target_by_mcu.is_disk_virtual:
 | 
					        #if not target_by_mcu.is_disk_virtual:
 | 
				
			||||||
            delete_dir_files(disk)
 | 
					        #    delete_dir_files(disk)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Program MUT with proper image file
 | 
					        # Program MUT with proper image file
 | 
				
			||||||
        copy(image_path, disk)
 | 
					        cmd = ["cp", image_path.encode('ascii','ignore'), disk.encode('ascii','ignore') +  basename(image_path).encode('ascii','ignore')]
 | 
				
			||||||
 | 
					        # print cmd
 | 
				
			||||||
 | 
					        call(cmd)
 | 
				
			||||||
 | 
					        # copy(image_path, disk)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Copy Extra Files
 | 
					        # Copy Extra Files
 | 
				
			||||||
        if not target_by_mcu.is_disk_virtual and test.extra_files:
 | 
					        if not target_by_mcu.is_disk_virtual and test.extra_files:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue