drivers: spi: set max chunk len for esp32

Max SPI chunk len was missing from the
implementation, causing SPI to hang up in some
conditions.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This commit is contained in:
Sylvio Alves 2021-08-12 09:35:38 -03:00 committed by Maureen Helm
commit 907b5d9e7f
2 changed files with 2 additions and 0 deletions

View file

@ -63,6 +63,7 @@ static int IRAM_ATTR spi_esp32_transfer(const struct device *dev)
spi_hal_dev_config_t *hal_dev = &data->dev_config;
spi_hal_trans_config_t *hal_trans = &data->trans_config;
size_t chunk_len = spi_context_max_continuous_chunk(&data->ctx);
chunk_len = MIN(chunk_len, SOC_SPI_MAXIMUM_BUFFER_SIZE);
/* clean up and prepare SPI hal */
memset((uint32_t *) hal->hw->data_buf, 0, sizeof(hal->hw->data_buf));