ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.67k stars 2.98k forks source link

Greentea SYNC_FAIL using PDMC 2.2.1 Bootloader #12352

Closed lauleehong closed 3 years ago

lauleehong commented 4 years ago

Description of defect

Having a project with PDMC 2.2.1 bootloader defined in mbed_app.json would cause greentea to fail with SYNC_FAIL issue. My workaround to get greentea working was to remove the bootloader definition in mbed_app.json.

Tagging @soleilplanet

Build successes:
  * NUCLEO_F767ZI::GCC_ARM::MBED-BUILD
  * NUCLEO_F767ZI::GCC_ARM::SRC-DATASTRUCTCONVERSION-TESTS-DATASTRUCTCONVERSION-UNIT_TEST
[mbed-777] Exec "mbedgt --test-spec ./BUILD/tests/NUCLEO_F767ZI/GCC_ARM-TINY_DEBUG/test_spec.json -n src-datastructconversion-* -V" in "/home/yapziqi/Documents/REPOSITORIES/manuca-core"
[1579591825.70][root]Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[1579591825.72][root]Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
mbedgt: greentea test automation tool ver. 1.7.4
mbedgt: test specification file './BUILD/tests/NUCLEO_F767ZI/GCC_ARM-TINY_DEBUG/test_spec.json' (specified with --test-spec option)
mbedgt: using './BUILD/tests/NUCLEO_F767ZI/GCC_ARM-TINY_DEBUG/test_spec.json' from current directory!
mbedgt: detecting connected mbed-enabled devices...
mbedgt: detected 1 device
    | platform_name | platform_name_unique | serial_port  | mount_point                | target_id                |
    |---------------|----------------------|--------------|----------------------------|--------------------------|
    | NUCLEO_F767ZI | NUCLEO_F767ZI[0]     | /dev/ttyACM0 | /media/yapziqi/NODE_F767ZI | 08180221012469363E60F013 |
mbedgt: processing target 'NUCLEO_F767ZI' toolchain 'GCC_ARM' compatible platforms... (note: switch set to --parallel 1)
    | platform_name | platform_name_unique | serial_port         | mount_point                | target_id                |
    |---------------|----------------------|---------------------|----------------------------|--------------------------|
    | NUCLEO_F767ZI | NUCLEO_F767ZI[0]     | /dev/ttyACM0:115200 | /media/yapziqi/NODE_F767ZI | 08180221012469363E60F013 |
mbedgt: test case filter (specified with -n option)
    src-datastructconversion-*
    test filtered in 'src-datastructconversion-tests-datastructconversion-unit_test'
mbedgt: running 1 test for platform 'NUCLEO_F767ZI' and toolchain 'GCC_ARM'
    use 1 instance of execution threads for testing
mbedgt: checking for 'host_tests' directory above image directory structure
    'host_tests' directory not found: two directory levels above image path checked
mbedgt: selecting test case observer...
    calling mbedhtrun: mbedhtrun -m NUCLEO_F767ZI -p /dev/ttyACM0:115200 -f "BUILD/tests/NUCLEO_F767ZI/GCC_ARM-TINY_DEBUG/src/DatastructConversion/TESTS/DatastructConversion/unit_test/unit_test.bin" -d /media/yapziqi/NODE_F767ZI -c default -t 08180221012469363E60F013 -r default -C 4 --sync 5 -P 60
mbedgt: mbed-host-test-runner: started
[1579591826.31][HTST][INF] host test executor ver. 0.0.12
[1579591826.31][HTST][INF] copy image onto target...
[1579591826.31][COPY][INF] Waiting up to 60 sec for '08180221012469363E60F013' mount point (current is '/media/yapziqi/NODE_F767ZI')...
[1579591842.97][HTST][INF] starting host test process...
[1579591842.97][CONN][INF] starting connection process...
[1579591842.97][CONN][INF] notify event queue about extra 60 sec timeout for serial port pooling
[1579591842.97][CONN][INF] initializing serial port listener...
[1579591842.97][PLGN][INF] Waiting up to 60 sec for '08180221012469363E60F013' serial port (current is '/dev/ttyACM0')...
[1579591842.97][HTST][INF] setting timeout to: 60 sec
[1579591842.98][SERI][INF] serial(port=/dev/ttyACM0, baudrate=115200, read_timeout=0.01, write_timeout=5)
[1579591842.98][SERI][INF] reset device using 'default' plugin...
[1579591843.09][SERI][INF] waiting 1.00 sec after reset
[1579591844.09][SERI][INF] wait for it...
[1579591844.10][SERI][TXD] mbedmbedmbedmbedmbedmbedmbedmbedmbedmbed
[1579591844.10][CONN][INF] sending up to 5 __sync packets (specified with --sync=5)
[1579591844.10][CONN][INF] sending preamble 'b329c46a-8541-40ff-9c8d-9a7533bd3914'
[1579591844.10][SERI][TXD] {{__sync;b329c46a-8541-40ff-9c8d-9a7533bd3914}}
[1579591844.11][CONN][WRN] UnicodeDecodeError encountered!
[1579591844.12][CONN][RXD]  Mbed Bootloader
[1579591844.12][CONN][RXD] [BOOT] ARM: 00000000000000000000
[1579591844.12][CONN][RXD] [BOOT] OEM: 00000000000000000000
[1579591844.12][CONN][RXD] [BOOT] Layout: 0 8009568
[1579591844.12][CONN][RXD] [BOOT] Application's start address: 0x8010400
[1579591844.12][CONN][RXD] [BOOT] Application's jump address: 0x8021265
[1579591844.12][CONN][RXD] [BOOT] Application's stack address: 0x20080000
[1579591844.12][CONN][RXD] [BOOT] Forwarding to application...
[1579591849.11][CONN][INF] Reset the part and send in new preamble...
[1579591849.11][SERI][INF] reset device using 'default' plugin...
[1579591849.22][SERI][INF] waiting 1.00 sec after reset
[1579591850.22][SERI][INF] wait for it...
[1579591850.22][CONN][INF] resending new preamble 'ac06031c-0176-400a-890f-7cdc67d33fb0' after 5.00 sec
[1579591850.22][SERI][TXD] {{__sync;ac06031c-0176-400a-890f-7cdc67d33fb0}}
[1579591855.22][CONN][INF] Reset the part and send in new preamble...
[1579591855.22][SERI][INF] reset device using 'default' plugin...
[1579591855.33][SERI][INF] waiting 1.00 sec after reset
[1579591856.33][SERI][INF] wait for it...
[1579591856.33][CONN][INF] resending new preamble 'a54ff5d0-c304-49d9-86e9-0082ee31bbae' after 5.00 sec
[1579591856.34][SERI][TXD] {{__sync;a54ff5d0-c304-49d9-86e9-0082ee31bbae}}
[1579591861.34][CONN][INF] Reset the part and send in new preamble...
[1579591861.34][SERI][INF] reset device using 'default' plugin...
[1579591861.45][SERI][INF] waiting 1.00 sec after reset
[1579591862.45][SERI][INF] wait for it...
[1579591862.45][CONN][INF] resending new preamble '972a4cdb-d34f-4507-b605-716d2c3fe645' after 5.01 sec
[1579591862.46][SERI][TXD] {{__sync;972a4cdb-d34f-4507-b605-716d2c3fe645}}
[1579591867.47][CONN][INF] Reset the part and send in new preamble...
[1579591867.47][SERI][INF] reset device using 'default' plugin...
[1579591867.58][SERI][INF] waiting 1.00 sec after reset
[1579591868.58][SERI][INF] wait for it...
[1579591868.58][CONN][INF] resending new preamble '98ead0a9-7e4e-44b8-82e9-a3ed62784671' after 5.01 sec
[1579591868.58][SERI][TXD] {{__sync;98ead0a9-7e4e-44b8-82e9-a3ed62784671}}
[1579591868.59][HTST][ERR] None
[1579591868.59][HTST][WRN] stopped to consume events due to __notify_sync_failed event
[1579591868.60][HTST][INF] __exit_event_queue received
[1579591868.60][HTST][INF] test suite run finished after 25.62 sec...
[1579591868.60][HTST][INF] CONN exited with code: 0
[1579591868.60][HTST][INF] No events in queue
[1579591868.60][HTST][INF] host test result() call skipped, received: sync_failed
[1579591868.60][HTST][WRN] missing __exit event from DUT
[1579591868.60][HTST][INF] calling blocking teardown()
[1579591868.60][HTST][INF] teardown() finished
[1579591868.60][HTST][INF] {{result;sync_failed}}
mbedgt: retry mbedhtrun 1/1
mbedgt: ['mbedhtrun', '-m', u'NUCLEO_F767ZI', '-p', '/dev/ttyACM0:115200', '-f', u'"BUILD/tests/NUCLEO_F767ZI/GCC_ARM-TINY_DEBUG/src/DatastructConversion/TESTS/DatastructConversion/unit_test/unit_test.bin"', '-d', u'/media/yapziqi/NODE_F767ZI', '-c', 'default', '-t', u'08180221012469363E60F013', '-r', 'default', '-C', '4', '--sync', '5', '-P', '60'] failed after 1 count
mbedgt: checking for GCOV data...
mbedgt: mbed-host-test-runner: stopped and returned 'SYNC_FAILED'
mbedgt: test case summary event not found
    no test case report present, assuming test suite to be a single test case!
    test suite: src-datastructconversion-tests-datastructconversion-unit_test
    test case: src-datastructconversion-tests-datastructconversion-unit_test
mbedgt: test on hardware with target id: 08180221012469363E60F013
mbedgt: test suite 'src-datastructconversion-tests-datastructconversion-unit_test' ................... SYNC_FAILED in 42.60 sec
    test case: 'src-datastructconversion-tests-datastructconversion-unit_test' ................... ERROR in 42.60 sec
mbedgt: test case summary: 0 passes, 1 failure
mbedgt: all tests finished!
mbedgt: shuffle seed: 0.5253413871
mbedgt: test suite report:
| target                | platform_name | test suite                                                    | result      | elapsed_time (sec) | copy_method |
|-----------------------|---------------|---------------------------------------------------------------|-------------|--------------------|-------------|
| NUCLEO_F767ZI-GCC_ARM | NUCLEO_F767ZI | src-datastructconversion-tests-datastructconversion-unit_test | SYNC_FAILED | 42.6               | default     |
mbedgt: test suite results: 1 SYNC_FAILED
mbedgt: test case report:
| target                | platform_name | test suite                                                    | test case                                                     | passed | failed | result | elapsed_time (sec) |
|-----------------------|---------------|---------------------------------------------------------------|---------------------------------------------------------------|--------|--------|--------|--------------------|
| NUCLEO_F767ZI-GCC_ARM | NUCLEO_F767ZI | src-datastructconversion-tests-datastructconversion-unit_test | src-datastructconversion-tests-datastructconversion-unit_test | 0      | 1      | ERROR  | 42.6               |
mbedgt: test case results: 1 ERROR
mbedgt: completed in 42.93 sec
mbedgt: exited with code 1
[mbed-777] ERROR: "mbedgt" returned error.

Target(s) affected by this defect ?

Tested on NUCLEO_F767ZI

Toolchain(s) (name and version) displaying this defect ?

GCC-ARM Compiler 6 (gcc-arm-none-eabi-6-2017-q2-update)

What version of Mbed-os are you using (tag or sha) ?

mbed-os 5.14.2 (cf4f12a)

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli 1.10.2 mbed-greentea 1.7.4

How is this defect reproduced ?

Mbed-os >= 5.14.2 mbed_app.json with the following settings: "target.features_add" : ["BOOTLOADER"], "target.bootloader_img" : "bootloader/mbed-bootloader-NUCLEO_F767ZI.bin", "target.header_offset" : "0x10000", "target.app_offset" : "0x10400"

where the bootloader used was provided in https://github.com/ARMmbed/pelion-ready-example/tree/master/bootloader

soleilplanet commented 4 years ago

@MarceloSalazar @chris-styles would you please help? Thanks!

MarceloSalazar commented 4 years ago

@lauleehong can you please test on Windows and share the logs? We'd like to understand whether this is related to https://github.com/ARMmbed/mbed-os/issues/4301

lauleehong commented 4 years ago

The above greentea test was ran on Ubuntu 18.04 LTS

0Grit commented 4 years ago

@trowbridgec

ciarmcom commented 4 years ago

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. Internal Jira reference: https://jira.arm.com/browse/IOTOSM-2147

lauleehong commented 3 years ago

Adding mbed-bootloader 4.7.0 to mbed 6.5.0 application would also cause SYNC_FAILED issue if we run greentea.

lauleehong commented 3 years ago

I've fixed this issue. If your using a mbed-bootloader in your application program, you have to remove all serial printouts in the bootloader code. The sync_fail by greentea happens when your program bootloader prints and sends the bootloader printouts to the host machine during greentea test (which wasn't expected those characters from the target board).

0xc0170 commented 3 years ago

Thanks for sharing the solution and closing.