Skip to content
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

stm32 spi rxonly slave #1250

Closed
wants to merge 2 commits into from
Closed

Conversation

pattop
Copy link
Contributor

@pattop pattop commented Mar 1, 2023

  • stm32/spi: fix occasional data corruption
  • stm32/spi: add receive only slave

@Dirbaio
Copy link
Member

Dirbaio commented Mar 1, 2023

SPI slave should be a separate driver, not a mode in the existing driver.
See #885 (comment) and rust-embedded/embedded-hal#396

(they can share code internally, sure, but the user-facing API has to be different, so we shouldn't squash both APIs into the same struct)

@@ -476,6 +475,7 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> {
let tx_f = crate::dma::write_repeated(&mut self.txdma, tx_request, &clock_byte, clock_byte_count, tx_dst);

unsafe {
set_rxdmaen(T::REGS, true);
Copy link
Member

Choose a reason for hiding this comment

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

there's some versions where the RM explicitly says you must set RXDMAEN=true, start DMAs, set TXDMAEN=true in that exact order. It was F4 iirc. And indeed if you don't do that it doesn't work.

@pattop pattop closed this Mar 1, 2023
@pattop pattop deleted the stm32_spi_rxonly_slave branch March 1, 2023 01:14
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.

2 participants