Skip to main content
Visitor II
October 22, 2021
Question

Using USB HAL for MSC with multiple access to storage

  • October 22, 2021
  • 1 reply
  • 1229 views

I am working on a design using STM32L433 as a composite USB (CDC and MSC) device using the STM32L4xx HAL and FreeRTOS. I have the device enumerating and I now need to add access to the storage medium (eMMC). The challenge I am facing is that the device needs read/write access to the eMMC as well as the USB MSC HAL.

I would like to use a storage access task to manage the eMMC access. To do this I would need to transfer some of the USB HAL code to a FreeRTOS task. Has anyone done anything similar and be willing share experiences.

It seems that moving the SCSI_ProcessRead and SCSI_ProcessWrite to the task may be one way of doing this.

Comments?

Sid

    This topic has been closed for replies.

    1 reply

    Graduate II
    October 22, 2021

    The general challenge when having two systems interact is coherency and the Windows system tendency to cache and do lazy writes.

    Throwing NOT READY, or MEDIA CHANGED type sense codes is one way to manage this when you know you have USB connectivity

    Sid PriceAuthor
    Visitor II
    October 23, 2021

    Valuable input, thanks.

    Sid PriceAuthor
    Visitor II
    October 27, 2021

    I removed the best answer flag because while the information was useful, it did not answer the original question. That is still unanswered.