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
cpu/sam0_common: SPI: MOSI only operation & fix for adafruit-itsybitsy-m4 #15846
Conversation
Some slave devices (e.g. LED strips) don't have a back-channel and will only need MOSI and CLK.
1eec7e9
to
ec8794e
Compare
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.
On adafruit-itsybitsy-m4 I would not get a signal on MOSI unless I also would mux the pin on acquire
What sorcery is this ??
Overall looks good but I'm wondering if this doesn't hide some weird bug on the hardware side of your board.
Tested on SAML21 with SPI <-> SDCARD module on Please squash. |
fe2b681
to
31bf0c5
Compare
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.
ACK. I did not notice any regression on SAME54 and SAML21 so we should be safe.
Contribution description
adafruit-itsybitsy-m4
I would not get a signal on MOSI unless I also would mux the pin onacquire
. Without this, MOSI would just go low during the transmission with no output. I can't really explain it, intests/periph_spi
with MISO & MOSI connected I would seeinit 0 0 0
send test
-> no replyspi_gpio 0
send test
-> got replyI narrowed this down to the second
gpio_init_mux()
fixing SPI. Turns out a lategpio_init_mux()
onspi_aquire()
would also do.Also, why are MISO and CLK configured as output gpio? Shouldn't this not be necessary if we mux them to SERCOM mode anyway?
Testing procedure
tests/periph_spi
should still work.Pay attention to changes in power draw with SPI devices attached, I didn't see a difference on a quick test on
samr21-xpro
after putting the radio to sleep.Issues/PRs references