cancel
Showing results for 
Search instead for 
Did you mean: 

Stuck in HOST_DEV_WAIT_FOR_ATTACHMENT while usb

SGasp.1
Senior

Hi.. I am working with stm32f429disco 1.. .I have generated with cube mx the fw init for usb host..

When I start my fw with the usb stick connected at least I am able to go inside the routine

USBH_Process


_legacyfs_online_stmicro_images_0693W00000dJptRQAS.png 

but when i run again the fw i am not able to stop in the same place..

What i mean is that with the usb stick connected just one time this variable is at value 1

phost->device.is_connected

The second time i try to stop the before variable is 0

Instead when I run the fw without the usb key conncted i never stop in the state

HOST_DEV_WAIT_FOR_ATTACHMENT

what could be wrong ?

It seems it is able to see the usb key just once and then something bad is happening

I think the setup from cube mx should be correct but i uploaded here ..

Can you please help me ?

VBus is enabled because the related led it is working..

Thanks

6 REPLIES 6
Pavel A.
Evangelist III

USB protocol requires real time response from the device. Stopping on breakpoint likely disturbs the connection and it fails. Find a way to debug without breakpoints.

SGasp.1
Senior

Thanks @Pavel A.​ for your commnet. As confirmation can you please check the ioc file just to understand if everything was set up correctly for the stm32f429 disco 1 evaluation board. I don't understand why ST doesn't provide an ioc example for the usb host. Thanks a lot for your help

The STM32F4 package of examples has been developed before CubeMX has been released, so the examples for F4 boards are not based on .ioc and generated code.

New products do include .ioc based example projects.

Sorry, I don't have the stm32f429 disco to test ... and am a bit busy ))

SGasp.1
Senior

Thanks @Pavel A.​ .. I will try to find some examples of ioc file for this development board. It is a pity they didnt update with the ioc file also for this board.

Thanks again

Hi @SGasp.1​ , Did you get over the issue? I'm also using the same E-Val board and could not get any interrupt in the IRQ handler when working in Host mode.

SGasp.1
Senior

Hi @RAnan.3​ ..

The only solution that i have found it is reported here

https://community.st.com/s/question/0D53W00002FY6i2SAD/stm32f4-another-usb-host-msc-problem

I have tried to import quickly the folders but i got many issues.

Once i will have time i will try to fix the include issues..

You can try and let me know..

Thanks