Author Topic: Problem with HUB Class Driver STM32F205  (Read 21128 times)

Tops

  • Member
  • ***
  • Posts: 5
Problem with HUB Class Driver STM32F205
« on: February 24, 2014, 04:03:04 am »
I have a problem with enumeration of low speed devices through a hub (working at full speed).
I am using STM32F205 USB full speed (USB_OTG_HS in full speed mode using the embedded full speed phy)
with STM32_USB-Host-Device_Lib_V2.1.0.
I did some modifications to the host lib to support multiple devices / interfaces
and added the hub class driver. Everything is fine with devices working at full speed, but the enumeration
of low speed devices fails sometimes (sometimes it works!). The problem is, that sending the SETUP packet of a low speed control transfer
could result in a transaction error (TXERR).

According to the STM32 manual this error indicates one of the following errors:
- CRC check failure
- timeout
- bit stuff error
- false EOP

I have no hardware analyser, so I am not sure what exactly happens.
I have the suspicion that the false EOP event causes a problem when using low speed devices through a full speed hub.
But if I am right, this should be a problem of the built-in hardware scheduler.
I asked ST for support, but they said, that the problem is not known.

Is there anything else I should keep in mind?
« Last Edit: February 24, 2014, 04:28:57 am by Tops »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Problem with HUB Class Driver STM32F205
« Reply #1 on: February 24, 2014, 10:42:50 am »
A hardware analyzer would show the bus traffic and might offer a clue. Otherwise, use whatever debugging tools you have to monitor what happens when you send a Setup packet. Does the device return ACK in the Setup stage? If yes, does the device or host send data or does the host attempt the Status stage (depending on the request)?

Tops

  • Member
  • ***
  • Posts: 5
Re: Problem with HUB Class Driver STM32F205
« Reply #2 on: February 25, 2014, 04:02:33 am »
The device doesn`t return ACK. Instead the host channel interrupt register states the transaction error.
After that, the core halts the channel and the host goes to error state. Then the host tries to resend the Setup packet (without success, there`s no interrupt indicating an ACK or another error and the stack doesn`t recover properly).


Tops

  • Member
  • ***
  • Posts: 5
Re: Problem with HUB Class Driver STM32F205
« Reply #3 on: February 25, 2014, 04:44:12 am »
I realized, that right before reporting the transaction error, the core generates a port disabled interrupt.
I don`t know why this is happening, but this should be the reason why the retry fails.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Problem with HUB Class Driver STM32F205
« Reply #4 on: February 25, 2014, 09:18:59 am »
Are you sure the STM32F205's OTG port supports communicating downstream at low speed? I saw no mention of low speed in the datasheet. OTG hosts need to support low speed only if a low-speed device is on the Targeted Peripheral List.

Tops

  • Member
  • ***
  • Posts: 5
Re: Problem with HUB Class Driver STM32F205
« Reply #5 on: February 26, 2014, 04:21:42 am »
The host mode supports high-speed, full-speed and low-speed transfers (the peripheral mode is for high-speed and full-speed only).

I found this topic in the ST-Forum, which addresses the same problem:
https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a%2f%2fmy%2est%2ecom%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex%5fmx%5fstm32%2fSTM32F217%20%2d%20USB%20FS%20host%20mode%20hub%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=200

I tried to register the low-speed transactions at SOF-Interrupt as mentioned, but only with partial success.
The enumeration of the low-speed device seems to work fine now, but in rare cases I`m facing problems with bulk transfers
(now the bulk transfers would cause the port disabled interrupt and the transaction error).

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Problem with HUB Class Driver STM32F205
« Reply #6 on: February 26, 2014, 09:12:47 am »
It is starting to look like a problem with the controller. Hope you find a solution.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Problem with HUB Class Driver STM32F205
« Reply #7 on: February 26, 2014, 02:21:30 pm »
I tried to register the low-speed transactions at SOF-Interrupt as mentioned, but only with partial success.
The enumeration of the low-speed device seems to work fine now, but in rare cases I`m facing problems with bulk transfers
(now the bulk transfers would cause the port disabled interrupt and the transaction error).
Bulk transfers are not allowed at low speed. Low speed devices are only allowed Interrupt and Control.

Tops

  • Member
  • ***
  • Posts: 5
Re: Problem with HUB Class Driver STM32F205
« Reply #8 on: February 27, 2014, 01:55:06 am »
I`m using mass storage and HID devices through the HUB. What I meant to say is that full speed bulk transfers causing the transaction error,
if I try to register all the low speed transfers at SOF-Interrupt.

ST promised to do some testing.
I let you know, if there`s a solution to this problem.

pisekA

  • Member
  • ***
  • Posts: 2
Re: Problem with HUB Class Driver STM32F205
« Reply #9 on: February 05, 2018, 11:03:56 am »
4 years later and exact same problem on my side, just different board (STM32F469I). Looks like USB library did not advance much in this matter.
Anyone got past this problem?

Quote
I tried to register the low-speed transactions at SOF-Interrupt as mentioned, but only with partial success.
What did you mean by this? I can't figure it out since link to ST-Forum is obsolete.

I would much appreciate any help in this matter.


ulao

  • Frequent Contributor
  • ****
  • Posts: 172
Re: Problem with HUB Class Driver STM32F205
« Reply #10 on: February 05, 2018, 01:25:08 pm »
I'm using the STM32F205 USB full speed via the hall (stm32f2xx_hal.h) driver. Control transfers works fine on a PC. I do have issues with a MAC.  The usb device gives up after a few seconds but I an not get any info on it. Happy to try any hex if you like.

pisekA

  • Member
  • ***
  • Posts: 2
Re: Problem with HUB Class Driver STM32F205
« Reply #11 on: February 06, 2018, 10:06:41 am »
Thank you, but my problem is with usb-host, with hosting a hub. if I quote Tops, it describes my problem exactly.
Quote
I have a problem with enumeration of low speed devices through a hub (working at full speed).
I am using STM32F205 USB full speed (USB_OTG_HS in full speed mode using the embedded full speed phy)
with STM32_USB-Host-Device_Lib_V2.1.0.
I did some modifications to the host lib to support multiple devices / interfaces
and added the hub class driver. Everything is fine with devices working at full speed, but the enumeration
of low speed devices fails sometimes (sometimes it works!). The problem is, that sending the SETUP packet of a low speed control transfer
could result in a transaction error (TXERR).
The problem always occurs when resetting the channel (EP0) from full to low speed (changing the HCCHAR register) after that the next SETUP packet sometimes results in a transaction error (TXERR).