cancel
Showing results for 
Search instead for 
Did you mean: 

USB connection ends with TXERR

Emmil
Associate II
Posted on September 23, 2015 at 21:04

Hi there forum,

I would like to connect a USB pen to my STM32F4-Discovery kit.

I am using libraries from stsw-stm32068.zip, and the GPIO, USB initialization code and the usb_conf.h and usbh_conf.h files are from Audio_playback_and_record example.

After connecting a USB disk to the system the host state machine idles in HOST_CTRL_XFER, polling the USB state, which is always URB_IDLE.

Looking at the corresponding host channel interrupt register, I see, that TXERR flag has been set, which according the documentation can mean:

  • CRC check failure
  • Timeout
  • Bit stuff error
  • False EOP
The USB disk works on my computer and the cable I am using is working as expected, too.

Can anyone give me few pointers where to look for solutions?

Thanks.

#stm32 #usb #discovery #device
2 REPLIES 2
Emmil
Associate II
Posted on November 22, 2015 at 20:22

Anyone?

Emmil
Associate II
Posted on November 23, 2015 at 18:37

OK, I have a clue.

I have found two different versions of system_stm32f4xx.c.

One version of the file never works with USB, the other one works mostly (depending on used USB disk), but eventually also dies on TXERR.

Diffing them I see different values for PLL, however I am a SSE (Simple Software Engineer) and I really don't understand the impact of the settings.

Can those values be fine tuned so the USB will work always?

Update:

The forum seems to be broken and I can't upload the mentioned files, so here are at least the values:

Works:

HSE Frequency (HZ) = 8000000

PLL_M = 8

High Performance Mode = Enabled

Broken:

HSE Freqency (HZ) = 25000000

PLL_M = 25

Main regulator output mode voltage = Scale 1 mode