spi_master: fix master HD mode cannot correctly receive data issue when using DMA.

Issue Description:
If master is in HD mode, if it sends data without receiving data, it will
still enable the RX DMA because of old version ESP32 silicon issue. And
because there is no correctly linked RX DMA descriptor, an
``inlink_dscr_error`` intr will be seen, which will influence the
following RX transactions.

Solution:
Trigge this workaround only in FD mode.

TODO:
Add a test to check if this workaround related issue does exit. If so,
reporting to Digital Team is also needed.
This commit is contained in:
Armando
2020-11-24 15:49:38 +08:00
parent 4d8af87298
commit 0c3653b1fd

View File

@ -151,13 +151,16 @@ void spi_hal_prepare_data(spi_hal_context_t *hal, const spi_hal_dev_config_t *de
spi_dma_ll_rx_start(hal->dma_in, hal->dma_config.dmadesc_rx);
}
} else {
}
#if CONFIG_IDF_TARGET_ESP32
else {
//DMA temporary workaround: let RX DMA work somehow to avoid the issue in ESP32 v0/v1 silicon
if (hal->dma_enabled) {
if (hal->dma_enabled && !dev->half_duplex) {
spi_ll_dma_rx_enable(hal->hw, 1);
spi_dma_ll_rx_start(hal->dma_in, 0);
}
}
#endif
if (trans->send_buffer) {
if (!hal->dma_enabled) {