ESP32S2 can't read data in duplex mode
Posted: Thu Jun 02, 2022 12:19 pm
When use ESP32 conmmunicate with RC522 (NFC Controller), the SPI bus work ok, it can read and write RC522's register.
But when set the target to ESP32S3, the code complie fail. The error is:
SPI half duplex mode is not supported when both MOSI and MISO phases are enabled
Then find this in ESP32S3's programming guide:
Half-duplex transactions with both read and write phases are not supported. Please use full duplex mode.
Then comment this line :
.flags = SPI_DEVICE_HALFDUPLEX
It can complie success, can send data to SPI bus, but when reading data from the RC522, after send the register address which want read, the SPI bus hang up: the "CS"(chip select) line has been pull up, and no clock output on "clk" line.
What's wrong?
But when set the target to ESP32S3, the code complie fail. The error is:
SPI half duplex mode is not supported when both MOSI and MISO phases are enabled
Then find this in ESP32S3's programming guide:
Half-duplex transactions with both read and write phases are not supported. Please use full duplex mode.
Then comment this line :
.flags = SPI_DEVICE_HALFDUPLEX
It can complie success, can send data to SPI bus, but when reading data from the RC522, after send the register address which want read, the SPI bus hang up: the "CS"(chip select) line has been pull up, and no clock output on "clk" line.
What's wrong?