This PR adds a complete STM32 port for FastAccelStepper, targeting the STM32duino toolchain. Step pulses are generated via TIM2/TIM3 compare-match ISR with GPIO BSRR bit-bang, allowing any GPIO pin to be used as a step pin. Deferred queue filling runs in PendSV at the lowest NVIC priority.#364
Open
Tyuyt3975 wants to merge 43 commits into
Open
This PR adds a complete STM32 port for FastAccelStepper, targeting the STM32duino toolchain. Step pulses are generated via TIM2/TIM3 compare-match ISR with GPIO BSRR bit-bang, allowing any GPIO pin to be used as a step pin. Deferred queue filling runs in PendSV at the lowest NVIC priority.#364Tyuyt3975 wants to merge 43 commits into
Tyuyt3975 wants to merge 43 commits into
Conversation
- Phase 2A: Spurious interrupt guard (FAS_SPURIOUS_MAX counter + channel disable) - Phase 2B: FreeRTOS compile-time warning (configUSE_PORT_OPTIMISED_TASK_SELECTION) - Phase 2C: NVIC priority documentation for jitter protection - README: enhanced FreeRTOS compatibility section
- Phase 2A: Spurious interrupt guard (FAS_SPURIOUS_MAX counter + channel disable) - Phase 2B: FreeRTOS compile-time warning (configUSE_PORT_OPTIMISED_TASK_SELECTION) - Phase 2C: NVIC priority documentation for jitter protection - README: enhanced FreeRTOS compatibility section
…in the G0 framework), now PASS with 16-bit TIM3
framework-arduinostm32@4.21200.0 for the Nucleo G070RB defines STM32G070xx (in the variant file); it DOES NOT define STM32G0 or STM32G0xx. The current code aliases STM32G0 → STM32G0xx (lines 23-25), but it fails to catch STM32G070xx:
…zero-assumption hardware matrix
Author
|
Dear @gin66, I'm reaching out regarding PR #364 (STM32 backend support). I have successfully run and passed the CI compile workflows on my local fork across the complete STM32 test matrix. Since this is a new contribution, the GitHub Actions workflows are currently pending your approval ("Action required"). Could you please approve and run the workflows so the automated checks can proceed on this repository? The PR is fully ready for your review whenever you have the time. Thank you! |
Owner
|
Great. Now all build tests pass and nothing is broken. How is the test on HW going ? |
Author
|
Dear gin66, |
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
Add full STM32 platform support to FastAccelStepper via a new
pd_stm32backend, enabling stepper motor control on STM32 microcontrollers using the Arduino framework (stm32duino).What's changed
New platform driver (
src/pd_stm32/)stm32_queue.cpp/stm32_queue.h: timer-based step queue using hardware TIM capture-compare. Supports three timer groups across all major STM32 families:pd_config.h: compile-timeTICKS_PER_Swith per-family prescaler documentation, queue topology, and feature flagssrc/fas_arch/arduino_stm32.h: arch detection header (FAS_STM32)getTimClock()with dedicated H5xx branch usingRCC->CFGR2fas_stm32_clock_errordiagnostic: detects non-integer prescaler (= 2) or unsupported clock (= 1)STEP_PULSE_WIDTH_TICKSpulse controlCI: 5 STM32 boards added to build matrix
TICKS_PER_Sbluepill_f103c8nucleo_g070rbblackpill_f401ccnucleo_h743zinucleo_l476rgAll 5 boards pass 19 examples × 5 boards = 95 builds in
build_arduino_examples_matrix.yml.Example compatibility
#ifdef ARDUINO_ARCH_STM32guards for pin assignments)Testing
Build examples)fas_stm32_clock_errorvalidated for G070 (exact 16MHz) and H743 (non-integer prescaler path)Notes
TICKS_PER_Smust match a value inRampCalculator.h(16M, 16.8M, 18M, 20M); a#errorfires at compile time otherwiseTICKS_PER_S, then setsfas_stm32_clock_error = 2if rounding occurred