2023-09-01 07:33 AM
Hi,
I am using STM32H747. I have successfully write&read micro sd card over SDMMC2 peripheral while debugging. But after debugging, when I power cycle or reset the board, I am not able to use sd card. I see FatFS open file failing. The board is arduino portenta H7, which has its own custom bootloader, so I flash my code on address 0x08040000 and it boots ok. I use CubeIDE. The only thing which does not work after reset is SDMMC strangely. Anyone has encountered this issue?
Best regards
Solved! Go to Solution.
2023-09-20 12:12 AM
I have finally found the solution. This board has custom bootloader and it seems it enables cache memory. After disabling it at the start of main function, BSP read and write functions with DMA works successfully. Or second alternative: leave cache enabled. After each BSP_SD_ReadBlocks_DMA function call SCB_InvalidateDCache_by_Addr. Similarly, before each BSP_SD_WriteBlocks_DMA function, call SCB_CleanDCache_by_Addr.
2023-09-20 12:12 AM
I have finally found the solution. This board has custom bootloader and it seems it enables cache memory. After disabling it at the start of main function, BSP read and write functions with DMA works successfully. Or second alternative: leave cache enabled. After each BSP_SD_ReadBlocks_DMA function call SCB_InvalidateDCache_by_Addr. Similarly, before each BSP_SD_WriteBlocks_DMA function, call SCB_CleanDCache_by_Addr.