Skip to content

feat(tools): add can_tester PC-side debugging tool#43

Draft
Yusuf-Serdar wants to merge 1 commit into
mainfrom
feat/can-tester
Draft

feat(tools): add can_tester PC-side debugging tool#43
Yusuf-Serdar wants to merge 1 commit into
mainfrom
feat/can-tester

Conversation

@Yusuf-Serdar
Copy link
Copy Markdown
Contributor

@Yusuf-Serdar Yusuf-Serdar commented May 6, 2026

Summary

Ports tools/can_tester/ from PicoLowLevel, updated for the STM32LowLevel CAN FD protocol.

Closes #41

Changes

Protocol updates

  • CAN FD: fd=True, bitrate_switch=True on all sent frames; --data-bitrate / -D arg (default 2 Mbit/s) added to CLI and web dashboard
  • Bitrate: default 125 kbps → 1 Mbit/s arbitration + 2 Mbit/s data (matches FDCAN2 config)
  • MsgType: removed DATA_PITCH = 0x04 (not in communication.h); enum now has exactly 44 entries, all verified against Inc/communication.h
  • Modules: MK2_MOD1 / MOD2 / MOD3 only — MK1 variants removed from CLI choices and web dashboard dropdown

header_parser

  • Updated _DEFAULT_INCLUDE_DIR to point to STM32LowLevel/Inc
  • Added #if A == B / #elif A == B regex support for MODULE_DEFINE == MK2_MOD1 style guards
  • Added #define NAME IDENTIFIER resolution (handles #define CAN_ID MK2_MOD1)
  • Added _MODULE_ADDRESSES map and predefined_values injection for parse_mod_config()

Bug fix

  • cli.py _handle_send: parts[2]args[1] (wrong variable used for "permanent" flag check)

Validation

  • test_dry.py runs without hardware; all tests pass:
    • CAN ID encode/decode round-trip
    • Payload codec (MOTOR_SETPOINT, ARM_PITCH, RESET_ARM)
    • Module config: CAN_ID 0x21/0x22/0x23 verified per variant
    • MsgType count == 44
    • 7 test sequences importable

- Port tools/can_tester/ from PicoLowLevel with updates for STM32LowLevel
CAN FD protocol
@Yusuf-Serdar Yusuf-Serdar added this to the LL v1.0 milestone May 6, 2026
@Yusuf-Serdar Yusuf-Serdar marked this pull request as draft May 6, 2026 13:29
@Yusuf-Serdar Yusuf-Serdar removed this from the LL v1.0 milestone May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate CAN tester tool from PicoLowLevel

1 participant