metronome/hardware/kicad
Me Here c625a8aaa2 Firmware push fix on both Kit (0.0.24) + Explorer (0.0.4)
Diagnosed from the user's console output - 25 chunks pushed cleanly at
~124ms each, then stalled. Two coupled causes:

1) Bus contention. tick() and Live sync share self.midi with the chunk
   ACKs. While the device was processing a chunk, a Note On / Clock Out /
   Live-sync FULL heartbeat could land on the same MIDI OUT stream and
   the host's parser dropped the interleaved ACK SysEx.

   Fix: self._fw_pushing flag set on 0x21 BEGIN, cleared on 0x23 COMMIT
   or any error. midi_send / Clock Out / _sync_broadcast / _sync_broadcast_full
   all early-out when _fw_pushing is True. Only ACKs go out during a push.

2) SysEx assembler garbage. self._sx = bytearray() per chunk leaks ~70
   bytes / chunk that only GC'd every 50 chunks. 25 chunks of trash plus a
   slow heap walked the wrong way explains the ramp-up to 174 -> 119 -> 124
   ms ACK times. GC every chunk now (~30ms cost on RP2040/RP2350 with
   small heap) so the assembler buffer is always fresh.

Same patch on both pico-cp/ and pico-explorer/ since the bug is identical.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 22:51:46 -05:00
..
.gitignore PM_K-1 hardware: Stage 1 input receiver as SKiDL (code-defined schematic) 2026-05-30 19:43:07 -05:00
audio_chain.erc PM_K-1 hardware: integrate audio chain into one netlist (dedup shared parts) 2026-05-30 20:41:39 -05:00
audio_chain.log PM_K-1 hardware: integrate audio chain into one netlist (dedup shared parts) 2026-05-30 20:41:39 -05:00
audio_chain_sklib.py PM_K-1 hardware: integrate audio chain into one netlist (dedup shared parts) 2026-05-30 20:41:39 -05:00
mcu_core.erc PM_K-1 hardware: RP2350 core (MCU + flash + crystal + USB + boot/reset + SWD) 2026-05-30 21:56:12 -05:00
mcu_core.log PM_K-1 hardware: RP2350 core (MCU + flash + crystal + USB + boot/reset + SWD) 2026-05-30 21:56:12 -05:00
mcu_core_sklib.py PM_K-1 hardware: RP2350 core (MCU + flash + crystal + USB + boot/reset + SWD) 2026-05-30 21:56:12 -05:00
pm_k1_core.kicad_pro PM_K-1 hardware: core-board design-of-record + KiCad scaffold 2026-05-30 11:42:45 -05:00
pm_k1_core.kicad_sch PM_K-1 hardware: core-board design-of-record + KiCad scaffold 2026-05-30 11:42:45 -05:00
power_tree.erc PM_K-1 hardware: power tree (USB 5V -> +/-18V switcher -> clean +/-15V LDOs + 3V3) 2026-05-30 20:53:44 -05:00
power_tree.log PM_K-1 hardware: power tree (USB 5V -> +/-18V switcher -> clean +/-15V LDOs + 3V3) 2026-05-30 20:53:44 -05:00
power_tree_sklib.py PM_K-1 hardware: power tree (USB 5V -> +/-18V switcher -> clean +/-15V LDOs + 3V3) 2026-05-30 20:53:44 -05:00
rtc.erc Firmware push fix on both Kit (0.0.24) + Explorer (0.0.4) 2026-05-30 22:51:46 -05:00
rtc.log Firmware push fix on both Kit (0.0.24) + Explorer (0.0.4) 2026-05-30 22:51:46 -05:00
rtc_sklib.py Firmware push fix on both Kit (0.0.24) + Explorer (0.0.4) 2026-05-30 22:51:46 -05:00
skidl.erc PM_K-1 hardware: Stage 1 input receiver as SKiDL (code-defined schematic) 2026-05-30 19:43:07 -05:00
skidl.log PM_K-1 hardware: Stage 1 input receiver as SKiDL (code-defined schematic) 2026-05-30 19:43:07 -05:00
skidl_REPL.erc PM_K-1 hardware: Stage 1 audio (input receiver) sims + container libs 2026-05-30 19:27:25 -05:00
skidl_REPL.log PM_K-1 hardware: Stage 1 audio (input receiver) sims + container libs 2026-05-30 19:27:25 -05:00
stage1_input.erc PM_K-1 hardware: Stage 1 input receiver as SKiDL (code-defined schematic) 2026-05-30 19:43:07 -05:00
stage1_input.log PM_K-1 hardware: verify THAT1240 against datasheet; fix pinout + part numbers 2026-05-30 19:48:41 -05:00
stage1_input_sklib.py PM_K-1 hardware: verify THAT1240 against datasheet; fix pinout + part numbers 2026-05-30 19:48:41 -05:00
stage1b_select.erc PM_K-1 hardware: Stage 1b -- Hi-Z instrument DI buffer + line/inst select relay 2026-05-30 19:56:55 -05:00
stage1b_select.log PM_K-1 hardware: Stage 1b -- Hi-Z instrument DI buffer + line/inst select relay 2026-05-30 19:56:55 -05:00
stage1b_select_sklib.py PM_K-1 hardware: Stage 1b -- Hi-Z instrument DI buffer + line/inst select relay 2026-05-30 19:56:55 -05:00
stage2_dac.erc PM_K-1 hardware: resolve TQ2SA relay pinout; Stage 2 DAC + reconstruction filter 2026-05-30 20:06:26 -05:00
stage2_dac.log PM_K-1 hardware: resolve TQ2SA relay pinout; Stage 2 DAC + reconstruction filter 2026-05-30 20:06:26 -05:00
stage2_dac_sklib.py PM_K-1 hardware: resolve TQ2SA relay pinout; Stage 2 DAC + reconstruction filter 2026-05-30 20:06:26 -05:00
stage3_sum.erc PM_K-1 hardware: Stage 3 -- summing node (selected input + click) 2026-05-30 20:15:17 -05:00
stage3_sum.log PM_K-1 hardware: Stage 3 -- summing node (selected input + click) 2026-05-30 20:15:17 -05:00
stage3_sum_sklib.py PM_K-1 hardware: Stage 3 -- summing node (selected input + click) 2026-05-30 20:15:17 -05:00
stage4_driver.erc PM_K-1 hardware: Stage 4 -- balanced output driver (completes the audio chain) 2026-05-30 20:27:04 -05:00
stage4_driver.log PM_K-1 hardware: Stage 4 -- balanced output driver (completes the audio chain) 2026-05-30 20:27:04 -05:00
stage4_driver_sklib.py PM_K-1 hardware: Stage 4 -- balanced output driver (completes the audio chain) 2026-05-30 20:27:04 -05:00