STM32L476 USB HAL errors Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
kreyl
Posts: 59
Joined: Sun Jan 13, 2013 11:46 pm
Been thanked: 4 times
Contact:

Re: STM32L476 USB HAL errors

Postby kreyl » Tue Aug 22, 2017 12:36 pm

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.

User avatar
lilvinz
Posts: 130
Joined: Sat Dec 21, 2013 2:56 pm
Has thanked: 1 time
Been thanked: 6 times

Re: STM32L476 USB HAL errors

Postby lilvinz » Tue Aug 22, 2017 12:38 pm

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

User avatar
kreyl
Posts: 59
Joined: Sun Jan 13, 2013 11:46 pm
Been thanked: 4 times
Contact:

Re: STM32L476 USB HAL errors

Postby kreyl » Tue Aug 22, 2017 12:55 pm

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.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32L476 USB HAL errors

Postby Giovanni » Tue Aug 22, 2017 1:06 pm

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

User avatar
kreyl
Posts: 59
Joined: Sun Jan 13, 2013 11:46 pm
Been thanked: 4 times
Contact:

Re: STM32L476 USB HAL errors

Postby kreyl » Tue Aug 22, 2017 1:25 pm

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.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32L476 USB HAL errors

Postby Giovanni » Tue Aug 22, 2017 2:47 pm

Ah OK, so the workaround seems to work as expected.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32L476 USB HAL errors  Topic is solved

Postby Giovanni » Thu Aug 24, 2017 10:52 am

No news is good news :)

Fixed as bug #875.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 7 guests