Repository navigation
Conversation
… stall Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Thanks for the PR, and thanks for noticing this in the first place 👍 Also affects the ESP32-C61 (but not ESP32-C6), so I merged it as 3ab3b65 I think enabling the bluetooth modem clock is a good enough fix for now. Seems like at least one of the bits inside the I will leave this PR open in case we find a different / better solution in the future. |
|
Thanks for taking it, and for checking the C61 and the C6. Leaving the PR open is fine with me. |
This is mainly a problem report. The 9-line change is here to show the cause and is for reference only; I am not asking for it to be merged as it stands, and would like to hear how you would prefer to handle it.
Problem. On the C5 the
<capture-microseconds>field of theDATAreply is about 1.64 ms longer than the samples themselves:CAP 16380 0reports about 1880 µs for 205 µs of samples at 80 MS/s. The same fixed cost holds a 256-pointSPECat 429 FFT/s, at 80 and at 4 MS/s alike.Cause. Vendor
adctrig()reads and then writes0x600a20b4(it clears bit 0) before starting the capture. That register is in the BT block, and nothing in ESP-SDR turns the BT modem clock on, so each of the two accesses only returns after about 819 µs. That is 65536 cycles at 80 MHz, so it looks like a bus timeout. I found it by writing out theadctrigmode-0 sequence from the disassembly and timing each step; every other step takes 0–4 µs.The change. One call to
modem_clock_module_enable(PERIPH_BT_MODULE)at start-up, C5 only. In the pinned IDF this enables the BLE MAC, BT/802.15.4 common baseband and ETM clocks (plus COEXIST, which Wi-Fi already holds), reference-counted. It does not start the BT controller.Measured (
a8eaac1against this branch, 5300 MHz, manual gain 40, medians):a8eaac1reports (µs)SPEC(FFT/s)a8eaac1CAP(six rates) andSPECon this branch, 90 minutes on each v1.0 board: in total 16518 captures and 6.9 million spectrum frames with no command, CRC or frame-sequence error; the 80 MS/s capture time stayed within 234–248 µs.CAPround trips over USB hardly change (12–13 per second either way); the gain is in what runs on the chip.GAIN HARDWAREon a busy channel more often still carries the manual gain index (12 % against 4–7 % with no delay, almost none from 4 ms on). Both builds do this; the earlier start only makes it more visible.Not checked, and questions.
stock_capture()clears the same bit of0x600a20b4directly. I have neither board, so I do not know whether they wait too;<capture-microseconds>forCAP 16380 0against 205 µs would show it.Whether to enable the clock, skip the access, or leave it as it is, is your call. Happy to rework or drop this.
Co-worked with Claude Code