Skip to content

Commit 1e089e9

Browse files
committed
esp32/mphalport: Enable D-cache flushing on P4 for native code.
This is necessary to get native code running on the ESP32-P4. Signed-off-by: Damien George <damien@micropython.org>
1 parent f2ff3ad commit 1e089e9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ports/esp32/esp32_common.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ list(APPEND IDF_COMPONENTS
166166
driver
167167
esp_adc
168168
esp_app_format
169+
esp_mm
169170
esp_common
170171
esp_driver_touch_sens
171172
esp_eth

ports/esp32/mphalport.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "freertos/task.h"
3737

3838
#include "driver/spi_master.h"
39+
#include "esp_cache.h"
3940
#include "soc/gpio_reg.h"
4041

4142
#define MICROPY_PLATFORM_VERSION "IDF" IDF_VER
@@ -51,6 +52,11 @@
5152
#define MP_TASK_COREID (1)
5253
#endif
5354

55+
#if CONFIG_IDF_TARGET_ESP32P4
56+
#define MP_HAL_CLEAN_DCACHE(data, len) \
57+
esp_cache_msync((void *)(data), (len), ESP_CACHE_MSYNC_FLAG_UNALIGNED | ESP_CACHE_MSYNC_FLAG_DIR_C2M)
58+
#endif
59+
5460
extern TaskHandle_t mp_main_task_handle;
5561

5662
extern ringbuf_t stdin_ringbuf;

0 commit comments

Comments
 (0)