SDMMC_ERROR_TX_UNDERRUN using SDMMC with FreeRtos and FatFs
I have been working on a STM32L496VGT6 using a 2GB sd card. I have the interface set to 4bit bus, no flow control and a clock divider of 4. I have a demo application that uses SDMMC, FreeRtos and FatFs and works perfectly. When i move the exact firmware to my real application with several tasks and other interrupt driven communication, I can still communicate in a READ only fashion, but as I try to implement simple writes, they always fail with the following error SDMMC_ERROR_TX_UNDERRUN.
I have read several threads that suggest solutions, and I believe it is because the SDCard wants data prior to the DMA being ready, but I have not found any solution that works. I have increased the clock divide, increased the DMA priority from high to very high, but nothing seems to work. I would appreciate any suggestions.
I am using STMCubeIde STM32Cube FW_L4 V1.18.0, FatFS R0.12c and FreeRtos 10.3.1 with CMSIS V2.00
