chips: nrf52: spi: auto disable when unused #3466
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This pull request fixes the issues I was having with using nrfjprog to read the external flash on the nRF52840dk boards. The root issue is the main nrf52840 mcu was driving the MOSI pin to the flash chip low. Since the MOSI pin is the LSB pin when the flash is in Quad SPI mode, the LSB was always reading 0.
I'm guessing that when the SPIM peripheral is enabled it is actively driving the MOSI pin. This PR then only enables the SPIM peripheral when it is busy, aka when a read/write is actually happening.
The driver wasn't really using the
initialized
flag, and since I don't think we should have init() functions in our HILs (#1112) I removed that in favor of just setting the interrupt and enabling when the peripheral is used.Testing Strategy
I verified the nonvolatile storage test app works, as well as the
nrfjprog --memrd 0x12000000 --n 32
command.TODO or Help Wanted
n/a
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.