Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 8 months ago.
singletest.py: need wait between end of copy to target and serial port initialisation
I'm trying to use singletest.py to run tests on a U-Blox C027 board. The problem I have is that once the copy is complete the target reflashes and restarts the CPU, during which time the USB-to-serial port connection is also restarted. This is exactly the time that the singletst.py script is attempting to initialise the serial port, and so it always fails:
C:\>python singletest.py -i test_spec.json -M muts_all.json -v
index | peripherals | mcu | disk | reset_tout | port | |
1 | LPC1768 | D: | 5 | COM31 | ||
mcu | GCC_ARM | |||||
LPC1768 | Yes |
Building library CMSIS (LPC1768, GCC_ARM)
Building library MBED (LPC1768, GCC_ARM)
Building project DETECT (LPC1768, GCC_ARM)
Executing 'python host_test.py -d D: -f "C:\projects\mbed\build\test\LPC1768\GCC_ARM\DTCT_1\detect.bin" -p COM31 -t 10 -C 1.5 -m LPC1768 -R 2'
Test::Output::Start
MBED: Instrumentation: "COM31" and disk: "D:"
HOST: Copy image onto target...
HOST: Initialize serial port...
MBED: Cannot configure port, some setting was wrong. Original message: [Error 1167] The device is not connected.
{{ioerr_serial}}
{{end}}
Is there a way to add a delay between the completion of the copy and the serial port initialisation? Is there any other workaround I could use? How do people usually do this?
Rob
Question relating to:
1 Answer
9 years, 8 months ago.
Hello Rob, This improvement is on my list for some time now. I will soon create pool request and add proper timings for disk / serial 'ready'.
That's excellent news, thanks. Is there some form of workaround I can do myself in the interim?
posted by 20 Mar 2015I will create pull request today, you can locally merge it your mbed SDK before Martin merges officially. Does this sound right to you? :)
Update:
$ singletest.py ....... --global-loops 3 -W Test summary: +---------+------------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+ | Result | Target | Toolchain | Test ID | Test Description | Elapsed Time (sec) | Timeout (sec) | Loops | +---------+------------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+ | OK | UBLOX_C027 | ARM | DTCT_1 | Simple detect test | 0.58 | 10 | 1/1 | | OK | UBLOX_C027 | ARM | EXAMPLE_1 | /dev/null | 3.5 | 20 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_10 | Hello World | 0.4 | 5 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_11 | Ticker Int | 11.41 | 15 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_12 | C++ | 1.43 | 10 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_16 | RTC | 4.62 | 20 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_2 | stdio | 0.84 | 20 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_23 | Ticker Int us | 11.42 | 15 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_24 | Timeout Int us | 11.45 | 15 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_25 | Time us | 11.61 | 15 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_26 | Integer constant division | 1.43 | 20 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_34 | Ticker Two callbacks | 11.43 | 15 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_A1 | Basic | 1.41 | 20 | 1/1 | | OK | UBLOX_C027 | ARM | MBED_A21 | Call function before main (mbed_main) | 1.48 | 20 | 1/1 | | TIMEOUT | UBLOX_C027 | ARM | MBED_A9 | Serial Echo at 115200 | 40.41 | 20 | 0/3 | | OK | UBLOX_C027 | ARM | MBED_BUSOUT | BusOut | 2.36 | 15 | 1/1 | +---------+------------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+ Result: 15 OK / 1 TIMEOUT Completed in 283.15 sec
Rob, You can merge this and start testing with U-BLOX: https://github.com/mbedmicro/mbed/pull/986 Have a nice weekend too !
posted by 20 Mar 2015
I can confirm that with the Pull Request from PrzemekWirkus, https://github.com/mbedmicro/mbed/pull/986, this problem is resolved. Happy. :-)
posted by Rob Meades 20 Mar 2015