2016-04-07 05:15 AM
I've a following problem. I'm using STM32F427VG connected to microSD card via SDIO interface. I'm using ST driver, configured for 4-bit data access and DMA tranfer. I need to reach continuous write speed above 3000kb/sec, but the write sometimes hangs and the transfer is interrupted for more than 200msec (sometimes even 500msec), which is a problem. I've a constant data stream and I can not allocate too large buffer in a memory, because I've only internal SRAM in STM32 available (I can only accept not more than 30-50msec delay). I'm using multiple block tranfer, each block in size of 16Kb. I've tried different sd cards, but still the result is the same. If I put the card to the computer, then the write speed is much higner than 3000kb/sec and I don't expect it's a timeout generated by the card, this is too long timeout I guess.
#stm32f4-sdio2018-03-27 11:56 PM
Hi team,
I used 1bit bus mode for DMA write for writing 1000 blocks in loop one at a time.
Time taken to complete this operation was 930 msec.
I changed bus mode to 4-bit mode for same operation and time observed was 900 msec.
I was expecting less time but its almost same. Do I need to do some other setting to make 4 bit bus mode work.
Steps I followed:-
selected 4 bit mode for sdio in cubemx and generated the code.
2018-03-28 06:18 AM
Not going to confirm timing, but single sector reads have significant overhead, basically worst case scenario. Read 1000 sectors not 1 sector 1000 times.
After the card connects at 400 KHz at 1-bit it usually negotiates up to 24-25 MHz at 4-bits
Not wading into issues with CubeMX code generation.
2018-03-28 08:41 AM
Read 1000 sectors not 1 sector 1000 times.
>> I am incrementing read_addr by 512 bytes each time.
and loop goes on 1000 times so it means i am reading 1000 blocks.
Please let me know if I use 4bit bus mode then it should work like how it works for 1-bit mode but with more throughput.
2018-03-28 09:16 AM
Yes, I understand that, I'm saying using 1000 cars to delivery 1000 packages is less efficient that using 1 truck to deliver 1000 packages in a single trip. The media has several million addressable blocks.
The 4-bit vs 1-bit will give 4x performance in data transfer phase, however command/response phases dominate in single block access case. This is why you have a 'count' field.