Repository navigation
Add RTT telemetry and live plot tool (pyOCD + matplotlib) - #11
Merged
Merged
Conversation
Firmware (DEBUG_RTT): - Debug command p (p1 on, p0 off) prints "$H,<fields>" then "$T,<values>" every TIME_TELEMETRY ms (20). Fields follow the enabled features: sensors, IMU accel/gyro/temp, AHRS angles, frame sent to the mainboard and last valid feedback frame. - Hoverserial: getCommand(), getFeedback(), getFeedbackCount(). tools/rtt_monitor.py: - Attaches with pyOCD (generic cortex_m target, works for GD32 and STM32), reads the _SEGGER_RTT address from the firmware ELF, enables telemetry, plots it live with matplotlib, optional CSV, forwards console input. CI: py_compile check for tools/*.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The TELEM macros expanded ~30 print calls of different types inline and pushed GD32F130C6 all/icm20948-ahrs over 32 KB (by 572/440 bytes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Telemetry (p) prints the same accel/gyro/temperature/angle values, and rtt_monitor.py plots them. Frees flash: GD32F130C6 all/icm20948-ahrs were 256/124 bytes over 32 KB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # .github/workflows/build.yml
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.
What
Firmware (only with
DEBUG_RTT)p(p1on,p0off,ptoggles). Prints a header$H,<fields>and then one$T,<values>line everyTIME_TELEMETRYms (20 ms,config.h).ms, s1, s2, IMUax..az, gx..gz, imu_temp, AHRSroll, pitch, yaw, sent frametx_cmd1, tx_cmd2, tx_pitch, tx_dpitch, tx_sensors, feedbackrx_frames, rx_cmd1, rx_cmd2, rx_speedR, rx_speedL, rx_bat, rx_temp, rx_led.Hoverserial:getCommand(),getFeedback(),getFeedbackCount().a,g,t,q,e: telemetry carries the same values, and they freed the flash telemetry needed on GD32F130C6 (all/icm20948-ahrswere 256/124 bytes over). Telemetry print helpers are functions, not macros, for the same reason.tools/rtt_monitor.pycortex_mtarget, so GD32 needs no pack. The RTT control block address comes from_SEGGER_RTTin.pio/build/<env>/firmware.elf(--env/--elf), or--rtt-address/--rtt-size.p1, plots the groups present in the header (angles, gyro, accel, sent commands, sent pitch, received speed, battery/temp, sensors) over a sliding window (--window, 10 s), optional--csv. Other RTT lines are printed; console input is forwarded (?,i, ...). Sendsp0on exit.README section and
tools/requirements.txtadded; CI gets apy_compilejob fortools/*.py.CI
30/33: only the known STM32F103C6 IMU+AHRS overflows remain (STM32F103C6
allwent from 11.9 to 11.8 KB over).Tested
cortex_mattach on GD32, RTT throughput at 50 Hz (512 B up buffer; truncated lines are dropped).🤖 Generated with Claude Code