Skip to content

Commit

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

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

See merge request espressif/esp-idf!34813
  • Loading branch information
suda-morris committed Nov 20, 2024
2 parents c46fe1f + b282c41 commit fb52ad1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 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 @@ -1415,7 +1415,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 @@ -1856,7 +1856,6 @@ TEST_CASE("test_spi_master_sleep_retention", "[spi]")
#endif
}

#if 0 /* Temp disable, TODO: IDFCI-2455*/
#if CONFIG_PM_ENABLE
TEST_CASE("test_spi_master_auto_sleep_retention", "[spi]")
{
Expand Down Expand Up @@ -1922,4 +1921,3 @@ TEST_CASE("test_spi_master_auto_sleep_retention", "[spi]")
TEST_ESP_OK(esp_pm_configure(&pm_config));
}
#endif //CONFIG_PM_ENABLE
#endif // 0
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,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 fb52ad1

Please sign in to comment.