Skip to content

Conversation

@multiplemonomials
Copy link
Collaborator

@multiplemonomials multiplemonomials commented Jul 25, 2025

Summary of changes

  • Testing with the CI shield, I observed that my Apollo3 board was infinite hanging in an interrupt handler when starting the UART test.
  • After some messing around, I figured out that this was due to the test activating the UART lines in hardware after constructing the BufferedSerial object. This was causing a digital glitch on the Rx line, which, well, took out the Apollo3 implementation.
    • I put more info in a comment but basically the hardware triggers the Rx interrupt, then "goes back on its word" and doesn't have a char for us, so we hang
  • Also noticed that the Rx interrupt level was set wrong, meaning that you might not see any UART data if you only send a few chars to the Apollo3
  • Also added a GPIO pinmap so that the arduino uno pinmap test will pass
  • Also fixed another issue with test skipping
  • Also fixed an issue where memap was not working after the python refactor PR

Impact of changes

  • Apollo3 bug that caused an infinite hang from noise on the Rx line or a serial Rx overflow should be fixed
  • Skipped tests will now be printed by the test runner and should be detected by the test run parser
  • Fixed memap output not being printed during build

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

The UART CI shield test, well, nearly passes now. Seems like we are getting Rx overflows at 921600 baud, apparently the CPU can't keep up. Might have to debug this in more depth later. But everything else looks good.

13: [+2686ms][CONN][RXD] mbedmbedmbedmbedmbedmbedmbedmbed
13: [+2698ms][CONN][INF] found KV pair in stream: {{__sync;bd3126fd-d433-4b82-abf8-c2514d612ba5}}, queued...
13: [+2698ms][CONN][INF] found KV pair in stream: {{__version;1.3.0}}, queued...
13: [+2698ms][CONN][INF] found KV pair in stream: {{__timeout;30}}, queued...
13: [+2698ms][CONN][INF] found KV pair in stream: {{__host_test_name;uart_test}}, queued...
13: [+2698ms][CONN][RXD] >>> Running 11 test cases...
13: [+2698ms][CONN][INF] found SYNC in stream: {{__sync;bd3126fd-d433-4b82-abf8-c2514d612ba5}} it is #0 sent, queued...
13: [+5397ms][HTST][INF] sync KV found, uuid=bd3126fd-d433-4b82-abf8-c2514d612ba5, timestamp=1753427577.923987
13: [+5397ms][HTST][INF] DUT greentea-client version: 1.3.0
13: [+5397ms][HTST][INF] setting timeout to: 30 sec
13: [+5397ms][HTST][INF] host test class: '<class 'uart_test.UARTHostTest'>'
13: [+2709ms][CONN][INF] found KV pair in stream: {{__testcase_name;Send test string from MCU once (1200 baud)}}, queued...
13: [+2709ms][CONN][INF] found KV pair in stream: {{__testcase_name;Receive test string from PC once (1200 baud)}}, queued...
13: [+2721ms][CONN][INF] found KV pair in stream: {{__testcase_name;Send test string from MCU once (9600 baud)}}, queued...
13: [+2721ms][CONN][INF] found KV pair in stream: {{__testcase_name;Receive test string from PC once (9600 baud)}}, queued...
13: [+2732ms][CONN][INF] found KV pair in stream: {{__testcase_name;Send test string from MCU once (115200 baud)}}, queued...
13: [+2743ms][CONN][INF] found KV pair in stream: {{__testcase_name;Receive test string from PC once (115200 baud)}}, queued...
13: [+2743ms][CONN][INF] found KV pair in stream: {{__testcase_name;Send test string from MCU once (921600 baud)}}, queued...
13: [+2754ms][CONN][INF] found KV pair in stream: {{__testcase_name;Receive test string from PC once (921600 baud)}}, queued...
13: [+2754ms][CONN][INF] found KV pair in stream: {{__testcase_name;Send test string from MCU once (3000000 baud)}}, queued...
13: [+2766ms][CONN][INF] found KV pair in stream: {{__testcase_name;Receive test string from PC once (3000000 baud)}}, queued...
13: [+2777ms][CONN][INF] found KV pair in stream: {{__testcase_name;Handle Junk on Serial Rx Line}}, queued...
13: [+2777ms][CONN][RXD] 
13: [+2777ms][CONN][RXD] >>> Running case #1: 'Send test string from MCU once (1200 baud)'...
13: [+2788ms][CONN][INF] found KV pair in stream: {{__testcase_start;Send test string from MCU once (1200 baud)}}, queued...
13: [+2788ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;1200}}, queued...
13: [+5507ms][TEST][INF] UART Test host test setup complete.
13: [+5507ms][HTST][INF] host test setup() call...
13: [+5507ms][HTST][INF] CALLBACKs updated
13: [+5507ms][HTST][INF] host test detected: uart_test
13: [+2820ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+3573ms][CONN][INF] found KV pair in stream: {{verify_repeated_test_string;1}}, queued...
13: [+3584ms][SERI][TXD] {{verify_repeated_test_string;complete}}
13: [+3606ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Send test string from MCU once (1200 baud);1;0}}, queued...
13: [+3606ms][CONN][RXD] >>> 'Send test string from MCU once (1200 baud)': 1 passed, 0 failed
13: [+3606ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+3606ms][CONN][RXD]
13: [+3618ms][CONN][RXD] >>> Running case #2: 'Receive test string from PC once (1200 baud)'...
13: [+3629ms][CONN][INF] found KV pair in stream: {{__testcase_start;Receive test string from PC once (1200 baud)}}, queued...
13: [+3629ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;1200}}, queued...
13: [+3640ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+3653ms][CONN][INF] found KV pair in stream: {{send_test_string;1}}, queued...
13: [+3665ms][SERI][TXD] {{send_test_string;started}}
13: [+4085ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Receive test string from PC once (1200 baud);1;0}}, queued...
13: [+4086ms][CONN][RXD] >>> 'Receive test string from PC once (1200 baud)': 1 passed, 0 failed
13: [+4098ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+4098ms][CONN][RXD]
13: [+4099ms][CONN][RXD] >>> Running case #3: 'Send test string from MCU once (9600 baud)'...
13: [+4099ms][CONN][INF] found KV pair in stream: {{__testcase_start;Send test string from MCU once (9600 baud)}}, queued...
13: [+4109ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;9600}}, queued...
13: [+4121ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+4228ms][CONN][INF] found KV pair in stream: {{verify_repeated_test_string;1}}, queued...
13: [+4239ms][SERI][TXD] {{verify_repeated_test_string;complete}}
13: [+4262ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Send test string from MCU once (9600 baud);1;0}}, queued...
13: [+4262ms][CONN][RXD] >>> 'Send test string from MCU once (9600 baud)': 1 passed, 0 failed
13: [+4262ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+4262ms][CONN][RXD]
13: [+4274ms][CONN][RXD] >>> Running case #4: 'Receive test string from PC once (9600 baud)'...
13: [+4285ms][CONN][INF] found KV pair in stream: {{__testcase_start;Receive test string from PC once (9600 baud)}}, queued...
13: [+4286ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;9600}}, queued...
13: [+4298ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+4308ms][CONN][INF] found KV pair in stream: {{send_test_string;1}}, queued...
13: [+4320ms][SERI][TXD] {{send_test_string;started}}
13: [+4442ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Receive test string from PC once (9600 baud);1;0}}, queued...
13: [+4442ms][CONN][RXD] >>> 'Receive test string from PC once (9600 baud)': 1 passed, 0 failed
13: [+4442ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+4442ms][CONN][RXD]
13: [+4453ms][CONN][RXD] >>> Running case #5: 'Send test string from MCU once (115200 baud)'...
13: [+4453ms][CONN][INF] found KV pair in stream: {{__testcase_start;Send test string from MCU once (115200 baud)}}, queued...
13: [+4465ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;115200}}, queued...
13: [+4476ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+4497ms][CONN][INF] found KV pair in stream: {{verify_repeated_test_string;1}}, queued...
13: [+4509ms][SERI][TXD] {{verify_repeated_test_string;complete}}
13: [+4530ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Send test string from MCU once (115200 baud);1;0}}, queued...
13: [+4530ms][CONN][RXD] >>> 'Send test string from MCU once (115200 baud)': 1 passed, 0 failed
13: [+4541ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+4541ms][CONN][RXD]
13: [+4542ms][CONN][RXD] >>> Running case #6: 'Receive test string from PC once (115200 baud)'...
13: [+4555ms][CONN][INF] found KV pair in stream: {{__testcase_start;Receive test string from PC once (115200 baud)}}, queued...
13: [+4555ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;115200}}, queued...
13: [+4568ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+4578ms][CONN][INF] found KV pair in stream: {{send_test_string;1}}, queued...
13: [+4590ms][SERI][TXD] {{send_test_string;started}}
13: [+4611ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Receive test string from PC once (115200 baud);1;0}}, queued...
13: [+4611ms][CONN][RXD] >>> 'Receive test string from PC once (115200 baud)': 1 passed, 0 failed
13: [+4622ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+4622ms][CONN][RXD]
13: [+4622ms][CONN][RXD] >>> Running case #7: 'Send test string from MCU once (921600 baud)'...
13: [+4634ms][CONN][INF] found KV pair in stream: {{__testcase_start;Send test string from MCU once (921600 baud)}}, queued...
13: [+4634ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;921600}}, queued...
13: [+4645ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+4656ms][CONN][INF] found KV pair in stream: {{verify_repeated_test_string;1}}, queued...
13: [+4668ms][SERI][TXD] {{verify_repeated_test_string;complete}}
13: [+4689ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Send test string from MCU once (921600 baud);1;0}}, queued...
13: [+4689ms][CONN][RXD] >>> 'Send test string from MCU once (921600 baud)': 1 passed, 0 failed
13: [+4701ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+4701ms][CONN][RXD]
13: [+4701ms][CONN][RXD] >>> Running case #8: 'Receive test string from PC once (921600 baud)'...
13: [+4712ms][CONN][INF] found KV pair in stream: {{__testcase_start;Receive test string from PC once (921600 baud)}}, queued...
13: [+4712ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;921600}}, queued...
13: [+4723ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+4734ms][CONN][INF] found KV pair in stream: {{send_test_string;1}}, queued...
13: [+4745ms][SERI][TXD] {{send_test_string;started}}
13: [+4767ms][CONN][RXD] Receive timed out after 2030ms, only received 18 chars.
13: [+4767ms][CONN][RXD] <greentea test suite>:144::FAIL: Receive timed out
13: [+4779ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Receive test string from PC once (921600 baud);0;1}}, queued...
13: [+4779ms][CONN][RXD] >>> 'Receive test string from PC once (921600 baud)': 0 passed, 1 failed with reason 'Test Cases Failed'
13: [+4779ms][CONN][RXD]
13: [+4790ms][CONN][RXD] 
13: [+4790ms][CONN][RXD] >>> Running case #9: 'Send test string from MCU once (3000000 baud)'...
13: [+4801ms][CONN][INF] found KV pair in stream: {{__testcase_start;Send test string from MCU once (3000000 baud)}}, queued...
13: [+4801ms][CONN][RXD] <greentea test suite>:83::SKIP: Baudrate unsupported
13: [+4812ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Send test string from MCU once (3000000 baud);1;0}}, queued...
13: [+4812ms][CONN][RXD] >>> 'Send test string from MCU once (3000000 baud)': 1 passed, 0 failed
13: [+4823ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+4824ms][CONN][RXD]
13: [+4824ms][CONN][RXD] >>> Running case #10: 'Receive test string from PC once (3000000 baud)'...
13: [+4834ms][CONN][INF] found KV pair in stream: {{__testcase_start;Receive test string from PC once (3000000 baud)}}, queued...
13: [+4834ms][CONN][RXD] <greentea test suite>:103::SKIP: Baudrate unsupported
13: [+4845ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Receive test string from PC once (3000000 baud);1;0}}, queued...
13: [+4856ms][CONN][RXD] >>> 'Receive test string from PC once (3000000 baud)': 1 passed, 0 failed
13: [+4856ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+4856ms][CONN][RXD]
13: [+4868ms][CONN][RXD] >>> Running case #11: 'Handle Junk on Serial Rx Line'...
13: [+4868ms][CONN][INF] found KV pair in stream: {{__testcase_start;Handle Junk on Serial Rx Line}}, queued...
13: [+4868ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;9600}}, queued...
13: [+4880ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+4891ms][CONN][INF] found KV pair in stream: {{send_test_string;1}}, queued...
13: [+4902ms][SERI][TXD] {{send_test_string;started}}
13: [+4966ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;921600}}, queued...
13: [+4977ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+4988ms][CONN][INF] found KV pair in stream: {{send_test_string;1}}, queued...
13: [+4999ms][SERI][TXD] {{send_test_string;started}}
13: [+5010ms][CONN][RXD] UART received 139 junk chars
13: [+5021ms][CONN][INF] found KV pair in stream: {{setup_port_at_baud;115200}}, queued...
13: [+5033ms][SERI][TXD] {{setup_port_at_baud;complete}}
13: [+5044ms][CONN][INF] found KV pair in stream: {{send_test_string;1}}, queued...
13: [+5056ms][SERI][TXD] {{send_test_string;started}}
13: [+5066ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Handle Junk on Serial Rx Line;1;0}}, queued...
13: [+5077ms][CONN][RXD] >>> 'Handle Junk on Serial Rx Line': 1 passed, 0 failed
13: [+5077ms][CONN][RXD] <greentea test suite>:0::PASS
13: [+5077ms][CONN][RXD]
13: [+5088ms][CONN][RXD] >>> Test cases: 10 passed, 1 failed with reason 'Test Cases Failed'
13: [+5089ms][CONN][RXD] >>> TESTS FAILED!
13: [+5089ms][CONN][RXD]
13: [+5089ms][CONN][RXD] -----------------------
13: [+5089ms][CONN][RXD] 0 Tests 1 Failures 0 Ignored
13: [+5100ms][CONN][RXD] FAIL
13: [+5100ms][CONN][INF] found KV pair in stream: {{__testcase_summary;10;1}}, queued...
13: [+5100ms][CONN][INF] found KV pair in stream: {{end;failure}}, queued...
13: [+5100ms][CONN][INF] found KV pair in stream: {{__exit;0}}, queued...
13: [+7800ms][HTST][INF] __exit(0)

@multiplemonomials multiplemonomials merged commit 09b30e3 into master Jul 25, 2025
52 checks passed
@multiplemonomials multiplemonomials deleted the dev/apollo3-uart-fixes branch July 25, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants