Closed gdefoest closed 6 years ago
Yes it looks correct, but miso needs to be output in dual/quad mode or slave mode so it should return an error in those cases.
It looks like in issue https://github.com/espressif/esp-idf/issues/598 that half duplex is not even functioning, and isn't likely to be fixed any time soon. Given that having half duplex supported is precondition to being able to do quad/dual IO on SPI, it seems rather unfortunate to further reduce the capabilities of the SPI interface. Would be preferable in my humble opinion to error out on spi_bus_add_device() where the spi_device_interface_config_t is specified (and the configuring for normal, dual, or quad IO is provided) rather than on spi_bus_initialize().
@mreutman this idea is good, we'll add this.
@gdefoest we fixed this, please check whether it works.
I tested it again on be81d2c16d7f4caeea9ceb29fece01510664caf3. No issue anymore. Thanks a lot for the fix!
Hi all,
I am working on a design that uses an external SPI device (SX1278) with the MISO pin assigned to GPIO35. This is an input only pin so it means the MISO (Master Input Slave Output) should work if the ESP32 is the SPI master but it is not the case.
I am getting the following error in the boot sequence:
E (449) gpio: io_num=35 can only be input.
This is my init sequence:
I see this in the driver (spi_common.c, line 271)
The issue comes from the fact we assign an input only pin in an INPUT_OUTPUT. So I think the piece of code above should be this instead:
What are your thoughts?