Skip to content

Commit 1feaed0

Browse files
udoudousakumisu
authored andcommitted
Fix esp32-p4 cache operation adaptation issue
1 parent 88cbed9 commit 1feaed0

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.15)
22

3-
if(CONFIG_CHERRYUSB)
3+
if(CONFIG_CHERRYUSB OR ESP_PLATFORM)
44

55
if(BL_SDK_BASE)
66
message(STATUS "enable cherryusb in bouffalo_sdk")
@@ -71,7 +71,7 @@ elseif(ESP_PLATFORM)
7171
${cherryusb_incs}
7272
${freertos_include}
7373
PRIV_REQUIRES
74-
usb
74+
usb esp_mm
7575
LDFRAGMENTS
7676
${ldfragments}
7777
)

osal/idf/usb_config.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "sdkconfig.h"
1010
#include "esp_rom_sys.h"
11+
#include "esp_attr.h"
1112

1213
/* ================ USB common Configuration ================ */
1314

@@ -28,7 +29,7 @@
2829
// #define CONFIG_USB_DCACHE_ENABLE
2930

3031
/* attribute data into no cache ram */
31-
#define USB_NOCACHE_RAM_SECTION
32+
#define USB_NOCACHE_RAM_SECTION DRAM_DMA_ALIGNED_ATTR
3233

3334
/* use usb_memcpy default for high performance but cost more flash memory.
3435
* And, arm libc has a bug that memcpy() may cause data misalignment when the size is not a multiple of 4.
@@ -340,9 +341,6 @@
340341
#define CONFIG_USB_DCACHE_ENABLE
341342

342343
#undef CONFIG_USB_ALIGN_SIZE
343-
#define CONFIG_USB_ALIGN_SIZE 32
344+
#define CONFIG_USB_ALIGN_SIZE CONFIG_CACHE_L1_CACHE_LINE_SIZE
344345

345-
void usb_dcache_clean(uintptr_t addr, uint32_t size);
346-
void usb_dcache_invalidate(uintptr_t addr, uint32_t size);
347-
void usb_dcache_flush(uintptr_t addr, uint32_t size);
348346
#endif

0 commit comments

Comments
 (0)