AnsweredAssumed Answered

Using FatFs with EDMA SPI1 in K64F based board for datalogging into SD card

Question asked by Denis Martins Dantas on Feb 19, 2016
Latest reply on Mar 1, 2016 by Denis Martins Dantas

Hey there,

I'm currently working on a K64F based board running freeRTOS tasks. I'm trying to use the SD card for data logging through SPI1, but my data logging service is apparently interrupting the UART interruptions too often.


I'm using KSDK 1.3's fatfs files provided in "..\KSDK_1.3.0\middleware\filesystem\fatfs" with fsl_sdspi_disk and fsl_sdcard_spi (..\KSDK_1.3.0\platform\composite\src\sdcard). Inside the fsl_sdspi_disk I use the EDMA for the SPI1 communication. Because the fatfs gives me a limitation of a minimum transfer block size of 512KB, I had to change the SPI1_IRQHandler in fsl_dspi_edma_irq.c to use DSPI_DRV_IRQHandler(SPI1_IDX) instead of DSPI_DRV_EdmaIRQHandler(SPI1_IDX) - therefore I'm not using the EDMA for receiving data, right?


Because I'm not using EDMA to receive data, due to block size limitation of the fat, I believe that the SPI is interrupting the UART too often - it initializes the sdcard with 700KHz and then it goes to +1MHz. I'd like to know if there's any work around to fully use the EDMA to communicate with an SD card. My application is using three UARTs with baud rates of 4800, 9600 and 19400 bps - those UARTs have polling reception because they receive variable string length.


Best Regards,