2015-01-16 04:48 AM
Hello,
I have implemented SD Card with FatFS using firstly STCubeMX driver in a polling mode, secondly by adaptation of the \STM324xG_EVAL\Applications\FatFs\FatFs_uSD example in DMA/Intr mode. I am writing a line of about 100 characters every 40 ms in the card using f_puts for a long time (using 1-bit access only - another issue sent to the forum). Unfortunatelly, running an interrupt lasting 1-2 us every 35 us (measured by a scope and yes, I need it seriously) causes that in time of order 1-100 s the function f_puts fails with return code -1. I tried to increase the stack but it is not the case. Thank you for any advice. Ivan2015-01-16 10:09 AM
Of course, the ADC interrupt has higher priority (2) in the linear set of them (0-15) than SDIO (5 and 6).
2015-01-19 12:29 PM
I have rearranged the ADC interrupt routine at the expense of main loop so it lasts shorter time: 0.39-1.10 us every 23.5 us, and the file write works O.K. now.
However, it is problematic if a relatively short interrupt routine spoils SD Card handling.2015-01-25 02:02 PM
Although the writing to a file did run twice for several hours, now it fails again in several minutes.
2015-01-27 01:50 AM
The problem was that although a code for DMA and interrupt access to SD card was inserted, the polling versions of SDIO read/write functions were called instead of the DMA versions.
I understand that an interrupt just during trasmition/reception of SD card command/data may corrupt the file write. I do not know whether I overlooked a setting in the CubeMX or if CubeMX cannot change the function calls.