2017-06-09 10:26 PM
I want using DMA to read/wrrite file with fatfs.
I try to modify
if(BSP_SD_ReadBlocks((uint32_t*)buff, (uint32_t) (sector), count, SD_DATATIMEOUT) == MSD_OK)
to
if(BSP_SD_ReadBlocks_DMA((uint32_t*)buff,
(uint32_t) (sector),
count, SD_DATATIMEOUT) == MSD_OK)
but when I used ' f_mount' I got a error code '
FR_NO_FILESYSTEM
' .What steps do I have to do when I wnat to use Fatfs with DMA?
#hal #dma #fatfs #sdio #sd #sd-card2017-06-10 03:19 AM
Hello,
I don't expect different behavior working with or without DMA. But... is it working without DMA?
Other: is there already a filesystem into SDCard?
If not:
- call f_mount(x,y,0), and ignore the result: FR_NO_FILESYSTEM -> note 0 param: it's only used to register the filesystem
- call f_mkfs()
- call
f_mount(x,y,1) -> here an OK is expected
2017-06-10 08:03 AM
Hi
HAL default is block mode for FatFs not DMA, even you set DMA in cubeMX.
In block mode, FatFs is working.
2017-12-11 08:22 AM
Hello. I ve got the same problem. Have you or someoe resolved this issue?
I am testing this functionality through MSC layer and with BSP_SD_ReadBlocks it works like a charm, but with BSP_SD_ReadBlocks_DMA my computer gives same 'no filesystem' error and suggests formatting medium (off course, with no success). DMA config is standard (forum is buggy for a moment, so can not paste code): pinc disable; minc enable; pdataalign word; mdataalign word; fifo enable; threshold full; mem and periph burst inc4. Interrupts enabled and SDMMC interrupt has higher priority than DMA.
2017-12-11 10:34 AM
Reformatting things isn't going to fix things that are flagging 'this isn't reading the right data properly'
DMA needs to be aligned to 32-bit word boundaries, the DMA TC interrupt should flag that the transfer is complete, you should ensure the SDIO/MMC FIFO is cleared out. I would expect deliver of data to lag the MMC IRQ.
Test the interface at a block level, where you are reading sectors of known content and comparing that to what's actually being delivered. The MBR and BPB should be good static examples you can read and checksum using the non-DMA variant, and check on the DMA variant.
Reports on the forum suggest the current cube release is a bit of a cluster fsck in this area.