From 5bdbba0dbecea0e7da077a3c6fef462b51f8a1b6 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Tue, 6 May 2025 06:55:53 +0800 Subject: [PATCH] platform/nuttx: Fix dcache operation in os_dcache_flush (#4225) Replace up_invalidate_dcache_all() with up_flush_dcache_all() in os_dcache_flush() to properly flush the data cache instead of just invalidating it. This ensures that any modified data in the cache is written back to memory before execution. Signed-off-by: Huang Qi --- core/shared/platform/nuttx/nuttx_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/shared/platform/nuttx/nuttx_platform.c b/core/shared/platform/nuttx/nuttx_platform.c index 7a28005d4..da5bf8673 100644 --- a/core/shared/platform/nuttx/nuttx_platform.c +++ b/core/shared/platform/nuttx/nuttx_platform.c @@ -118,7 +118,7 @@ os_dcache_flush() up_textheap_data_sync(); #endif #ifndef CONFIG_BUILD_KERNEL - up_invalidate_dcache_all(); + up_flush_dcache_all(); #endif }