<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git, branch claude/add-systemview-debug</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/?h=claude%2Fadd-systemview-debug</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/?h=claude%2Fadd-systemview-debug'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-09-03T22:11:02Z</updated>
<entry>
<title>sysview: fix cycle-2 review findings</title>
<updated>2026-09-03T22:11:02Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T22:11:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=f9c0c1239250399bc41347b9160bd95721f86dca'/>
<id>urn:sha1:f9c0c1239250399bc41347b9160bd95721f86dca</id>
<content type='text'>
- sysview_ci.py: wait() after kill() on the OpenOCD/nc grace-period
  timeout, so a still-exiting process can't hold the probe when the
  recovery flash starts
- SKILL.md: point the OpenOCD and post-mortem recipes at
  examples/device/cdc_msc_freertos, where build-sv actually lands
- stm32f401blackpill: override SYSVIEW_BUFFER_SIZE_DEFAULT to 4096;
  the 64 KiB part overflows RAM by 12952 bytes at the family's 65536
  default under SYSVIEW=4
- get_deps.py: align the SystemView entry's continuation lines
</content>
</entry>
<entry>
<title>ci: pin dawidd6/action-download-artifact to a commit SHA</title>
<updated>2026-09-03T21:55:33Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T21:55:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=78ec7f6abae94f59612f30cda4d24031f5e7b760'/>
<id>urn:sha1:78ec7f6abae94f59612f30cda4d24031f5e7b760</id>
<content type='text'>
Third-party actions referenced by mutable tag are a supply-chain risk;
pin to the v11 commit SHA per the repo's existing action-pinning convention.
</content>
</entry>
<entry>
<title>ci: sysview capture in HIL jobs, performance report on the sticky comment</title>
<updated>2026-09-03T21:21:57Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-11T10:08:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=4df375487cd49312fb55e8a1908bcd4bb544e79a'/>
<id>urn:sha1:4df375487cd49312fb55e8a1908bcd4bb544e79a</id>
<content type='text'>
The HIL job captures the sysview-flagged boards after the functional tests;
a compare job turns base-vs-PR reports into sysview-comment, and
pr_comment.yml appends it to the HIL sticky comment. Every job is capped
above the pool guard.
</content>
</entry>
<entry>
<title>hil: sysview CI - rig capture subcommands and report generator</title>
<updated>2026-09-03T21:21:57Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T10:14:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=9e681141bc24ff71081dfce683ae4371e7520124'/>
<id>urn:sha1:9e681141bc24ff71081dfce683ae4371e7520124</id>
<content type='text'>
sysview_ci.py builds, flashes and captures the sysview-flagged boards
(stm32f407disco and raspberry_pi_pico in tinyusb.json) on the rig, taking
each board's flock via hil_lock and restoring park firmware afterwards.

Hard-won correctness baked in from the dogfood runs: firmware paths carry
the flasher's extension via FLASHER_SUFFIX (JLinkExe and OpenOCD infer the
image format from it, and the RTT control block still comes from the ELF,
which is not always the flashed image); WCH boards are detected by their
wch-riscv target config (is_wch_board(), the plain "openocd" flasher name
since #3804 folded openocd_wch/openocd_adi away); build and flash failures
are excerpted from BOTH ends (cmake prints the diagnosis first and the call
stack last, ninja the reverse) and flash failures include the flasher's own
output so rc=124 can distinguish a wedged probe from a dead target; a bad
ELF no longer aborts the whole multi-board run; the enumeration wait sits
after the capture session's own reset; each capture picks a free RTT server
port. session_resets()/sysview.attach_only skips the in-session reset for
boards that never come back from it (metro_m4_express: both campaign
captures died with 'No control block found' while attach-without-reset
streamed immediately) - the flasher's post-flash reset already supplied the
fresh boot.

The suites join the pre-commit hil-test hook and master's test/hil/test/
carve-out pin.
</content>
</entry>
<entry>
<title>docs: sysview v2 and HIL-report specs and plans, skill-vs-technique criteria</title>
<updated>2026-09-03T21:21:57Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-11T10:08:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=dcb3fcfd30ac03b810d6de82674c008d5163400f'/>
<id>urn:sha1:dcb3fcfd30ac03b810d6de82674c008d5163400f</id>
<content type='text'>
The v2 post-mortem design and plan, the HIL performance-report design and
plan, and the promotion criteria for when a debugging technique earns its
own skill (added to the agents-workflows design).
</content>
</entry>
<entry>
<title>target-debug: route scheduling and timing questions to the sysview skill</title>
<updated>2026-09-03T21:21:57Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-11T10:08:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=7474173b075ae656ed16dea5dcb3f830349f3450'/>
<id>urn:sha1:7474173b075ae656ed16dea5dcb3f830349f3450</id>
<content type='text'>
RTOS/ISR scheduling, CPU load and latency-profile questions go to sysview
first; target-debug keeps the failure-hunting techniques. CLAUDE.md points
at the new skill.
</content>
</entry>
<entry>
<title>sysview: add the skill - headless SystemView capture and reporting</title>
<updated>2026-09-03T21:21:57Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T10:14:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=463ff1f3d2d97b53659364d7c4cde99693688100'/>
<id>urn:sha1:463ff1f3d2d97b53659364d7c4cde99693688100</id>
<content type='text'>
SKILL.md leads with the capture routes ranked by evidence: OpenOCD RTT
streaming through the rtt skill's tools/rtt.py (--channel 1
--reset-before-attach, since the Init record that carries the timestamp
frequency and sync preamble is emitted once at boot; 238 KB captured without
it decodes to zero events), the live GUI recorder under Xvfb for depth, and
--from-raw post-mortem decode last. boards.md holds the per-board reference:
probe routes, RAM bases, measured buffer sizes, the full-pool campaign table
and the honest capture status of every board tried, including the gaps:
nrf5340dk HardFaults in vTaskStartScheduler before any task runs; PIO-USB
host ISRs are invisible to level-1 coverage (fruit_jam); metro_m4_express is
attach-only (the SAMD5x DSU CPU Reset Extension holds the core after an
in-session reset run); WCH is dump-only - the QingKe SDI has no autonomous
memory access, so a persistent debug session corrupts the running core ~1.9 s
into USB traffic, ruled out against lock, post-mortem mode and firmware; a
stray TU_ASSERT still halts for inspection rather than being silenced.

sysview_record.py drives the capture end to end and refuses to back up its
own ini stub as the user's SystemView config (a SIGKILLed run had consumed
the real backup that way). sysview_report.py turns the exported CSV into
the JSON report: ISR load, function pairing and durations, workload-window
CPU load from the scheduling events. Returns are classified on the bare
'Returns' detail - SystemView annotates a duration on only ~0.5% of them
(measured on stm32f407disco and raspberry_pi_pico), and when the annotation
is absent the duration comes from the recorded timestamps, verified the
same quantity at 167.998 vs a declared 168.000 ticks/us over 264 annotated
returns. Both loss markers count as overflow: explicit '*** Overflow ***'
rows and 'Returns to *** OVERFLOW ***' exit contexts - only counting the
first understated real loss by two orders of magnitude.
</content>
</entry>
<entry>
<title>sysview: per-family RTT buffer defaults, 65536 on RAM-rich parts</title>
<updated>2026-09-03T21:21:57Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-11T10:07:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=d2de029fd9def460d66e87fd1088cc49ed0f4574'/>
<id>urn:sha1:d2de029fd9def460d66e87fd1088cc49ed0f4574</id>
<content type='text'>
The dual-role dogfood measured the 4096 fallback losing 96.7% of ISR exit
contexts on mimxrt1064_evk and 99.1% on metro_m4_express; a local-board run
measured stm32u575nucleo losing ~19% of the whole stream under a 12 s
cdc_msc workload. The default was too small for any real capture on fast
parts and every user had to rediscover that per board.

Families now declare SYSVIEW_BUFFER_SIZE_DEFAULT in family.cmake (the
SYSVIEW_RAM_BASE_DEFAULT pattern): imxrt, nrf, rp2040, samd5x_e5x, stm32f4,
stm32f7, stm32h7 and stm32u5 set 65536, the measured-safe value.
-DSYSVIEW_BUFFER_SIZE still beats everything; small-RAM parts keep the 4096
fallback and their per-board overrides (stm32f072disco's 2048 verified
still honoured). lpc55 measured 34 lost events on the same route, an order
of magnitude lighter, so it keeps the fallback rather than inheriting a
default on thin evidence.
</content>
</entry>
<entry>
<title>sysview: share the WCH RTT configuration and interrupt lock</title>
<updated>2026-09-03T21:21:57Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-08-11T10:07:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=95ec96b2962ebe57a43902495fd76e40dfb5558d'/>
<id>urn:sha1:95ec96b2962ebe57a43902495fd76e40dfb5558d</id>
<content type='text'>
One sysview_rtt_conf_wch.h serves every WCH family instead of a per-family
copy; ch583 keeps its own RTT lock header because its interrupt controller
needs a different masking sequence than the ch32v parts.
</content>
</entry>
<entry>
<title>sysview: take the timestamp from a BSP hardware timer where the core has no DWT</title>
<updated>2026-09-03T21:21:57Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T10:14:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=5a0d707dd96ae7821d97793b441b86aabb684855'/>
<id>urn:sha1:5a0d707dd96ae7821d97793b441b86aabb684855</id>
<content type='text'>
Cortex-M0/M0+, the WCH RISC-V parts and MAX3266x have no usable DWT cycle
counter, so their family.c provides SEGGER_SYSVIEW_X_GetTimestamp() from a
free-running hardware timer: a 32-bit general-purpose timer on ST parts
(sysview_stm32_tim2.h), SysTick-extended sources on the M0 families, the
core's SysTick-equivalent on WCH with the documented ordered read of the
split count registers (sysview_wch_timestamp.h), and a TMR on MAX3266x
(sysview_max32_tmr.h).

max32666fthr's DWT implements only watchpoint comparators (DWT_CTRL.NOCYCCNT=1
read live; UG6971 documents no DWT/trace at all), so SystemView's ARMv7-M
default read 0xE0001004 as a frozen 0 and every duration decoded as zero. The
TMR runs at 48 MHz (f_PCLK = f_SYS_CLK/2; Continuous mode, CMP=0xFFFFFFFF,
prescaler 1 - UG6971 15.2 guarantees TMRn_CNT readable while counting); TMR0
by default - present on every MAX32 part, unused by the examples, FreeRTOS
ticks on SysTick - overridable with -DSYSVIEW_MAX32_TMR=n. The family builds
SystemView with SEGGER_SYSVIEW_CORE_OTHER and sets CFG_TUSB_SYSVIEW_TIMESTAMP_BSP,
a tusb_sysview.c opt-in for ARMv7-M parts without CYCCNT where the BSP also
reports the rate via SEGGER_SYSVIEW_X_GetTimestampFreq(); the fixed-1MHz
microsecond contract is unreachable on a powers-of-two-only prescaler.
SEGGER_SYSVIEW_X_GetInterruptId() gains the ICSR.VECTACTIVE read for
CORE_OTHER builds. MAX32650/32690 use different GCR clock-gate names and stay
unported. Measured on the rig: seven host-timed 1.000 s gaps at
1.00044-1.00091 (median +0.05%).

stm32f0 refuses to configure SYSVIEW for stm32f070xb at CMake time: that
variant has no TIM2 at all, and the alternative was an undefined-reference
link error with no hint.

The shared hw/bsp/sysview_*.h join ci_select rule 16's hw/bsp file list
(cross-family build files, compiled only under -DSYSVIEW which no CI leg
enables), mirrored in the spec's rule table, so master's classification
guard resolves them on both axes.
</content>
</entry>
</feed>
