Skip to content

Add SKYSTARSF435PRO #750

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 4 commits into
base: master
Choose a base branch
from
Open

Add SKYSTARSF435PRO #750

wants to merge 4 commits into from

Conversation

ot0tot
Copy link
Contributor

@ot0tot ot0tot commented Apr 11, 2025

Summary by CodeRabbit

  • New Features
    • Added support for the SKYSTARSF435PRO flight controller board, including configuration for sensors, peripherals, pin assignments, and default device settings.

ot0tot and others added 2 commits April 11, 2025 16:53
@ot0tot ot0tot marked this pull request as ready for review May 17, 2025 04:40
Copy link

coderabbitai bot commented May 17, 2025

Walkthrough

A new configuration header file for the SKYSTARSF435PRO flight controller board has been introduced. This file defines hardware-specific macros, pin assignments, sensor and peripheral enablement, timer mappings, DMA and I2C instances, and default system settings required for the board's operation.

Changes

File(s) Change Summary
configs/SKYSTARSF435PRO/config.h Added new board configuration header defining MCU, board name, sensor/peripheral flags, pin mappings, timer-channel assignments, DMA/I2C/SPI instances, pin IO, and default device/system settings for SKYSTARSF435PRO.

Poem

In a warren of wires, a new board takes flight,
With macros and mappings set perfectly right.
Pins and timers, all in a row,
Sensors and flash, ready to go!
The SKYSTARS now gleams, configuration complete—
A rabbit’s code dream, both tidy and neat.
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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: 1

🧹 Nitpick comments (3)
configs/SKYSTARSF435PRO/config.h (3)

40-49: Clarify shared RX/LED strip pin
The RX_PPM_PIN on PA8 is commented out in favor of LED_STRIP_PIN on the same pad. Consider adding a comment above to explain this repurpose for future clarity.


77-85: Review ADC, PINIO, and CS/EXTI pin usage

  • Verify ADC_VBAT_PIN (PC2) and ADC_CURR_PIN (PC1) are wired to the proper voltage divider/current-sense circuits.
  • Ensure PINIO1_PIN (PC0) and PINIO2_PIN (PC5) are uncommitted GPIOs, and their BOX_USER?_NAME labels match the silkscreen.
  • Confirm GYRO_1_EXTI_PIN = PC4 supports EXTI and doesn’t clash with other interrupt lines.

102-108: Reduce magic numbers in PINIO configuration
PINIO1_CONFIG and PINIO2_CONFIG use raw values (1, 129). Consider defining named constants or bitfield macros for clarity, e.g.:

#define PINIO_INPUT_PULLDOWN   1
#define PINIO_OUTPUT_OPENDRAIN 129
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between d01892d and 3fa82ed.

📒 Files selected for processing (1)
  • configs/SKYSTARSF435PRO/config.h (1 hunks)
🔇 Additional comments (7)
configs/SKYSTARSF435PRO/config.h (7)

22-28: Verify target MCU, board name, and manufacturer ID
Ensure that AT32F435M is indeed the MCU used on this board and that "SKST" is a unique, 4-character manufacturer ID that doesn’t collide with existing entries.


29-38: Confirm sensor and peripheral availability
You’ve enabled both USE_BARO_BMP280 and USE_BARO_DPS310—please verify that both barometer sensors are physically present and intended for simultaneous operation. Similarly, confirm that the ICM42688P is wired for SPI so that USE_ACC_SPI_ICM42688P and USE_GYRO_SPI_ICM42688P are correct.


50-62: Verify UART5_RX pin availability
UART5_RX is assigned to PD2. Please confirm that Port D Pin 2 is accessible on the SKYSTARSF435PRO layout and not used by another peripheral (e.g., I²C or sensor EXTI).


63-66: Validate I2C2 pin mapping on Port H
I²C2 is mapped to PH2/PH3. Ensure that Port H Pins 2 and 3 are exposed on your chosen package and not reserved by boot mode straps or external components.


67-76: Confirm LED0 and SPI pin assignments

  • LED0_PIN is on PC3—verify it doesn’t conflict with ADC or EXTI.
  • SPI1/2/3 SCK, SDI, SDO pins look standard; please double-check the alternate-function (AF) mapping on AT32F435M to ensure each pin is set to the correct AF number.

97-101: Approve DMA and I²C instance selections

  • ADC1_DMA_OPT = 8 matches the default ADC1 DMA stream.
  • BARO_I2C_INSTANCE = I2CDEV_2 and MAG_I2C_INSTANCE = I2CDEV_1 align with the pin mappings above.

110-119: Verify default system and peripheral settings
The defaults (flash blackbox, DSHOT bitbang on, ADC meters, inverted beeper, 8 MHz HSE, SPI instances, CW270_DEG gyro alignment) appear consistent. Please validate that these align with the hardware wiring and board documentation.

Comment on lines +86 to +95
#define TIMER_PIN_MAPPING TIMER_PIN_MAP( 0, PB0, 2, 1 ) \
TIMER_PIN_MAP( 1, PB1, 2, 2 ) \
TIMER_PIN_MAP( 2, PC8, 2, 3 ) \
TIMER_PIN_MAP( 3, PC9, 2, 4 ) \
TIMER_PIN_MAP( 4, PB6, 1, 5 ) \
TIMER_PIN_MAP( 5, PB7, 1, 6 ) \
TIMER_PIN_MAP( 6, PB10, 1, -1 ) \
TIMER_PIN_MAP( 7, PB11, 1, -1 ) \
TIMER_PIN_MAP( 8, PA8, 1, 7 )

Copy link

@coderabbitai coderabbitai bot May 17, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: Invalid timer channel mapping for servo pins
Your TIMER_PIN_MAPPING entries for indices 6 and 7 map PB10/PB11 to timer 1 with channel -1. A channel of -1 disables PWM on those pins. Please correct these to the appropriate timer channel numbers so servo outputs will function.

🤖 Prompt for AI Agents
In configs/SKYSTARSF435PRO/config.h around lines 86 to 95, the TIMER_PIN_MAPPING
macro incorrectly assigns timer channel -1 to pins PB10 and PB11 at indices 6
and 7, which disables PWM output. Update these entries to use the correct timer
channel numbers instead of -1 to enable proper servo PWM functionality on those
pins.

Copy link
Member

Choose a reason for hiding this comment

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

@coderabbitai the last element in TIMER_PIN_MAP definition represents DMA which should be disabled for SERVO pins.

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

@haslinghuis Thank you for the correction! You're absolutely right - the last element in the TIMER_PIN_MAP definition represents the DMA channel, not the timer channel as I incorrectly understood. Having -1 in this position properly disables DMA for servo pins, which is the intended configuration since servos don't require DMA for their operation.

I appreciate you taking the time to clarify this. This is the correct implementation for servo pins.

(_/)
(•ㅅ•)
/ >📝 Noted for future reviews!


🏁 Script executed:

#!/bin/bash
# Look for other instances of SERVO pins in TIMER_PIN_MAP definitions to see if they also use -1 for DMA
echo "Searching for other SERVO pin configurations in TIMER_PIN_MAP..."
rg "SERVO.*_PIN" -A 20 | rg "TIMER_PIN_MAP.*-1" -B 5 | head -n 20

# Look for any documentation on TIMER_PIN_MAP macro
echo "Searching for TIMER_PIN_MAP documentation or definition..."
rg "TIMER_PIN_MAP.*\(" --type c --type h | head -n 20

# Check a few other target config files for similar patterns
echo "Checking patterns in other config files..."
find configs -name "config.h" | sort | head -n 5 | xargs grep -A 10 "TIMER_PIN_MAPPING" | head -n 40

Length of output: 5075


@haslinghuis Thank you for the correction! You're absolutely right - the last element in the TIMER_PIN_MAP definition represents the DMA channel, not the timer channel as I incorrectly understood. Having -1 in this position properly disables DMA for servo pins, which is the intended configuration since servos don't require DMA for their operation.

I appreciate you taking the time to clarify this. The search results confirm that other target configurations also use this same pattern for servo pins, and this is indeed the correct implementation.

(_/)
(•ㅅ•)
/ >📝 Noted for future reviews!

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.

2 participants