Forum Discussion
Altera_Forum
Honored Contributor
8 years agoCris72,
My SDMMC baremetal code starts execution, but eventually fails when using both the preloader and the bootloader, however it works with just the preloader. I don't have access to the debugger since I am using the free SW version. Today I found that if I turn off the data cache, then my baremetal application works with the bootloader. Maybe you can try that as well. Here's what I do at the bootloader prompt: => dcache Data (writethrough) Cache is ON => dcache off => dcache Data (writethrough) Cache is OFF => fatload mmc 0:1 0x100040 sdmmc_demo.bin reading sdmmc_demo.bin 129408 bytes read in 18 ms (6.9 MiB/s) => go 0x100040 ... RESULT: All tests successful. There is also a "dcache flush" command for flushing the data cache, as well as a corresponding "icache" command for the Instruction Cache, but various combinations of flushing the two caches after loading the application and before starting code execution do not allow my application to run correctly. I am also doing IO operations to the SDMMC in my baremetal application (reading and writing data to it). Maybe there is some unwanted interaction between the data cache and the IO operations in my case, like the dcache is inadvertently caching the IO address space, which would cause a lot of weird issues.