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

pull/293/head
Przemek Wirkus 2014-05-02 19:54:40 +01:00
parent 60b6b2c007
commit 044b5131cb
7 changed files with 55 additions and 22 deletions

View File

@ -33,7 +33,11 @@ I2C i2c(P0_10, P0_11);
#elif defined(TARGET_LPC1549)
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);
#elif defined(TARGET_K64F)

View File

@ -42,7 +42,11 @@ I2C i2c(P0_10, P0_11);
#elif defined(TARGET_LPC1549)
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);
#elif defined(TARGET_K64F)

View File

@ -17,7 +17,11 @@ DigitalOut out(PTA1);
#elif defined(TARGET_K64F)
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);
#else
@ -34,8 +38,10 @@ void print_char(char c = '*')
fflush(stdout);
}
void togglePin (void) {
void togglePin(void)
{
static int ticker_count = 0;
if (ticker_count == MS_INTERVALS) {
print_char();
ticker_count = 0;
@ -45,9 +51,9 @@ void togglePin (void) {
ticker_count++;
}
int main() {
int main()
{
tick.attach_us(togglePin, 1000);
while (true) {
while (true)
wait(1);
}
}

View File

@ -15,7 +15,11 @@ DigitalOut out(PTA1);
#elif defined(TARGET_LPC812)
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);
#else
@ -32,10 +36,10 @@ void print_char(char c = '*')
fflush(stdout);
}
int main() {
int main()
{
while (true) {
for (int i = 0; i < MS_INTERVALS; i++)
{
for (int i = 0; i < MS_INTERVALS; i++) {
wait_us(1000);
out = !out;
}

View File

@ -20,7 +20,11 @@ DigitalOut out(LED2);
#elif defined(TARGET_K64F)
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);
#else
@ -37,10 +41,12 @@ void print_char(char c = '*')
fflush(stdout);
}
void toggleOff (void);
void toggleOff(void);
void toggleOn (void) {
void toggleOn(void)
{
static int toggle_counter = 0;
out = 1;
led = 1;
if (toggle_counter == MS_INTERVALS) {
@ -51,13 +57,15 @@ void toggleOn (void) {
timer.attach_us(toggleOff, 500);
}
void toggleOff(void) {
void toggleOff(void)
{
out = 0;
led = 0;
timer.attach_us(toggleOn, 500);
}
int main() {
int main()
{
toggleOn();
while(1);
while (1) ;
}

View File

@ -34,6 +34,7 @@ volatile int max_queue_len = 0;
void udp_server_task(void const *argument)
{
DigitalOut indicator(LED1);
UDPSocket server;
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;
received_packets++;
cli_serv_mutex.unlock(); // LOCK
indicator = !indicator;
}
}
}
@ -71,6 +73,7 @@ void udp_client_task(void const *argument)
// Waiting for HOST port notification
}
DigitalOut indicator(LED2);
UDPSocket socket;
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());
socket.sendTo(echo_server, (char *)datagram.c_str(), datagram.length());
forwarded_packets++;
indicator = !indicator;
}
}
}

View File

@ -76,7 +76,7 @@ import re
from prettytable import PrettyTable
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 subprocess import call
from time import sleep, time
@ -100,7 +100,7 @@ ROOT = abspath(join(dirname(__file__), ".."))
sys.path.insert(0, ROOT)
# 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
@ -227,11 +227,14 @@ class SingleTestRunner(object):
return (test_result, target_name, toolchain_name,
test_id, test_description, round(elapsed_time, 2), duration)
if not target_by_mcu.is_disk_virtual:
delete_dir_files(disk)
#if not target_by_mcu.is_disk_virtual:
# delete_dir_files(disk)
# 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
if not target_by_mcu.is_disk_virtual and test.extra_files: