Hello there! I'm looking for a similar solution to deinit the mass storage device and then reinit it after some data has been updated on the k60 device using mqx 3.7 (without disconnecting the usb physically in between).
I found that freescale medical usb stack (without mqx) has deinit functions at least for msc (also cdc) and a better documentation (USBAPIRM).
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MEDICALUSB
I have tried to port files and functions from an example project included without any success. They share similar function calls with mqx usb stack but the code is so different that it is beyond my skills. The documentation says that medical usb stack is compatible with mqx but there is no advice on how to make them talk to each others.
For the deinitialization procedure the documentation states the following:
2.4.1.2 De-initialization flow
To de-initialize the driver layer, the class layer must:
1. Call 3.1.7“_usb_device_deinit()” to de-initialize low level driver and the controller.
2. Call 3.1.17“_usb_device_unregister_service()” to unregister service callback functions for the
following:
— USB_SERVICE_BUS_RESET
— USB_SERVICE_SUSPEND
— USB_SERVICE_SOF
— USB_SERVICE_RESUME
— USB_SERVICE_SLEEP
— USB_SERVICE_ERROR
— USB_SERVICE_STALL
3. Call 3.1.17“_usb_device_unregister_service()” to unregister callback functions for control and
non-control endpoints.
Maybe it would be possible to spy on those functions in medical usb stack and implement only necessary parts in current mqx 3.7 usb device source?
edit: calling USB_Class_MSC_DeInit() will deinit not only the mass storage class but also the controller hardware so this would be what we want to port to mqx libs.