hideakitai / ESP32DMASPI

SPI library for ESP32 which use DMA buffer to send/receive transactions
MIT License
170 stars 36 forks source link

TX data Slave->Master #12

Closed Fasol0 closed 2 years ago

Fasol0 commented 2 years ago

Hi,

I am reopening the issue in ESP32Slave here, in order to find a suitable workaround for slave mode:

Thank you for your help

hideakitai commented 2 years ago

@Fasol0

Can you confirm you do have a configuration which works reliably for Master->Slave AND Slave->Master communication?

In the same ESP32 device (one device has two SPIs), the master_slave_polling.ino example works correctly in my environment.

If the Master is another device which is not an ESP32, should it work if I find an equivalent function to setDutyCyclePos() ?

I don't know because I haven't tested. It may depend on the master device. Please try not using setDutyCyclePos() first (with default config).

This issue seems to be related to this problem. https://github.com/hideakitai/ESP32DMASPI#restrictions-and-known-issues-for-spi-with-dma-buffer-help-wanted

I don't have enough time to analyze these issues, but it depends on the esp-idf version (the internal process of esp32). Arduino IDE + ESP32 v1.0.6 + ESP32DMASPI v0.1.2 works fine, but Arduino IDE + ESP32 v2.0.0 + ESP32DMASPI v0.12 doesn't work correctly. Because of the timing issues.

Also, refer to the documents about timing considerations.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/spi_master.html#transfer-speed-considerations https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/spi_slave.html#speed-and-timing-considerations

hideakitai commented 2 years ago

I am closing this issue because no further information has been provided. Please feel free to reopen this.