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

Async SPI broken for ESP32 #1857

Closed
bjoernQ opened this issue Jul 25, 2024 · 4 comments · Fixed by #1859
Closed

Async SPI broken for ESP32 #1857

bjoernQ opened this issue Jul 25, 2024 · 4 comments · Fixed by #1859
Labels
bug Something isn't working peripheral:spi SPI peripheral

Comments

@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 25, 2024

Since 4ef91c5 Async-SPI is broken for ESP32

Steps to reproduce:

  • connect GPIO 2 and 4
  • run cargo xtask run-example examples esp32 embassy_spi

Expected:
It works as before

Actual:
transfer never returns

@bjoernQ bjoernQ added bug Something isn't working async peripheral:spi SPI peripheral labels Jul 25, 2024
@bjoernQ
Copy link
Contributor Author

bjoernQ commented Jul 25, 2024

(Still works for ESP32-S2)

@Dominaezzz
Copy link
Collaborator

I reckon this is due to the interrupts being cleared after the DMA transfer starts, I'll have time to investigate this evening and I'll add a hil test for async spi

@plaes
Copy link
Contributor

plaes commented Jul 25, 2024

Another testcase which hangs on esp32 even before commit 4ef91c5:

    let mut write_buf = &[0xaa];
    //let mut payload = &[0xd1, 0xd2, 0xd3, 0xd4];
    // Works with 1..4 bytes
    // Hangs when payload is > 4 bytes??
    let mut payload = &[0xd1, 0xd2, 0xd3, 0xd5, 0xd5];

    defmt::info!("TX... ");
    let mut ops = [Operation::Write(write_buf), Operation::Write(payload)];
    let _ = spi_dev.transaction(&mut ops).await;
    defmt::info!("...done");

@Dominaezzz
Copy link
Collaborator

Ah, unfortunately the HIL tests don't run on the ESP32... oh well, we'll have to settle for the example then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working peripheral:spi SPI peripheral
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants