> What's the purpose of "CONFIG_ESP32_SPI_SWCS" since the SPI CS pin can > always be controlled by hardware?
Not always. It depends on the pins used. You can check arch/xtensa/src/esp32/hardware/esp32_pinmap.h, if you use the set of pins defined there then you don't need ESP32_SPI_SWCS. There is also another option, ESP32_SPI_UDCS, where you can define your own spi_select function in your board logic. On Thu, Feb 4, 2021 at 9:05 AM Jardel Lucca <jardel...@yahoo.com.br.invalid> wrote: > > Hello, I noticed an example configuration for SD card reader + ESP32 support > has been recently added to NuttX (esp32-devkitc:mmcsdspi). This configuration > defines the option "CONFIG_ESP32_SPI_SWCS", which I suppose should control > the CS (chip select) pin by code/software. Whenever a command is to be sent > to the SD card module, the esp32_spi_select() function (defined in > ./arch/xtensa/src/esp32/esp32_spi.c) is called, but the CS line does not > toggle, being always high. Disabling CONFIG_ESP32_SPI_SWCS, i.e., making the > CS line to be controlled by hardware, works just fine. Could it be that > "CONFIG_ESP32_SPI_SWCS" has a bug? What's the purpose of > "CONFIG_ESP32_SPI_SWCS" since the SPI CS pin can always be controlled by > hardware? > I tested this with the following code: > URL: https://github.com/apache/incubator-nuttx/ > Branch: master > Last commit: 07792a696bf3bcecc7d34ae061ff92ab17b4f0d2 > Thank you. -- > Regards.Jardel Lucca > >