Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USBD MSC does not support more than 2 luns #4

Closed
xu-yingjing opened this issue Jun 28, 2024 · 3 comments
Closed

USBD MSC does not support more than 2 luns #4

xu-yingjing opened this issue Jun 28, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request internal bug tracker Issue confirmed and logged into the internal bug tracking system mw MW-related issue or pull-request spotted before customer Spotted internally before being pointed out by the user but not yet fixed or published usb Universal Serial Bus wontfix This will not be worked on

Comments

@xu-yingjing
Copy link

Hello,

In the function MSC_BOT_CBW_Decode() of the file usbd_msc_bot.c, there is the following judgment:

  if ((USBD_LL_GetRxDataSize(pdev, MSCOutEpAdd) != USBD_BOT_CBW_LENGTH) ||
      (hmsc->cbw.dSignature != USBD_BOT_CBW_SIGNATURE) ||
      (hmsc->cbw.bLUN > 1U) || (hmsc->cbw.bCBLength < 1U) ||
      (hmsc->cbw.bCBLength > 16U))
  {
    SCSI_SenseCode(pdev, hmsc->cbw.bLUN, ILLEGAL_REQUEST, INVALID_CDB);

    hmsc->bot_status = USBD_BOT_STATUS_ERROR;
    MSC_BOT_Abort(pdev);
  }
  else
  {
    /* ... */
  }

As shown in the above code, when (hmsc->cbw.bLUN > 1U) is established, it will be judged as an illegal request. Therefore, the legal value of hmsc->cbw.bLUN can only be 0 or 1. For this reason, USBD MSC can only support a maximum of 2 luns.

Why not add a MSC configuration macro definition in the file usbd_conf_template.h to configure the maximum number of luns supported?

@ALABSTM ALABSTM self-assigned this Jul 1, 2024
@ALABSTM ALABSTM added enhancement New feature or request mw MW-related issue or pull-request usb Universal Serial Bus labels Jul 1, 2024
@ALABSTM
Copy link

ALABSTM commented Jul 8, 2024

See also STM32CubeL4#41

@ALABSTM
Copy link

ALABSTM commented Jul 8, 2024

ST Internal Reference: 126925

@ALABSTM ALABSTM added spotted before customer Spotted internally before being pointed out by the user but not yet fixed or published internal bug tracker Issue confirmed and logged into the internal bug tracking system labels Jul 8, 2024
@ALABSTM
Copy link

ALABSTM commented Jul 15, 2024

Hi @xu-yingjing,

Our development teams acknowledged your request and agreed with the principle. However, there is currently no plan to address it. I will keep you informed should there be any news.

The request has been already logged internally. It will be tracked on GitHub via this issue (mentioned above). Please allow me to close this one. Thank you for your comprehension.

With regards,

@ALABSTM ALABSTM closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2024
@ALABSTM ALABSTM added the wontfix This will not be worked on label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal bug tracker Issue confirmed and logged into the internal bug tracking system mw MW-related issue or pull-request spotted before customer Spotted internally before being pointed out by the user but not yet fixed or published usb Universal Serial Bus wontfix This will not be worked on
Projects
Development

No branches or pull requests

2 participants