Skip to main content
Super User
January 5, 2023
Solved

USB (msc) Host no more working - how to find the cause ?

  • January 5, 2023
  • 2 replies
  • 1133 views

i had USB Host MSC working on H743 (devE board) , read USB sticks 1...64 GB without problem;

now, after try to make USB Audio Host on second (HS) usb port, which is not running until now (there is no working example by STM - and no plan to do this (!) ) , access to usb stick no more working; and i have no idea, why ...or what i did wrong.

i installed SWV , to see more info, this is coming, when debug level on usb is set :

0693W00000Y7Wo8QAF.pngobviously usb stick is enumerated, can read size and directory, but when read data (16KB) it hang up in some usb BOT loop or USB_busy state.

0693W00000Y7WomQAF.png 

anybody knows, what i should do now, to get it running again?

+ maybe , howto get audio host running?

    This topic has been closed for replies.
    Best answer by AScha.3

    ok, found problem:

    the usb file read is first called in main (worked always), then from DMA callback;

    so usb INT needs to have higher priority than this DMA INT;

    i set it on same priority , but higher sub prio.

    didnt work....

    until i set now the DMA INT to next lower priority (1.3 -> 2.1 ) - now ok again.

    0693W00000Y7dDiQAJ.png

    2 replies

    AScha.3AuthorAnswer
    Super User
    January 7, 2023

    ok, found problem:

    the usb file read is first called in main (worked always), then from DMA callback;

    so usb INT needs to have higher priority than this DMA INT;

    i set it on same priority , but higher sub prio.

    didnt work....

    until i set now the DMA INT to next lower priority (1.3 -> 2.1 ) - now ok again.

    0693W00000Y7dDiQAJ.png

    Graduate II
    January 7, 2023

    Take a note that ST USB stack's APIs cannot be called from non-interrupt context or from interrupts of different priorities without providing an appropriate protection. It's designed by incompetent fools...

    https://community.st.com/s/question/0D53W00001Ie4WcSAJ/32f417-how-to-block-usbfs-isr-from-a-shared-resource-serial-flash-on-spi?t=1641814294067

    Better invest your time in TinyUSB!