Page 6 of 6

Re: STM32L476 USB HAL errors

Posted: Tue Aug 22, 2017 12:36 pm
by kreyl
I have changed line 1006 in hal_usb_lld.c, setting value to 1 and 0 with same result: EP0 state machine error at receiving mentioned "A1..." packet.

Re: STM32L476 USB HAL errors

Posted: Tue Aug 22, 2017 12:38 pm
by lilvinz
kreyl wrote:I checked out the trunk and replaced next files in my project:
    hal_usb.h
    hal_usb.c
    hal_usb_cdc.h
    hal_usb_lld.h
    hal_usb_lld.c
    stm32_otg.h


Don't forget to update the registry as well. Otherwise the workaround will not be active.

Cheers

Vinz

Re: STM32L476 USB HAL errors

Posted: Tue Aug 22, 2017 12:55 pm
by kreyl
Removing assert at line 950 (osalDbgAssert(false, "EP0 state machine error");) fixed the problem, everything works smoothly.
Vinz, yes, I have replaced stm32_registry.h with file from trunk, STM32_OTG_SEQUENCE_WORKAROUND is defined there.

Re: STM32L476 USB HAL errors

Posted: Tue Aug 22, 2017 1:06 pm
by Giovanni
What the the ep0 state when the assertion is triggered?

It looks like an IN transaction end while an OUT transaction is ongoing. Probably it is another instance of the problem, the fix was for OUT while IN/STP.

This device seems to throw EP0 interrupts at random times.

Giovanni

Re: STM32L476 USB HAL errors

Posted: Tue Aug 22, 2017 1:25 pm
by kreyl
Sorry, I was wrong: when STM32_OTG_SEQUENCE_WORKAROUND defined, everything works without disabling the assert.
When STM32_OTG_SEQUENCE_WORKAROUND undefined, assert fires at state USB_EP0_IN_SENDING_STS.

Re: STM32L476 USB HAL errors

Posted: Tue Aug 22, 2017 2:47 pm
by Giovanni
Ah OK, so the workaround seems to work as expected.

Giovanni

Re: STM32L476 USB HAL errors

Posted: Thu Aug 24, 2017 10:52 am
by Giovanni
No news is good news :)

Fixed as bug #875.

Giovanni