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
Fix stm32h730 hardcoded target IO #13604
Fix stm32h730 hardcoded target IO #13604
Conversation
This should be able to be overridden by targets. e.g. ones that use octospi IO lines 4-7 instead of 0-3.
Do you want to test this code? You can flash it directly from Betaflight Configurator:
WARNING: It may be unstable. Use only for testing! |
@hydra : Strange thing is that IO_TAG(QUADSPI1_BK1_IO0_PIN) even compiles - the code was designed to generate error if such pin is used (pin not in port mask). |
The target I was testing on, the SPRacingH7EF (betaflight/config#408) while having and using OctoSPI, does not enable the OctoSPI peripheral in BF itself. |
here's some proof it works:
Binaries for testing, for those that have the H7EF: |
@hydra: It was quick grep, so the code is (probably) unused. |
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.
This should be revisited if more targets need exclusive pins.
Maybe something like `
#define TARGET_IO_PORTB (0xffff & ~OCTOSPI_RESERVED_PORTB)
That make make sense at some point in the future. For now this PR's simple change will suffice and will let target authors have the same flexibility they previously had while providing sensible defaults in the base target. |
This should be able to be overridden by targets. e.g. ones that use OctoSPI IO data lines 4-7 instead of 0-3.
Some history: Initial H730 targets always had their
TARGET_IO_*
defines in their target.h files, but these were moved to theSTM32H730
target at some point, but this causes compiler errors when the target redefines them.