sipeed / Tang-Nano-examples

Tang-Nano-examples
59 stars 16 forks source link

Problem USB programming on Linux #5

Open paulossant opened 4 years ago

paulossant commented 4 years ago

I am trying to program the tang nano board via USB on linux, but the board doesn't enumerate. Are there some solution for the problem?

lsusb doesn't return anything.

dmesg returns:

[ 44.504517] usb 3-1: new full-speed USB device number 2 using uhci_hcd [ 59.791794] usb 3-1: device descriptor read/64, error -110 [ 75.328535] usb 3-1: device descriptor read/64, error -110 [ 75.564150] usb 3-1: new full-speed USB device number 3 using uhci_hcd [ 90.882153] usb 3-1: device descriptor read/64, error -110 [ 107.561907] usb 3-1: device not accepting address 3, error -110 [ 107.561937] usb usb3-port1: attempt power cycle [ 107.561946] usb usb3-port1: failed to disable port power [ 107.689784] usb 3-1: new full-speed USB device number 4 using uhci_hcd [ 119.122573] usb 3-1: device descriptor read/all, error -110 [ 119.248686] usb 3-1: new full-speed USB device number 5 using uhci_hcd [ 133.192579] usb 3-1: device descriptor read/all, error -110 [ 133.192610] usb usb3-port1: unable to enumerate USB device

best regards, Paulo

paulossant commented 4 years ago

Also tried in windows, but also it cannot enumerate. Coul be something wrong with the ch552t microcontroller? Could i use the jtag to program it? And if so, how? Thanks

thotypous commented 1 year ago

I have the same issue with a Thinkpad laptop. But if I plug the Tang Nano to a USB hub instead of plugging directly to the laptop's USB port, it works. The Tang Nano also works when plugged to a Dell desktop PC.

error -110 means "power exceeded", and if you run lsusb -v on a computer which recognizes the Tang Nano, you can see it requests only the default 100mA from the USB port:

Bus 002 Device 013: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC
Device Descriptor:
  [...]
  idVendor           0x0403 Future Technology Devices International, Ltd
  idProduct          0x6010 FT2232C/D/H Dual UART/FIFO IC
  bcdDevice            5.00
  iManufacturer           1 Kongou Hikari
  iProduct                2 Sipeed-Debug
  [...]
  Configuration Descriptor:
    [...]
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    [...]

So I guess it peaks over 100mA current when turning on and the current limit is only enforced strictly by some motherboards / USB controllers.

If anybody had any idea on how to change the factory USB descriptor to request 500mA, maybe we could solve this issue.

trabucayre commented 1 year ago

You use first generation tangNano? True? If so firmware is here see instructions to rebuild them. I have written a stupid piece of code to pass the ch552 into bl mode.