cancel
Showing results for 
Search instead for 
Did you mean: 

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

AScha.3
Principal III

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?

If you feel a post has answered your question, please click "Accept as Solution".
1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Principal III

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

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
AScha.3
Principal III

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

If you feel a post has answered your question, please click "Accept as Solution".
Piranha
Chief II

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!