-
Notifications
You must be signed in to change notification settings - Fork 205
Hellbender 0001 SDcard #865
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -50,10 +50,33 @@ | |||||||||||||
| #define SPI1_SDI_PIN PA24 | ||||||||||||||
| #define SPI1_SDO_PIN PA27 | ||||||||||||||
|
|
||||||||||||||
| #define SDCARD_CS_PIN PA25 | ||||||||||||||
| //#define FLASH_CS_PIN PA0 | ||||||||||||||
| //#define USE_MAX7456 | ||||||||||||||
|
|
||||||||||||||
| #define MAX7456_SPI_CS_PIN PA17 | ||||||||||||||
|
|
||||||||||||||
| #define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_SDCARD | ||||||||||||||
|
|
||||||||||||||
| #define USE_FLASH | ||||||||||||||
| //#define FLASH_CS_PIN PA0 // CS1 pin automatically used by the QSPI driver | ||||||||||||||
| #define USE_FLASH_CHIP | ||||||||||||||
| #define USE_FLASH_W25Q128FV | ||||||||||||||
|
|
||||||||||||||
| // Enable QUADSPI on RP2350 (pins are fixed via QMI; platform code handles them) | ||||||||||||||
| #define USE_QUADSPI | ||||||||||||||
| #define USE_QUADSPI_DEVICE_1 | ||||||||||||||
| #define FLASH_QUADSPI_INSTANCE ((QUADSPI_TypeDef *)0x1) | ||||||||||||||
|
|
||||||||||||||
|
Comment on lines
+64
to
+68
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainQUADSPI instance macro appears STM32-specific; likely invalid on RP2350 FLASH_QUADSPI_INSTANCE cast to QUADSPI_TypeDef is a HAL/STM32 idiom and does not apply to RP2350. RP2350 QMI is handled by the platform code with PICO_QSPI_* defines. Retain USE_QUADSPI, but drop the instance and device-id defines unless your Betaflight RP2350 branch explicitly uses them. Apply this diff to remove the non-RP constructs: // Enable QUADSPI on RP2350 (pins are fixed via QMI; platform code handles them)
#define USE_QUADSPI
-#define USE_QUADSPI_DEVICE_1
-#define FLASH_QUADSPI_INSTANCE ((QUADSPI_TypeDef *)0x1)Sanity-check whether any other configs use these macros (they likely won’t on RP targets): 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Search for FLASH_QUADSPI_INSTANCE usage in configs:"
rg -n 'FLASH_QUADSPI_INSTANCE' -C2 || true
echo
echo "Search for USE_QUADSPI_DEVICE_* usage in configs:"
rg -nP 'USE_QUADSPI_DEVICE_\d+' -C2 || trueLength of output: 3000 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Searching for USE_QUADSPI_DEVICE_1 usage outside configs:"
rg -n 'USE_QUADSPI_DEVICE_1' --glob '!configs/**' -C2 || true
echo
echo "Searching for FLASH_QUADSPI_INSTANCE usage outside configs:"
rg -n 'FLASH_QUADSPI_INSTANCE' --glob '!configs/**' -C2 || true
echo
echo "Verifying conditional compilation around USE_QUADSPI in source files:"
rg -n '#\s*if.*USE_QUADSPI' --glob '!configs/**' -C2 || trueLength of output: 624 Remove STM32-specific QUADSPI macros in RP2350 config RP2350’s QSPI is driven by QMI (PICO_QSPI_*) and doesn’t reference • File: configs/HELLBENDER_0001/config.h Lines 66–67 // Enable QUADSPI on RP2350 (pins are fixed via QMI; platform code handles them)
#define USE_QUADSPI
-#define USE_QUADSPI_DEVICE_1
-#define FLASH_QUADSPI_INSTANCE ((QUADSPI_TypeDef *)0x1)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| // RP2350 QMI CS1 wiring and external flash size (Winbond W25Q64JVXGIM 8MiB) | ||||||||||||||
| #define PICO_QSPI_CS1_GPIO 0 | ||||||||||||||
| #define PICO_QSPI_CS1_SIZE_BYTES (8 * 1024 * 1024) | ||||||||||||||
|
|
||||||||||||||
| #ifndef USE_MAX7456 | ||||||||||||||
| // MAX7456 and SD card cannot be used at the same time | ||||||||||||||
| #define SDCARD_SPI_CS_PIN PA25 | ||||||||||||||
| #define USE_SDCARD | ||||||||||||||
| #define USE_SDCARD_SPI | ||||||||||||||
| #endif | ||||||||||||||
|
|
||||||||||||||
| #define GYRO_1_CS_PIN PA1 | ||||||||||||||
| #define GYRO_1_EXTI_PIN PA22 | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Make DEFAULT_BLACKBOX_DEVICE conditional on OSD/SD availability
As written, if a user enables USE_MAX7456, SD card support is compiled out, yet the default blackbox device would still be SDCARD. That’s likely to produce a build-time config error or an unusable default. Define the default based on whether OSD disables SD (fallback to FLASH when SD is disabled).
Apply this diff to make the default adaptive:
Run this repo-wide check to confirm which blackbox device constants are used across configs (and adjust the FLASH constant if your tree uses a different identifier):
🏁 Script executed:
Length of output: 178056
🏁 Script executed:
Length of output: 2268
Wrap
DEFAULT_BLACKBOX_DEVICEto respectUSE_MAX7456The board currently always defaults to
BLACKBOX_DEVICE_SDCARD, but ifUSE_MAX7456is enabled SD support is disabled, leading to a broken or unusable build. Change the default to fall back to flash when Max7456 OSD is in use:configs/HELLBENDER_0001/config.h (around line 57)
– Only
BLACKBOX_DEVICE_SDCARDandBLACKBOX_DEVICE_FLASHexist in the tree, so this will cover both cases.– Place the new conditional block immediately after the
MAX7456_SPI_CS_PINdefinition.– Ensures a valid default regardless of OSD/SD compile-time flags.
🤖 Prompt for AI Agents