Showing results for 
Search instead for 
Did you mean: 

how to manage USB with a bare-metal application ?



I want to make a bare-metal application (without Linux OS) on a STM32MP157C-DK2 Board.

I need to use the usb host controller from this board (that why I choose it: multiples USB socket) but in the projects created with CubeIde, I can only assign USBH_HS1 or USB_OTG_HS with the A7 runtime context and my application C code is under the folder project_CM4 wich seem related to only M4 context and not with A7 context

So, my question is simple: could we use a USB mass storage device with a bare-metal application on STM32MP157C-DK2 Board  without a Linux distrib?

I am wondering because I can’t find either a HAL USB module as expected in the “stm32mp1xx_hal�?  list as if the only appropriate way to manage usb was with an OS attached to cortec A7

Thanks in advance for any help


Yes, of course you may use my work.

I had to uncomment the `if` block above, because the MSC driver from the ST USB library does not align the TX buffers to cache rows.

In my edition of ST device classes added alignment for needed structures:

see USBALIGN_BEGIN / USBALIGN_END usage in existing classes.