cancel
Showing results for 
Search instead for 
Did you mean: 

Custom HID + MSC on STM32L152D-EVAL

D.Cedric
Associate II
Posted on June 14, 2015 at 01:30

Hello,

I'd like to post a work in progress, almost finished but there's still a bug I hope some will find.

When executing the software with the msc class (so two classes in the same time), I get a hard fault error at USB enumeration.

Place the extracted project in \STM32Cube_FW_L1_V1.0.0\Projects\STM32L152D_EVAL\Applications\USB_Device

That should be it.

1 REPLY 1
D.Cedric
Associate II
Posted on June 14, 2015 at 11:57

The USB-FS-Device library example works well.

The main work is to port the software to a STM32Cube friendly project.

If we want to have a double interface like Eval4xx projects double core, it will be very difficult, the main reason is that when an USB IT is serviced, the driver doesn't know to which EP it should be redistributed, since the descriptorHandle->Instance is USB at MSC and HID descriptor.

There are two ways to find a solution :

- rewrite the IRQ handler so that the EP is checked first by means of PCD_GET_ENDPOINT and redirect the IRQ handler to the good one

- write a real composite USB class

Thinking as a STMCube user, the best way is the second, since the PCD driver won't have to be rewriten.