Hi @tbonkers
Thanks for your question!
"USB fails to enumerate after you managed to create a non-cacheable region in SDRAM....".
I tried to understand what's the key point for this issue. Please correct me if something wrong.
It seems that the USB host-related code is correctly placed in the non-cacheable memory region in SDRAM. The relevant sections in the `readelf` and linker map outputs look fine. However, USB enumeration issues can be tricky and might arise from several other aspects.
Here are some further steps you can take to troubleshoot the problem:
1. Verify Non-cacheable Memory Configuration:
Ensure that the memory marked as non-cacheable is correctly set up in both your linker script and your startup code. Verify that your linker script correctly defines the non-cacheable region. This appears to be correct in your setup, but double-check it aligns with your memory map.
MEMORY
{
/* Other memory regions */
NON_CACHEABLE (rw) : ORIGIN = 0x80000000, LENGTH = 16K
}
SECTIONS
{
.nocache (NOLOAD) :
{
*(.nocache)
} > NON_CACHEABLE
}
2. Check Cache Configuration:
Double-check that the non-cacheable region is indeed being treated as such by the CPU. Ensure the memory attributes for this region are configured properly to avoid caching issues.
3. Ensure Proper USB Host Initialization:
Verify that all steps for USB host initialization are correctly followed and that no steps are missing. This includes setting up clocks, initializing hardware, and enabling interrupts.
4. Debugging Output and Logs:
Enable and review any debugging logs from the USB stack. These logs can provide insights into where the enumeration process is failing.
Debugging Output:
Enable debug logs to trace the enumeration process
By following these steps, you should be able to narrow down the cause of the USB enumeration issue and correct it. If the problem persists, consider checking for errata related to the microcontroller or the USB controller in use.
Have a nice day!
Sam