Skip to content

Commit

Permalink
Merge branch 'fix/p4_spi_no_dma_polling_cache_fail_v5.3' into 'releas…
Browse files Browse the repository at this point in the history
…e/v5.3'

fix(driver_spi): fixed p4 no dma polling trans cache sync fail (v5.3)

See merge request espressif/esp-idf!34814
  • Loading branch information
Jiang Jiang Jian committed Nov 15, 2024
2 parents 0c90cf3 + 2f50201 commit 8cce21d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/esp_driver_spi/src/gpspi/spi_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ esp_err_t SPI_MASTER_ISR_ATTR spi_device_polling_end(spi_device_handle_t handle,

#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE //invalidate here to let user access rx data in post_cb if possible
const spi_bus_attr_t *bus_attr = host->bus_attr;
if (host->cur_trans_buf.buffer_to_rcv) {
if (bus_attr->dma_enabled && host->cur_trans_buf.buffer_to_rcv) {
uint16_t alignment = bus_attr->internal_mem_align_size;
uint32_t buffer_byte_len = (host->cur_trans_buf.trans->rxlength + 7) / 8;
buffer_byte_len = (buffer_byte_len + alignment - 1) & (~(alignment - 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ static void test_master_fd_no_dma(void)
.length = test_trans_len * 8,
};
unity_wait_for_signal("Slave ready");
TEST_ESP_OK(spi_device_transmit(dev0, &trans_cfg));
TEST_ESP_OK(spi_device_polling_transmit(dev0, &trans_cfg));

ESP_LOG_BUFFER_HEX("master tx", master_send, test_trans_len);
ESP_LOG_BUFFER_HEX_LEVEL("master rx", master_receive, test_trans_len, ESP_LOG_DEBUG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ TEST_CASE("Test slave rx no_dma overwrite when length below/over config", "[spi]
.length = 8 * 7,
.tx_buffer = master_tx,
};
spi_device_transmit(spidev0, &master_tans);
spi_device_polling_transmit(spidev0, &master_tans);

TEST_ESP_OK(spi_slave_get_trans_result(TEST_SLAVE_HOST, &slave_out, portMAX_DELAY));

Expand All @@ -181,7 +181,7 @@ TEST_CASE("Test slave rx no_dma overwrite when length below/over config", "[spi]
TEST_ESP_OK(spi_slave_queue_trans(TEST_SLAVE_HOST, &slave_tans, portMAX_DELAY));

master_tans.length = 8 * 11,
spi_device_transmit(spidev0, &master_tans);
spi_device_polling_transmit(spidev0, &master_tans);

TEST_ESP_OK(spi_slave_get_trans_result(TEST_SLAVE_HOST, &slave_out, portMAX_DELAY));

Expand Down

0 comments on commit 8cce21d

Please sign in to comment.