This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Looks like it runs at about 100KB/s... (that is writing to the disk via the file system, I couldn't get dd straight to the disk to work on my macbook)
So probably something isn't quite optimised right! I'll try benchmarking the R/W performance of the microSD card over SPI within chibios first to see what the max that can manage is.
The driver could do with a mechanism for making sure that the usb transaction doesn't complete before the thread goes to sleep, so that it will always get woken. I suppose the usb callback should set a variable somewhere to indicate that an even has occurred, which is checked before going to sleep.
I have mostly implemented the cached read/write, but I'm having problems with waking the thread when a USB read or write callback is called.
My strategy is to use a binary semaphore, initialised as taken. The worker thread issues the USB transfer and the. Calls chBSemWait(). The callback wakes the thread with chBSemSignal. This all works fine until the USB transfer completes before chBSemWait() is called. Am I doing something wrong here? It seems like the bsem should be untaken as the callback signalled it so Id expect chBSemWait() to return immediately but it hangs!
BTW the code with caching and semaphores is not yet published as I am travelling on a train whilst working on this..