You need to change the direction of the dma in the hsd1 struct as well, otherwise HAL_SD_WriteBlocks_DMA will configure the channel incorrectly.hsd1.hdmatx->Init.Direction = DMA_PERIPH_TO_MEMORY; or hsd1.hdmatx->Init.Direction = DMA_MEMORY_TO_PERIPH;...