<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/examples, branch rework-metrics</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/examples?h=rework-metrics</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/examples?h=rework-metrics'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-09-06T08:57:00Z</updated>
<entry>
<title>ci-pinned-boards: curate the board set, esp upload via hil-build-esp, rp2040 fixes</title>
<updated>2026-09-06T08:57:00Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T23:07:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=2a84a2c8b32116b9a9a34eb3b0f39d0644710e06'/>
<id>urn:sha1:2a84a2c8b32116b9a9a34eb3b0f39d0644710e06</id>
<content type='text'>
The cmake job builds and uploads every pinned board to membrowse on
every run, PRs and pushes alike (--identical when code did not
change) - it is the single owner of that upload, as before this
branch touched it.

Curate the board set itself. cxd56/spresense, da1469x/da1469x_dk_pro,
fomu/fomu and ft9xx/mm900evxb are no longer pinned CI boards: none sit
on either HIL roster and no other CI board carries their driver, so
their size tracking was build-only with no hardware behind it -
documented with honest `uncovered` reasons instead of silently
dropping coverage. Swap lpc15/lpcxpresso1549 -&gt; lpc11/lpcxpresso11u68
for dcd_lpc_ip3511, lpc17/lpcxpresso1769 -&gt; lpc40/ea4088_quickstart
for dcd_lpc17_40+ohci, and samd5x_e5x/same54_xplained -&gt;
metro_m4_express; adafruit_fruit_jam now also claims dcd_rp2040. All
four changed boards build-verified (device/cdc_msc, cmake), and the
rp2040 group's (family, board) sort order restored. Two stale notes
the swap left behind are fixed: lpcxpresso11u68 is on neither roster,
so its "HIL (htpc)" claim (copy-pasted from the entry it replaced) was
false, and ea4088_quickstart is a maintainer bench board noted the
same way frdm_kl25z and lpcxpresso1549 were.

Rename the board file to .github/ci-pinned-boards.json, with matching
--ci-pinned-boards/--ci-pinned-boards-only flags: it pins the board
that represents each family in CI, and membrowse history is keyed on
each pinned board's &lt;board&gt;/&lt;example&gt; target names, so the set is
explicitly held rather than derived. Content and target names are
unchanged; the per-entry "family" key is dropped - board names are
unique across hw/bsp/*/boards, so it was redundant data that could
drift from the tree. build.py's resolve_ci_boards() and the coverage
checker derive the family from the board dir, and entries are sorted
by board name, the only key left to sort on.

espressif builds have no leg in the cmake job (esp-idf is by far the
slowest toolchain, and its boards are already enumerated by name for
the rig) - hil-build-esp keeps its own upload-membrowse + secrets:
inherit instead, and hil-build-esp-identical covers the --identical
row for a no-code-change push, the same gap hil-build-esp's own
code-changed gate would otherwise leave. build_util.yml's Membrowse
Upload step skips any leg whose args carry --build-name, an extra -D
or --cflag - a HIL variant build - since it configures with the same
-DBOARD=&lt;name&gt; as the plain build and would otherwise fight it for
the same upload target name; this protects hil-build-esp's DMA
variants specifically. The step also does not scope by $EX_ARGS
(kept on the Build step): scoping the upload by the PR's example
filter would leave examples outside that filter with no upload
attempt at all - a silent history gap rather than the --identical row
the design intends.

Fork PRs: GHA withholds secrets, so MEMBROWSE_API_KEY reaches
membrowse_report.py empty. Master's CMake-expanded bare --api-key
fell through to membrowse's GitHub tokenless auth; the wrapper now
does the same by omitting --api-key entirely when the env var is
empty, rather than exiting - the previous hard-exit was silently
hidden behind the workflow's continue-on-error, so every fork PR
lost its upload with no visible failure.

Retiring ci_skip_boards let CircleCI's plain family sweep reach five
rp2040 boards for the first time; two didn't build. pico_sdk fails
dual/host_hid_to_device_cdc and dual/host_info_to_device_cdc - a
meta-board with no board.h pin defines of its own has no
PICO_DEFAULT_PIO_USB_* macros, which a dual-role rp2040 example needs
for its PIO-USB host side - so each example gained a skip.txt entry
naming the failure. feather_rp2040_max3421 failed host/bare_api on
-Wmissing-prototypes for max3421_int_handler in hw/bsp/rp2040/family.c;
it is only ever used as a same-file GPIO IRQ callback (no other caller),
so it is marked static rather than skip-listing a zero-risk one-line
fix. All 8 rp2040 boards now build clean, `-b &lt;board&gt;` and the bare
`rp2040` family sweep alike.

drivers_coverage_check.py type-checks `drivers` before iterating: a
string previously iterated character-by-character into nonsense "X
matches no driver source file" errors, and null raised an unhandled
TypeError.

Not fixed, flagged for a follow-up: MEMBROWSE_API_KEY reaches
membrowse_report.py as a child-process argv (visible in
/proc/&lt;pid&gt;/cmdline on the runner, even though the logged command line
is redacted) rather than via the environment.

Final-review fixes: the espressif Membrowse Upload docker run only
forwarded MEMBROWSE_API_KEY and CI into the container, so membrowse's
--github metadata detection (GITHUB_EVENT_NAME/GITHUB_SHA/...) and its
fork-PR tokenless auth never saw the actual event - add
GITHUB_ACTIONS/GITHUB_EVENT_NAME/GITHUB_SHA/GITHUB_REF_NAME plus a
read-only bind mount of GITHUB_EVENT_PATH (containers don't inherit
runner env by default; the esp Build step needs none of this, since
its `--target all` never builds the *-membrowse/-upload custom
targets, so its now-unused `pip install membrowse` is also dropped).
check-paths' code filter also gains tools/membrowse_report.py, so a PR
touching only that file exercises the real build+upload matrix
(ci_select rule 2d) instead of 74 no-op --identical legs.

Review fixes: generate_membrowse_sizes()'s all-examples scope (-b with no -e)
now averages each file's size across the elfs it appears in instead of
summing, matching metrics.py's compute_avg() semantics from the linkermap
engine this branch replaced - a file linked by N examples no longer reports
~N times its real size, and the Flash/RAM columns are a real binary's size
again; single-example (-e) stays byte-identical (sum, same as before). The
Membrowse Upload step (build_util.yml) and hil-build-esp-identical's loop
(build.yml) now strip any -e &lt;example&gt; pairs hil_ci_set_matrix.py bakes into
a PR-scoped hil-build-esp leg's args before invoking, so a PR-scoped run
still uploads every example of the pinned board rather than only the
PR-selected subset - closing exactly the silent history gap the step's own
comment already warned against.

Also: build.py's espressif branch gates the idf.py build path on 'all' being
present in build_targets rather than being exactly ['all'], so a combined
--target invocation still runs the build instead of silently skipping on a
fresh dir; membrowse_compare.py's layout-based bucketing unions the actual
flash/ram buckets of a multi-region section's regions instead of assuming
any 2+-region split is a flash+ram pair (e.g. RAM_D1/RAM_D2 now stays
ram-only); membrowse_report.py's extract_defsyms() dedupes to match its own
docstring.

Post-validate fixes, folded in. The Membrowse Upload step threads the
PR's -e filter through for BOARD ELIGIBILITY only: without it,
resolve_ci_boards() ran with examples=None and still resolved the
pinned board even when the Build step above had fallen back to a
substitute, uploading --identical for a board that run never built.
Under --ci-pinned-boards-only tools/build.py now nulls the example
filter after board selection, so the upload still touches every
example of whichever board got resolved - real rows for what was
built, --identical for the rest.

same7x earns its pin instead of assuming it: a full family sweep
showed five *_freertos examples failing (no FreeRTOSConfig.h wired
for same7x - skip.txt'd as family:same7x, naming the reason) and
same70_qmtech's board.cmake/mk pointing at a same70n19b_flash.ld
that never existed in the tree (the SDK ships none) - the board now
carries its own, Q21B's script with the N19B's MEMORY sizes (512K
flash / 256K ram per same70n19b.h), like the other boards with a
board-local .ld. Both same7x boards now build their full example sets
green under the real budget. cxd56 stays OUT of
ci_set_matrix's family_list and its BSP reverts to master untouched:
the same sweep showed NuttX-header failures across three examples,
spresense is unpinned anyway, and a -Wno-error suppression for a
family no CI leg builds silences a real diagnostic class for nothing.

drivers_coverage_check.py gains two guards: a pinned family that no
CI toolchain actually compiles is now a validity error (the dead-pin
case the same7x episode demonstrated), and a non-dict entry in
"boards" reports one clear error instead of a traceback. The spec and
plan docs are updated to the shipped names (membrowse-targets.json /
--board-pins / --pins-only never shipped; 71 occurrences), and stale
test fixtures naming the deleted tinyusb_metrics target are repointed
at examples-membrowse-upload.

Validate-loop fixes, folded in. membrowse_compare.py's report_for_elf()
now passes the elf's own linker scripts and --defsym values (read from
its ninja build graph, exactly as the CI upload path does) to
`membrowse report`: with none given membrowse falls back to its default
Code/Data regions, which the layout bucketing cannot map, so `.data`
lost its flash-side load image and was counted RAM-only (verified on
stm32h743eval: region 'Data' without the script, ['FLASH','RAM_D1']
with it). _bucket_from_layout() also unions in the flash side for a
BOTH_SECTIONS section whose layout lists only its RAM region -
pico-sdk's script never lists `.data` under FLASH, undercounting
raspberry_pi_pico's flash by 11.2K.

membrowse_onboard.py: `membrowse onboard` checks out and `git clean
-fdx`s every historical commit in whatever directory it runs, which
would detach HEAD and wipe the deps symlinks in the repo root - so the
wrapper runs it in a disposable worktree under cmake-metrics/, and the
composed build script relinks deps and reconfigures the (also wiped)
build dir before every historical build, not just the first.
--build-dirs now includes the example's own directory, so a change to
its sources no longer backfills as --identical. Not fixable in the
wrapper: onboard applies one commit's linker scripts to every commit in
the range (no per-commit override in its CLI).
</content>
</entry>
<entry>
<title>metrics: replace the linkermap CI pipeline with membrowse</title>
<updated>2026-09-06T08:57:00Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-26T10:28:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=968cd7c7ba252cea658d0c5a6fef128ef88eb4a0'/>
<id>urn:sha1:968cd7c7ba252cea658d0c5a6fef128ef88eb4a0</id>
<content type='text'>
Membrowse becomes TinyUSB's size-analytics system, in CI and locally.

.github/membrowse-targets.json names the boards CI builds per family
and the drivers each covers; a checker enforced by pre-commit fails
when a dcd/hcd driver (plus ehci/ohci) is neither claimed nor
documented in `uncovered`, validates board and family names against
hw/bsp, and requires a board claiming an hcd driver to build at least
one host/dual example. tools/build.py resolves that file into the
build matrix and gates uploads on it.

Locally, tools/membrowse_compare.py diffs `membrowse report --json
--all-symbols` per source file, keyed on object_file (membrowse 1.2.9
truncates source_file to a basename), and metrics_compare_base.py uses
it as the default engine, with `--engine linkermap` as the legacy
map.json fallback (still required for --combined/--ci). A guard errors
instead of writing a silent all-zero table when the filters match
nothing. linkermap stops running on every build: the POST_BUILD hook
goes, the explicit &lt;target&gt;-linkermap target and a new
examples-linkermap aggregate stay, and family_add_linkermap() no-ops
when the dep is not fetched.

CI loses the whole linkermap pipeline - the code-metrics job, the
sticky PR size comment, release metrics assets, per-family artifacts,
metrics_pair_compare.py, the membrowse-onboard workflow and CircleCI's
dead tinyusb_metrics lane. The cmake job builds the named boards
(esp-idf included, membrowse wired into the IDF docker path via
family_initialize_project and MEMBROWSE_LD_OVERRIDE) and uploads only
those, keeping the --identical path for code-unchanged runs. ci_select
follows: the size tooling no longer runs in any CI build, while the
board list decides what a family's legs compile and so forces a full
matrix. Adds the espressif, same7x, cxd56 and f1c100s families the
board list needs, each build-verified.

The upload itself moves out of cmake: family_add_membrowse()'s ~90-line
inline bash becomes tools/membrowse_report.py, carrying ninja
linker-script extraction with recursive INCLUDE resolution, --defsym
collection, map-file detection, --identical fallback and upload
composition. The API key is read from the environment at run time,
passed via argv and redacted in logs - nothing is baked into
build.ninja at configure time, which the CMake-expanded
$ENV{MEMBROWSE_API_KEY} used to do.

tools/membrowse_onboard.py wraps `membrowse onboard` for history
backfill, deriving the build script, elf path and the CI-matching
target name (&lt;board&gt;/&lt;basename&gt;) so a backfill cannot land under a name
CI never uploads to; it refuses to start on a dirty worktree, since
onboard checks out past commits in place.

A membrowse skill documents local reports, size diffs, board-list
maintenance, uploads and backfill; the code-size skill records the new
default engine and its linkermap fallback. Three follow-up handoffs
capture what was deliberately split out: full linkermap removal,
membrowse --combined support, and the dead build_filtered plumbing.
</content>
</entry>
<entry>
<title>examples: align device-info descriptor handling</title>
<updated>2026-09-05T15:32:47Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-05T08:38:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=ca48abc2eacdaa7f1e272ca85978d08ac97b598d'/>
<id>urn:sha1:ca48abc2eacdaa7f1e272ca85978d08ac97b598d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>examples: write the host cdc console over RTT when that is the console</title>
<updated>2026-09-05T08:25:15Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T11:19:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=c60c7bac231cee58db0fa8bdd3c3fd251dad2ee8'/>
<id>urn:sha1:c60c7bac231cee58db0fa8bdd3c3fd251dad2ee8</id>
<content type='text'>
console_write() forwards what the attached CDC device sent back to the
board's console, and reached for board_uart_write() directly to stay
non-blocking. On a board whose console is the debug probe there is no UART:
board_uart_write() is a stub returning -1, so everything the device echoed was
dropped, and the do/while loop retried a write that could never make progress
and spun until more data arrived.

Send it through SEGGER_RTT_Write() on LOGGER_RTT builds -- already
non-blocking in the default NO_BLOCK_SKIP mode, which is what the UART path
wanted board_uart_write() for.

The retry is also bounded now. board_uart_write() is only documented to
return the number of bytes sent, and the stubs disagree on how they say "no
console here" -- lpc40 returns -1, apm32f0xx returns 0 -- so the loop cannot
decide from the return value alone when to stop. It gives up after 10 ms
without progress instead, which no draining console ever hits, and keeps the
negative return as a fast path so a stub UART does not cost that wait on
every read.

The RTT header include lives in board_api.h so any example can reach it; the
include path only exists when LOGGER=rtt defines LOGGER_RTT.

host/cdc_msc_hid now passes on ea4088_quickstart, whose probe (LPC-Link2) has
no VCOM: the CDC echo round-trips through a CH340 with TX-RX shorted.
</content>
</entry>
<entry>
<title>dual: run host_info_to_device_cdc on ea4088_quickstart</title>
<updated>2026-09-05T08:25:14Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T11:19:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=76edced40075ec7ef884dc13d308d5cfcc09690a'/>
<id>urn:sha1:76edced40075ec7ef884dc13d308d5cfcc09690a</id>
<content type='text'>
The board has both USB ports wired: U1 to the Type-A host connector and U2
to the micro-B device connector, and board_init() already puts the port
select in that mode, so it can run the dual example.

- Allow the example on LPC40XX.
- Point the host stack at rhport 0: ohci maps the TinyUSB rhport onto its
  root-hub port index, and the host controller here is index 0, while the
  dual examples default to rhport 1.
- Move the string-descriptor buffers out of the stack. They are written by
  the host controller, so on parts whose USB master cannot reach the CPU
  stack (this family) the strings came back as garbage. host/device_info
  already keeps its transfer buffer in CFG_TUH_MEM_SECTION; do the same
  here.

Verified on ea4088_quickstart with a WCH-Link on the Type-A port and the
micro-B plugged into a PC:

  mounted device 1
  Device 1: ID 1a86:8010 SN 7FD88F0604B5
    iManufacturer       1     wch.cn
    iProduct            2     WCH-Link
</content>
</entry>
<entry>
<title>improve example details</title>
<updated>2026-09-03T02:46:14Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-03T02:45:48Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=ef404be0337b1486b0a45acd248639ac8dea6c15'/>
<id>urn:sha1:ef404be0337b1486b0a45acd248639ac8dea6c15</id>
<content type='text'>
Signed-off-by: HiFiPHile &lt;admin@hifiphile.com&gt;
</content>
</entry>
<entry>
<title>implement per channel volume control</title>
<updated>2026-09-02T13:24:36Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-02T13:22:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=1ff684a07ec5d80a89ba82276139a202288b7716'/>
<id>urn:sha1:1ff684a07ec5d80a89ba82276139a202288b7716</id>
<content type='text'>
Signed-off-by: HiFiPHile &lt;admin@hifiphile.com&gt;
</content>
</entry>
<entry>
<title>Improve audio host stream event reporting</title>
<updated>2026-08-27T13:28:07Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-08-27T13:28:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=95a99e18d4a46d4bec2994a74ffd1818d28d1dc4'/>
<id>urn:sha1:95a99e18d4a46d4bec2994a74ffd1818d28d1dc4</id>
<content type='text'>
Report asynchronous start and stop completion with transfer results. Replace the ambiguous stream error callback and byte count with explicit transfer-failure events, and ignore stale completions after stopping.
</content>
</entry>
<entry>
<title>audio: service example FIFOs at watermarks</title>
<updated>2026-08-27T08:36:52Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-08-27T07:58:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=ed70f7206694e2ee5dfc0e7b3b947c27413deba0'/>
<id>urn:sha1:ed70f7206694e2ee5dfc0e7b3b947c27413deba0</id>
<content type='text'>
Move capture and playback FIFO servicing into the main-loop task at half-full and half-drained watermarks. Use transfer callbacks only for diagnostics, share one conversion buffer, and demonstrate that application reads and writes need not be synchronized to USB callbacks.

Signed-off-by: HiFiPHile &lt;admin@hifiphile.com&gt;
</content>
</entry>
<entry>
<title>audio: expose generic Audio Control requests</title>
<updated>2026-08-27T08:34:34Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-08-27T04:21:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=b23e33a1ce07297df2f37219861d78d2a4cc9809'/>
<id>urn:sha1:b23e33a1ce07297df2f37219861d78d2a4cc9809</id>
<content type='text'>
Remove the narrow public Feature Unit request API while retaining managed mute and volume helpers. Expose validated Audio Control descriptors during enumeration and provide raw asynchronous and synchronous entity requests for advanced controls.

Signed-off-by: HiFiPHile &lt;admin@hifiphile.com&gt;
</content>
</entry>
</feed>
