cancel
Showing results for 
Search instead for 
Did you mean: 

nonblocking sdio driver possible?

shendawaterloo
Associate II
Posted on July 23, 2013 at 08:01

Hi all,

I'd like to implement a nonblocking version of the sdio driver. I'm using the stm2310e eval kit. The sdio driver provided uses a busy wait. Is it possible to modify this into a queue based nonblocking version? Only read, write, multi read, multi write and erase needs to be handled.

A few things I can't get my head around:

-how to handle enque commands for multi read/write

-how to handle enque data for multi read/write (can I split the blocks up for multi? how would DMA work in this case?)

Thank you so much,

#dma #sdio #driver
3 REPLIES 3
Posted on July 23, 2013 at 13:21

Single IO request queue, and then a state machine to handle each request to completion.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
shendawaterloo
Associate II
Posted on July 24, 2013 at 06:46

Thank you Clive. Do you think you can elaborate further? Did you mean I should create a task to handle the queue?

Posted on July 24, 2013 at 14:10

You need to serialize operations to the SDIO card, there are several ways to do that, but having it in it's own thread/task would be one of the more straight forward.

I'm not sure how read single/multiple are much different, a single can be considered as a multiple of 1, and a multiple could be decomposed into smaller runs. Still you'd need have buffers available for the entire transaction, and wait for all the data to arrive before the application could proceed and use it. DMA would only be a problem if you didn't own the memory being used, ie on the stack for a subroutine that will exit before completion.

With non-blocking are you looking to queue up a bunch of requests, and then do call-backs to processing routines?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..