Showing results for 
Search instead for 
Did you mean: 

Issue with MSC+CDC under Linux with multiple LUNs

Associate II
Posted on January 20, 2014 at 13:00

Hi guys

I`m working on MSC+CDC+HID on STM32F415 using USB HS. It`s working well under Windows and Mac. But under Linux I can see only first LUN. The rest is ok. One LUN is always available, second is password protected. Multiple LUN works on Linux if only MSC is used or MSC+HID. Issue is only in MDC+CDC (regardless if HID is enabled).

Is there know issue in Linux? I have checked Debian, Ubuntu, OpenWRT and Fedora. Multiple LUN in kernel is enabled. So it`s Linux related or a bug in my code.

My suspect is the USB IAD composite device (CDC required it), it may be an issue. Or my code has a bug (which I`m still investigating). What I see in my code is that Linux is performing one SCSI inquiry command for LUN0. Windows and Mac call this command few times, for each LUN. Those I`m still investigating it...

Maybe someone who has MSC+CDC on STM32F4 working can check it if his implementation works on Linux with more than one LUN (just add one LUN and Linux dmesg command should report it)?



#msc #stm32 #usb #vcp
Associate III
Posted on January 26, 2014 at 14:17

Hi Krutecki

I am trying to do MSC+CDC on ChibiOS with partial success. I have a couple of boards incl. STM32F4 Discovery and Olimex' STM32-E407 and use Eclipse and EWARM IDEs.

Could you share your code for composite device and I will try to spare some time in debugging LUN issue.

Best regards


Associate II
Posted on February 07, 2014 at 14:01


As I though it was my mistake. USB Setup packet was not properly handled. Now MSC with multiple LUNs, CDC and custom HID (act like CDC but driverless) all runs under FreeRTOS like a charm.

Christo, my code will be open source but not know (after Kickstarter campaign). But maybe I can help anyway. What is working for you? Have you checked descriptors? Use USBlyzer and copy-paste result here - I will check it. Step-by-step it will work for you as well 🙂