Skip to content

Add open source target PULPYF405PRO#1099

Open
ot0tot wants to merge 1 commit into
betaflight:masterfrom
ot0tot:Pulpy-F405-Pro
Open

Add open source target PULPYF405PRO#1099
ot0tot wants to merge 1 commit into
betaflight:masterfrom
ot0tot:Pulpy-F405-Pro

Conversation

@ot0tot
Copy link
Copy Markdown
Contributor

@ot0tot ot0tot commented May 8, 2026

Custom FC from Nayel (@medic4950) on the Betaflight Discord

Checklist (✓/✕, or y/n)

  • passed Betaflight team's schematics review
  • passed hardware samples testing
  • follows guidelines
  • follows connector standards
  • flight tested
  • comments/issues resolved

Summary by CodeRabbit

  • New Features
    • Added PULPYF405PRO board configuration with support for motion sensors (accelerometer/gyro), environmental sensing (barometer), SD card storage, and video output module functionality.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack

Walkthrough

This pull request adds a complete board configuration file for the PULPYF405PRO flight controller. The configuration specifies the STM32F405 MCU, enables sensor peripherals (IMU, barometer, video module), maps GPIO pins for all interfaces and actuators, and defines default subsystem parameters for blackbox storage, barometer/magnetometer bus selection, and voltage/current measurement sources.

Changes

PULPYF405PRO Board Configuration

Layer / File(s) Summary
Board Configuration
configs/PULPYF405PRO/config.h
Defines MCU target (STM32F405), board identity, enabled peripheral features (ICM42688P gyro/accel, DPS310 barometer, SPI SD card, MAX7456 video), GPIO pin assignments for all UART/I2C/SPI/ADC/timer/motor/servo/LED interfaces, timer pin mapping with channel polarities, and default subsystem configuration (blackbox device, barometer/magnetometer I2C/SPI selection, DSHOT mode, voltage/current meter sources, and HSE clock frequency).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • haslinghuis
  • sugaarK
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes a checklist with items marked as completed or pending, but lacks required sections like hardware compliance details, design guidelines adherence explanation, and schematics review information beyond checkbox marking. Expand the description to explain hardware compliance with design guidelines, provide details about the schematics review process, and clarify remaining unchecked items like hardware testing and flight testing status.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a new open source flight controller target (PULPYF405PRO), which matches the single file addition in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@configs/PULPYF405PRO/config.h`:
- Around line 80-92: The GYRO_1_CLKIN_PIN macro (GYRO_1_CLKIN_PIN = PB9)
conflicts with the TIMER_PIN_MAPPING entry that also lists PB9; remove PB9 from
the timer mapping so the gyro clock pin isn’t double-assigned. Edit the
TIMER_PIN_MAPPING block to eliminate or replace the TIMER_PIN_MAP(...) entry
that references PB9 (the one currently mapping index 9 or the PB9 occurrence),
leaving that timer slot with no pin (e.g., use -1) or choose an alternate unused
pin, ensuring only GYRO_1_CLKIN_PIN uses PB9.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 321db865-9f18-4b42-9d20-fd0b3f1bfc1c

📥 Commits

Reviewing files that changed from the base of the PR and between ee3d78a and 60398ad.

📒 Files selected for processing (1)
  • configs/PULPYF405PRO/config.h

Comment on lines +80 to +92
#define GYRO_1_CLKIN_PIN PB9

#define TIMER_PIN_MAPPING \
TIMER_PIN_MAP( 0, PB8 , 2, -1) \
TIMER_PIN_MAP( 1, PC6 , 2, 1) \
TIMER_PIN_MAP( 2, PC7 , 2, 1) \
TIMER_PIN_MAP( 3, PC8 , 2, 1) \
TIMER_PIN_MAP( 4, PC9 , 2, 0) \
TIMER_PIN_MAP( 5, PB0 , 2, -1) \
TIMER_PIN_MAP( 6, PB1 , 2, -1) \
TIMER_PIN_MAP( 7, PA0 , 2, -1) \
TIMER_PIN_MAP( 8, PA15, 1, 0) \
TIMER_PIN_MAP( 9, PB9 , 2, -1)
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 8, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Remove PB9 from timer mapping to avoid gyro clock pin conflict.

PB9 is declared as GYRO_1_CLKIN_PIN (Line 80) and also exposed in TIMER_PIN_MAPPING (Line 92). That creates a dual-role conflict on a critical gyro signal pin.

Proposed fix
 `#define` TIMER_PIN_MAPPING \
     TIMER_PIN_MAP( 0, PB8 , 2, -1) \
     TIMER_PIN_MAP( 1, PC6 , 2,  1) \
     TIMER_PIN_MAP( 2, PC7 , 2,  1) \
     TIMER_PIN_MAP( 3, PC8 , 2,  1) \
     TIMER_PIN_MAP( 4, PC9 , 2,  0) \
     TIMER_PIN_MAP( 5, PB0 , 2, -1) \
     TIMER_PIN_MAP( 6, PB1 , 2, -1) \
     TIMER_PIN_MAP( 7, PA0 , 2, -1) \
-    TIMER_PIN_MAP( 8, PA15, 1,  0) \
-    TIMER_PIN_MAP( 9, PB9 , 2, -1)
+    TIMER_PIN_MAP( 8, PA15, 1,  0)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@configs/PULPYF405PRO/config.h` around lines 80 - 92, The GYRO_1_CLKIN_PIN
macro (GYRO_1_CLKIN_PIN = PB9) conflicts with the TIMER_PIN_MAPPING entry that
also lists PB9; remove PB9 from the timer mapping so the gyro clock pin isn’t
double-assigned. Edit the TIMER_PIN_MAPPING block to eliminate or replace the
TIMER_PIN_MAP(...) entry that references PB9 (the one currently mapping index 9
or the PB9 occurrence), leaving that timer slot with no pin (e.g., use -1) or
choose an alternate unused pin, ensuring only GYRO_1_CLKIN_PIN uses PB9.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The gyro clock pin requires a timer assignment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ot0tot, thank you for the clarification! You're absolutely right — when USE_GYRO_CLKIN is enabled, the firmware needs to drive a clock signal to the gyro via a timer output, so having PB9 in both GYRO_1_CLKIN_PIN and TIMER_PIN_MAPPING is intentional and required for correct operation. My concern was mistaken. I'll disregard this comment.

(◕‿◕✿)


✏️ Learnings added
Learnt from: ot0tot
Repo: betaflight/config PR: 1099
File: configs/PULPYF405PRO/config.h:80-92
Timestamp: 2026-05-08T01:40:09.346Z
Learning: In Betaflight board configurations (betaflight/config), when `USE_GYRO_CLKIN` is defined and a `GYRO_1_CLKIN_PIN` is assigned, that same pin **must** also appear in `TIMER_PIN_MAPPING`. The timer entry is required so the firmware can drive a clock signal to the gyro via a timer/PWM output. Having the CLKIN pin in both `GYRO_1_CLKIN_PIN` and `TIMER_PIN_MAPPING` is intentional and correct — it is not a dual-role conflict. Do not flag this as an issue during code review.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: haslinghuis
Repo: betaflight/config PR: 1051
File: configs/DEEPSPACEF722MINI/config.h:35-35
Timestamp: 2026-03-15T13:09:34.824Z
Learning: In Betaflight board configuration reviews, when a target is a rebranding of an existing hardware design (e.g., Skystar targets rebranded to Deepspace), you may retain deprecated components (e.g., BMI270 gyro) in the configuration to maintain hardware compatibility. The deprecation policy applies only to genuinely new target submissions, not to rebrands of already-produced hardware. This guidance should be checked whenever reviewing config.h files under betaflight/config and any rewritten or renamed targets that are rebrands.

Learnt from: osirisinferi
Repo: betaflight/config PR: 1072
File: configs/PILOTIXF405V3BF/config.h:89-91
Timestamp: 2026-04-23T14:45:46.186Z
Learning: In Betaflight board configuration reviews, ensure `config.h` only overrides settings when the value differs from the firmware/platform defaults. Do not define macros solely to repeat the default value (e.g., adding a `#define` that matches the default behavior). When the default behavior is acceptable, omitting the corresponding macro (for example, omitting `PINIO3_CONFIG` when the default behavior suffices) should not be flagged as a review issue. Reviewers should focus on meaningful overrides vs. redundant default-redefinitions.

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.

1 participant