Hi @Gavin_Jia,
are you referring to SCB_DisableDCache()? I run into hardware exceptions very soon when I try to leave the data cache disabled: once the UART driver accesses the peripheral for the first time after reset a hardfault is generated. I am not entirely sure why that is... maybe the cache hides unaligned accesses?
But I have investigated further and found that my problem is actually well understood and parts of the SDK even have some provisions to deal with it: USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE and friends.
However, it seems that in my configuration/system it's not available... since usb_host_hci.c contains:
#if defined __CORTEX_M && (__CORTEX_M == 7U)
#if (defined(USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE) && (USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE > 0U))
#warning USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE is not supported.
#endif
#endif
which is triggered once I set USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE to 1. I could probably deal with that myself but I would like to know what the rationale for this warning is. Are there any fundamental problems with the approach behind USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE or was it simply not completely implemented for the host side (yet)?
I have tried to verify if the cacheability of the PSRAM is the actual culprit. To that end I have tried to change the MPU settings to indicate that the address range of the PSRAM should not be cacheable similar to what is usually set for the "NonCacheable" section. However this did not seem to make any difference (no matter what I chose for the shareable bit, which I thought might also be relevant). Can you confirm that setting the respective address range in the MPU to uncacheable should elevate the presumed problem?