I have implemented a data logger storing data to a uSD card and I'm able to access the card locally using the FATFileSystem class to perform the logging, and also via USB by attaching it as a Mass Storage Device. It is not possible to do both at the same time as both use block level access and two FAT file systems cannot coexist in this manner.
I have got round this by disconnecting the USB device when I need to perform logging and then re-connecting to enable access to the logs.
All very well until I add a USB serial console connection. Unfortunately that connection gets dropped too when I disconnect the MSD.
So, what I'm after is the standard behaviour provided by the mbed "magic" chip whereby the serial connection is maintained whilst the MSD is disconnected and reconnected under the control of the mbed.
Having consulted the USB specs I can see how this would be done from the host end using SetConfiguration, but how the "magic" chip achieves this is a mystery.
Could somebody with knowledge of how this can be achieved please enlighten me.
Thanks,
Steve
I have implemented a data logger storing data to a uSD card and I'm able to access the card locally using the FATFileSystem class to perform the logging, and also via USB by attaching it as a Mass Storage Device. It is not possible to do both at the same time as both use block level access and two FAT file systems cannot coexist in this manner.
I have got round this by disconnecting the USB device when I need to perform logging and then re-connecting to enable access to the logs.
All very well until I add a USB serial console connection. Unfortunately that connection gets dropped too when I disconnect the MSD.
So, what I'm after is the standard behaviour provided by the mbed "magic" chip whereby the serial connection is maintained whilst the MSD is disconnected and reconnected under the control of the mbed.
Having consulted the USB specs I can see how this would be done from the host end using SetConfiguration, but how the "magic" chip achieves this is a mystery.
Could somebody with knowledge of how this can be achieved please enlighten me.
Thanks,
Steve