2017-08-03 03:36 AM
Posted on August 03, 2017 at 12:36
I have a problem with DMA mode reading multiple blocks.
To simplify a problem i took an example from the
STM32Cube_FW_
L4_V1.8.0\Projects\STM32L476G_
EVAL\Applications\FatFs\FatFs_
uSD\ archive.
BSP_SD_ReadBlocks_DMA
is used.
Read blocks not worked good, it started to work after i separated rx and tx and added Init and Deinitto DMA each time that i use that channel.
The problem is witha write now. I can write only blocks that are less then 1k. from 1k to 4096 sometimes it can write and sometimes
f_writereturn 0x
It always fails to write blocks bigger then 4096, bsp_write_blocks always fails with MSD_ERROR .
The problem only in DMA mode, polling mode works great.
Note: this post was migrated and contained many threaded conversations, some content may be missing.
2018-03-27 01:32 AM
Could you please elaborate Clive ?
2018-03-27 08:07 AM
Think of this as an interview question, you need to learn to sight-read code
#include <stdio.h>
#include <windows.h>int main(int argc, char **argv)
{ int i = 0; volatile int txDone = 1; while(txDone == 0 ){ i++; } printf('Loop iterates %d time(s)\n', i); return(1); }2018-03-29 02:22 AM
After invoked
__SDMMC_DMA_DISABLE(SDMMC1);
I test is SD busy
while(!LL_GPIO_IsInputPinSet(GPIOC, LL_GPIO_PIN_8)){};
where port C pin 8 - SD data 0 pin