mirror of https://github.com/ARMmbed/mbed-os.git
Disable mbed semihosting interface in tests, so as not to mess up their timing
parent
222bf9730e
commit
b93af1b95c
|
@ -227,6 +227,12 @@ utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
|
||||||
#endif
|
#endif
|
||||||
ticker_suspend(get_us_ticker_data());
|
ticker_suspend(get_us_ticker_data());
|
||||||
|
|
||||||
|
#ifdef DEVICE_SEMIHOST
|
||||||
|
// Disconnect semihosting now, because otherwise it will get disconnected on the first sleep call and
|
||||||
|
// cause said call to take several milliseconds, leading to a test failure.
|
||||||
|
mbed_interface_disconnect();
|
||||||
|
#endif
|
||||||
|
|
||||||
us_ticker_init();
|
us_ticker_init();
|
||||||
#if DEVICE_LPTICKER
|
#if DEVICE_LPTICKER
|
||||||
lp_ticker_init();
|
lp_ticker_init();
|
||||||
|
|
|
@ -675,6 +675,13 @@ Case cases[] = {
|
||||||
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
|
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
|
||||||
{
|
{
|
||||||
GREENTEA_SETUP(20, "default_auto");
|
GREENTEA_SETUP(20, "default_auto");
|
||||||
|
|
||||||
|
#ifdef DEVICE_SEMIHOST
|
||||||
|
// Disconnect semihosting now, because otherwise it will get disconnected on the first sleep call and
|
||||||
|
// cause said call to take several milliseconds, leading to a test failure.
|
||||||
|
mbed_interface_disconnect();
|
||||||
|
#endif
|
||||||
|
|
||||||
return greentea_test_setup_handler(number_of_cases);
|
return greentea_test_setup_handler(number_of_cases);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -478,6 +478,13 @@ void test_mail_full()
|
||||||
utest::v1::status_t test_setup(const size_t number_of_cases)
|
utest::v1::status_t test_setup(const size_t number_of_cases)
|
||||||
{
|
{
|
||||||
GREENTEA_SETUP(10, "default_auto");
|
GREENTEA_SETUP(10, "default_auto");
|
||||||
|
|
||||||
|
#ifdef DEVICE_SEMIHOST
|
||||||
|
// Disconnect semihosting now, because otherwise it will get disconnected on the first sleep call and
|
||||||
|
// cause said call to take several milliseconds, leading to a test failure.
|
||||||
|
mbed_interface_disconnect();
|
||||||
|
#endif
|
||||||
|
|
||||||
return verbose_test_setup_handler(number_of_cases);
|
return verbose_test_setup_handler(number_of_cases);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -318,6 +318,13 @@ void test_queue_full()
|
||||||
utest::v1::status_t test_setup(const size_t number_of_cases)
|
utest::v1::status_t test_setup(const size_t number_of_cases)
|
||||||
{
|
{
|
||||||
GREENTEA_SETUP(5, "default_auto");
|
GREENTEA_SETUP(5, "default_auto");
|
||||||
|
|
||||||
|
#ifdef DEVICE_SEMIHOST
|
||||||
|
// Disconnect semihosting now, because otherwise it will get disconnected on the first sleep call and
|
||||||
|
// cause said call to take several milliseconds, leading to a test failure.
|
||||||
|
mbed_interface_disconnect();
|
||||||
|
#endif
|
||||||
|
|
||||||
return verbose_test_setup_handler(number_of_cases);
|
return verbose_test_setup_handler(number_of_cases);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,13 @@ set(MBED_RESET_BAUDRATE 115200)
|
||||||
# Config options for OPENOCD
|
# Config options for OPENOCD
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
|
|
||||||
|
# One note about OpenOCD for LPC1768:
|
||||||
|
# If you issue a "monitor reset" command, GDB will think that the program is halted, but it actually will have
|
||||||
|
# resumed. So, issue a "c" command after "monitor reset" to get things synchronized again.
|
||||||
|
|
||||||
set(OPENOCD_UPLOAD_ENABLED TRUE)
|
set(OPENOCD_UPLOAD_ENABLED TRUE)
|
||||||
set(OPENOCD_CHIP_CONFIG_COMMANDS
|
set(OPENOCD_CHIP_CONFIG_COMMANDS
|
||||||
-f ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/lpc1768.cfg
|
-f ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/lpc1768.cfg
|
||||||
-c "gdb_memory_map disable" # prevents OpenOCD crash on GDB connect
|
-c "gdb_memory_map disable" # prevents OpenOCD crash on GDB connect
|
||||||
|
-c "gdb_breakpoint_override hard" # Make sure GDB uses HW breakpoints
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue