Fix card.binary HIL test build on STM32 Arduino core 3.x - #256
Merged
Merged
Conversation
- PlatformIO's ststm32 20.0.0 platform brings in STM32 Arduino core 3.0. The test's platformio.ini does not pin the platform, so CI picked it up. - Core 3.x declares Serial2 and Serial3 itself. The test's own Serial2 and Serial3 objects then fail with "conflicting declaration". - Core 3.x also makes HardwareSerial an abstract class. Uart is now the concrete UART class. - Remove Serial2. No code uses it. - Rename Serial3 to notecardSerial. It keeps the same pins (A5 RX, A4 TX). - Pick Uart on core 3.x and HardwareSerial on core 2.x, so the test builds on both cores. - Checked with local builds on core 3.0 (ststm32 20.0.0) and core 2.12 (ststm32 19.7.1). This commit message was written by Claude, an AI agent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The workflow writes NOTEHUB_ACCESS_TOKEN and MD5SRV_TOKEN to GITHUB_ENV. GitHub does not mask values that a step writes there. It printed both tokens in plain text in the env block of every later step. - The "Notehub HTTP route request" log line also printed MD5SRV_TOKEN. - Send ::add-mask:: for each token before the step writes it to GITHUB_ENV. GitHub then shows *** in place of the token in all later output. This commit message was written by Claude, an AI agent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The upload command passed each GDB command with -ex and ended with "quit". GDB runs later -ex commands after one fails, and "quit" exits 0. A failed connect or load looked like a successful upload. - The job then waited for the Swan's USB port and failed with a misleading "Timed out waiting for test port" error. - Move "monitor reset halt", "load", and "monitor reset" into upload.gdb and run GDB with -batch. GDB stops the file at the first failed command and exits non-zero, so PlatformIO fails the upload step. - Checked locally: with an unreachable GDB server, PlatformIO fails with "[upload] Error 1" and GDB's error message. This commit message was written by Claude, an AI agent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- GDB prints load progress only for interactive commands, so the CI log never showed whether the firmware load happened. - Add echo markers and compare-sections to upload.gdb. compare-sections reads the flash back and prints matched or MIS-MATCHED for each section. - compare-sections reports a mismatch as a warning, so it does not fail the upload. A failed connect, reset, or load still does. This commit message was written by Claude, an AI agent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- "pio test" shows the upload command's stderr but hides its stdout. GDB writes echo and compare-sections output to stdout, so the markers from the last commit did not show in the CI log. - Send GDB's stdout to stderr with 1>&2. PlatformIO runs the upload command through a shell, and GDB's exit status still reaches it. - Checked locally with a stand-in for GDB_CMD: its stdout now shows, and a non-zero exit still fails the upload with "[upload] Error". This commit message was written by Claude, an AI agent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- barcelona-notestation-1 is shared with note-zephyr HIL tests. They leave
the Notecard with product com.blues.note-zephyr.hil, which has no
Notehub project, so the Notecard delays its connect attempts
("connect delayed", product-noexist) for several minutes.
- The waitForNotecardConnected test ran before any test sent hub.set, so
it waited 5 minutes on the old product and failed. The next test's
hub.set cleared the delay, and the Notecard connected 13 s later.
- Send the suite's hub.set (product and continuous mode) at the start of
waitForNotecardConnected. A product change also takes the Notecard out
of the penalty box.
This commit message was written by Claude, an AI agent.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Bucknalla
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR gets the
note-c card.binary HIL testsjob passing again, as it did before 2026-08-29. It had several separate problems.test/hitl/card.binary/platformio.iniusesplatform = ststm32with no version. Around 2026-09-05, CI started to useststm3220.0.0, which brings in STM32 Arduino core 3.0. Core 3.0 declaresSerial2andSerial3itself, and it makesHardwareSerialan abstract class. The test's ownSerial2/Serial3objects then fail to compile.-excommand and ended withquit, so it exited 0 even when the connect or load failed. The job then failed later with a misleadingTimed out waiting for test port.barcelona-notestation-1is shared with the note-zephyr HIL tests. They leave a product UID on the Notecard that has no Notehub project. The Notecard then delays its connect attempts, sowaitForNotecardConnectedtimed out before any test set the product.NOTEHUB_ACCESS_TOKENandMD5SRV_TOKENin plain text in every step'senv:block.Two related fixes live outside this repo:
notestation-v3.7.1.Changes
NotecardComms.h,NotecardComms.cpp:Serial2, which nothing used.Serial3tonotecardSerial, on the same pins (A5 RX, A4 TX).Uarton core 3.x andHardwareSerialon core 2.x.platformio.ini, newupload.gdb:-batch, so it stops at the first failed command and exits non-zero.echomarkers andcompare-sectionsshow in the log what was flashed.1>&2puts GDB's output in the CI log, becausepio testhides the upload command's stdout.test_card_binary.cpp:waitForNotecardConnectedsends the suite'shub.set(product and mode) before it waits. A product change also clears the Notecard's connect delay.notecard-binary-tests.yml: Send::add-mask::for both tokens before they go intoGITHUB_ENV.Test plan
ststm3220.0.0) and core 2.12 (ststm3219.7.1).astyle3.1 reports no changes.[upload] Error 1and shows GDB's error.barcelona-notestation-1withnotestation-v3.7.1passes 14/14 (run 35827541275). The log showsload size 184036andmatchedfor all 7 sections. The run started with the note-zephyr product and the Notecard in its connect delay, andwaitForNotecardConnectedpassed.***for both tokens. Noory_at_values appear.Notes
-DNOTECARD_DEBUG_STLINKfails to link.source-research/: no update needed. The change touches only HIL test code and the HIL workflow. The indexed symbols inNotecardComms.handNotecardComms.cppkeep their line numbers.🤖 Generated with Claude Code