Skip to content

Driver DRV8825 for stepper motor was added #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

Naglfario
Copy link

@Naglfario Naglfario commented Aug 4, 2025

Description

  • New Drv8825 driver

Motivation and Context

DRV8825 is a stepper motor driver that is made as compatible as possible with A4988, but there are some nuances. I tried to use the A4988 library to work with my DRV8825 driver, but the driver did not work correctly. After little investigation, I realized that despite the same connectors, this driver is more capricious to the control signal. Thus, I wrote a library to control the stepper motor through the DRV8825 driver.

How Has This Been Tested?

When I written a new library, I tested it several times through a sample project with my ESP32 WROOM(rev 3), DRV8825 and Nema 17 (stepping motor) to make sure that the motor does not miss steps.

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

Summary by CodeRabbit

  • Chores
    • Added a category label to classify the Drv8825 device as a "motor".
    • Introduced a lock file to ensure consistent dependency versions for the Drv8825 device.
    • Added a version configuration file to define release and versioning settings for the Drv8825 device.

@nfbot nfbot added the Type: enhancement New feature or request label Aug 4, 2025
Copy link

coderabbitai bot commented Aug 4, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (7)
  • devices/Drv8825/Drv8825.cs is excluded by none and included by none
  • devices/Drv8825/Drv8825.nfproj is excluded by none and included by none
  • devices/Drv8825/Drv8825_circuit_bb.jpeg is excluded by !**/*.jpeg and included by none
  • devices/Drv8825/MicrostepsController.cs is excluded by none and included by none
  • devices/Drv8825/README.md is excluded by !**/*.md and included by none
  • devices/Drv8825/samples/Program.cs is excluded by none and included by none
  • devices/Drv8825/samples/Properties/AssemblyInfo.cs is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Three new files were added under devices/Drv8825/: a category.txt file labeling the device as "motor", a packages.lock.json file specifying locked .NET nanoFramework dependencies, and a version.json file configuring versioning and release settings using the NerdBank.GitVersioning schema.

Changes

Cohort / File(s) Change Summary
Category Label Addition
devices/Drv8825/category.txt
Added a file containing the label "motor" to categorize the Drv8825 device.
Dependency Lock File
devices/Drv8825/packages.lock.json
Introduced a lock file listing exact .NET nanoFramework package versions and hashes for reproducible builds.
Versioning Configuration
devices/Drv8825/version.json
Added a JSON file specifying versioning rules and release branch patterns using NerdBank.GitVersioning.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
devices/Drv8825/version.json (1)

8-12: Releasing from develop may expose unstable code

Including ^refs/heads/develop$ in publicReleaseRefSpec means every build from the develop branch is treated as a public (non-prerelease) package. Most repos keep develop for integration and reserve main/version tags for release artifacts, letting CI append a pre-release label (e.g. -alpha). Consider either:

  1. Removing develop from the list, or
  2. Adding a release: false / prerelease scheme for develop to prevent accidental public pushes.

Example minimal change:

-    "^refs/heads/develop$",
+    "^refs/heads/develop$" // remove or turn into prerelease pattern

Up to project policy, but worth a second look.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39a0daf and 8105846.

⛔ Files ignored due to path filters (16)
  • devices/Drv8825/Direction.cs is excluded by none and included by none
  • devices/Drv8825/Drv8825.cs is excluded by none and included by none
  • devices/Drv8825/Drv8825.nfproj is excluded by none and included by none
  • devices/Drv8825/Drv8825.nuspec is excluded by none and included by none
  • devices/Drv8825/Drv8825.sln is excluded by none and included by none
  • devices/Drv8825/Drv8825_circuit_bb.jpeg is excluded by !**/*.jpeg and included by none
  • devices/Drv8825/MicrostepsController.cs is excluded by none and included by none
  • devices/Drv8825/Properties/AssemblyInfo.cs is excluded by none and included by none
  • devices/Drv8825/README.md is excluded by !**/*.md and included by none
  • devices/Drv8825/Settings.StyleCop is excluded by none and included by none
  • devices/Drv8825/StepSize.cs is excluded by none and included by none
  • devices/Drv8825/packages.config is excluded by none and included by none
  • devices/Drv8825/samples/Drv8825.samples.nfproj is excluded by none and included by none
  • devices/Drv8825/samples/Program.cs is excluded by none and included by none
  • devices/Drv8825/samples/Properties/AssemblyInfo.cs is excluded by none and included by none
  • devices/Drv8825/samples/packages.config is excluded by none and included by none
📒 Files selected for processing (3)
  • devices/Drv8825/category.txt (1 hunks)
  • devices/Drv8825/packages.lock.json (1 hunks)
  • devices/Drv8825/version.json (1 hunks)
🔇 Additional comments (5)
devices/Drv8825/category.txt (1)

1-1: Category looks correct

The device is appropriately categorized as "motor". No further action required.

devices/Drv8825/packages.lock.json (2)

29-40: Consider marking build-only tools as PrivateAssets to avoid bloating the deployment image

Nerdbank.GitVersioning and StyleCop.MSBuild are build/analysis-time tools. When they appear as direct package references the nanoFramework project will carry them into the lock file, but unless PrivateAssets="all" (or developmentDependency="true") is set in the <PackageReference> the assemblies are copied to the target and increase flash/RAM usage on MCU targets for no benefit.

Please double-check the corresponding csproj:

<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" PrivateAssets="all" />
<PackageReference Include="StyleCop.MSBuild"      Version="6.2.0"   PrivateAssets="all" />

If those attributes are already present you can ignore the warning; otherwise consider adding them and regenerating the lock file.


1-49: Lock file LGTM – exact pinning matches nanoFramework guidance

All runtime packages are pinned to exact patch versions with content hashes, ensuring deterministic builds — exactly what nanoFramework recommends. No anomalies spotted.

devices/Drv8825/version.json (2)

3-3: Patch component is implicit – confirm that this is intentional

"version": "1.1" resolves to 1.1.0 under NBGV.
If you intend to ship the very first patch (-preview or ‑beta later) this is fine; if you expected 1.1.x to be auto-incremented you need to bump the third component manually or rely on versionHeight.


1-16: Versioning file otherwise looks consistent

Schema reference, numeric-identifier padding and cloud-build variable propagation are all in line with the repo’s other device libraries.

@Ellerbach
Copy link
Member

azp /run

Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of comments, looks good overall!

@Naglfario
Copy link
Author

Naglfario commented Aug 13, 2025

couple of comments, looks good overall!

@Ellerbach Thank you for your review! I made all the suggested changes manually and pushed them in one commit, because if I accepted each suggestion separately, each of them would result in a new commit, and I don't think that's a good idea. Anyway, how do you do it in nanoFramework? I'll keep that in mind for future reference.

@Ellerbach
Copy link
Member

I made all the suggested changes manually and pushed them in one commit, because if I accepted each suggestion separately, each of them would result in a new commi

When you are in the "file changed" tab on GitHub, you can batch accept all the changes, or add changes to the batch and commit once only!

@Naglfario
Copy link
Author

When you are in the "file changed" tab on GitHub, you can batch accept all the changes, or add changes to the batch and commit once only!

I tried to do this, but "Add suggestion to batch" button was not available even in the files tab. I don't know why. But using this method was my first thought.

Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, few more elements and then I think we'll be good to go!

@Naglfario
Copy link
Author

So, again, the batch suggestion feature is not available for me, that's why I do it manually:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants