StallGuard telemetry (not real sg yet), firmware improvements, TMC2209 UART init fix (2x uart still not working)#150
Merged
Conversation
When a Pico is already in bootloader mode, the block device appears (/dev/sda1, label RPI-RP2) but may not be auto-mounted. The previous code only checked mounted paths, so it fell through to serial scanning and bailed with "No Pico boards found over USB". Now checks the block device before scanning serial ports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Telemetry DB (stepper_telemetry.py): runs + samples tables in local_state.sqlite, self-creating, with downsampling-on-read and a retention prune. - StallGuard sweep endpoint now records each run + full per-sample context and returns run_id; added loaded/label params (loaded -> stall_test). - Query router (server/routers/telemetry.py): list/summary/run/samples/delete. - Frontend page (settings/stepper-stallguard) + StallGuardChart.svelte: per-motor summary, run list, canvas SG load-curve chart, sweep controls, save-SGTHRS-to-TOML. - Firmware (sorter_interface_firmware.cpp): leave stepper nEN HIGH at boot, enable per-channel on first move / explicit enable so motors don't hold at boot. NOTE: this file also carries pre-existing GET_VERSION work, entangled in the same working-tree edit; included here since it can't be split non-interactively. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Prevents machine-specific config from being swept into commits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
TMC_UART_BUS_COUNT was a `const uint8_t`, but it gates `#if TMC_UART_BUS_COUNT > 1` blocks that construct and route the second TMC UART bus. The preprocessor cannot see a C++ const (it evaluates as 0), so `#if 0 > 1` was false and the entire second bus was compiled out on v1-2 — every channel silently fell back to bus 0. Make it a #define so the conditional sees the real count. v1-1 and skr stay at 1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bake git describe, short commit, UTC build time, and the hw/role variant into the firmware at configure time and expose them through the already-present GET_VERSION command handler. Add the matching host-side MCUDevice.get_version() so the backend can read what is actually flashed on each board. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…fix DRV_STATUS CPU spike TMC2209 chips can reset (motor power rail cycling after Pico boot) and return to hardware defaults: I_SCALE_ANALOG=1 (current from VREF, not IRUN) and MSTEP_REG_SELECT=0 (microsteps from MS pins, not CHOPCONF). Backend now writes GCONF=0x1C0 (PD_DISABLE | MSTEP_REG_SELECT | MULTISTEP_FILT) at the top of each stepper's init sequence, before applying microsteps/current from machine.toml. Also remove continuous DRV_STATUS refresh from the 500ms StepperSidebar poll — it was reading all 15 TMC registers over USB serial every 500ms whenever the driver panel was open, causing ~500% CPU on the Pi. The panel still refreshes on open and after saving settings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
UART bus1 (uart1, ch4) is not currently working, so the chute stepper was unreachable over UART. Move it to bus0 where UART is confirmed functional. c_channel_2_rotor takes the lone bus1 slot (ch4) since it is less dependent on UART control right now. New channel order on bus0: chute(ch0), c1_rotor(ch1), c3_rotor(ch2), carousel(ch3). c2_rotor on bus1 ch4. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve api.py conflict by keeping both telemetry and tailscale routers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
stepper_telemetry.pySQLite store, backend routes (/api/stepper/telemetry/*), and a SvelteKit page at/settings/stepper-stallguardwith a StallGuardChart component for recording and visualizing SG_RESULT sweepsTMC_UART_BUS_COUNTpreprocessor visibility — was aconst uint8_t(invisible to#ifguards), now a#defineGET_VERSIONreports build version/variant — makes it easier to confirm which firmware is running on which boardI_SCALE_ANALOG=1(current from VREF, ignoring IRUN) andMSTEP_REG_SELECT=0(microsteps from hardware pins, ignoring CHOPCONF). Backend now writes GCONF=0x1C0 at the top of each stepper's init sequence, before applying microsteps/current from machine.tomlflash.py: handle RPI-RP2 block device not yet mounted on Linux.gitignore: ignoremachine.tomlin any directoryTest plan
POST /api/system/initializeafter deploy, verify GCONF reads back as0x1C0(not0x101) in the TMC panel/settings/stepper-stallguardand verify samples are recorded🤖 Generated with Claude Code