You are not logged in.
I have a stm32 board which have stlink with it. I installed the stlink and all the necessary udev rules are there. If enumerated properly it will create a serial device /dev/ttyACMx and will also show a fat partition.
When the board is connected and i restart the computer it works fine, serial port is there. But when the computer is running, i remove and insert again the usb cable it is not recognised. I get the following error in dmesg
[ 355.618200] usb 3-7: new full-speed USB device number 5 using xhci_hcd
[ 355.792759] usb 3-7: ep 0x84 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 355.793280] usb 3-7: can't set config #1, error -71
but if i reset all the usb ports using
# reseting USB2 ports
for i in $(ls /sys/bus/pci/drivers/ehci_hcd/|grep :)
do echo $i >/sys/bus/pci/drivers/ehci_hcd/unbind
echo $i >/sys/bus/pci/drivers/ehci_hcd/bind
done
# reseting USB3 ports (if there none you'll get errors)
for i in $(ls /sys/bus/pci/drivers/xhci_hcd/|grep :)
do echo $i >/sys/bus/pci/drivers/xhci_hcd/unbind
echo $i >/sys/bus/pci/drivers/xhci_hcd/bind
done
It works fine. I have H97 MSI gamer 3 board.
lsusb
Bus 002 Device 002: ID 8087:8001 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8009 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0483:374b STMicroelectronics
Bus 003 Device 003: ID 04d9:1203 Holtek Semiconductor, Inc. Keyboard
Bus 003 Device 002: ID 15d9:0a4d Trust International B.V. Optical Mouse
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
lspci
00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 9 Series Chipset Family USB xHCI Controller
00:16.0 Communication controller: Intel Corporation 9 Series Chipset Family ME Interface #1
00:1a.0 USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #2
00:1b.0 Audio device: Intel Corporation 9 Series Chipset Family HD Audio Controller
00:1c.0 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 1 (rev d0)
00:1c.2 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 3 (rev d0)
00:1c.3 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d0)
00:1d.0 USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #1
00:1f.0 ISA bridge: Intel Corporation 9 Series Chipset Family H97 Controller
00:1f.2 SATA controller: Intel Corporation 9 Series Chipset Family SATA Controller [AHCI Mode]
00:1f.3 SMBus: Intel Corporation 9 Series Chipset Family SMBus Controller
02:00.0 Ethernet controller: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller (rev 13)
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 03)
04:02.0 Network controller: Ralink corp. RT5360 Wireless 802.11n 1T/1R
dmesg
[ 4.951736] [drm] Replacing VGA console driver
[ 4.955829] intel_rapl: Found RAPL domain package
[ 4.955832] intel_rapl: Found RAPL domain core
[ 4.955833] intel_rapl: Found RAPL domain uncore
[ 4.955835] intel_rapl: Found RAPL domain dram
[ 4.968948] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 4.968949] [drm] Driver supports precise vblank timestamp query.
[ 4.968996] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
[ 4.983385] ACPI: Video Device [GFX0] (multi-head: yes rom: no post: no)
[ 4.983659] acpi device:16: registered as cooling_device14
[ 4.983713] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input19
[ 4.983788] snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 4.983789] [drm] Initialized i915 1.6.0 20150130 for 0000:00:02.0 on minor 0
[ 5.009305] fbcon: inteldrmfb (fb0) is primary device
[ 5.049339] scsi 6:0:0:0: Direct-Access MBED microcontroller 1.0 PQ: 0 ANSI: 2
[ 5.049833] sd 6:0:0:0: [sdb] 1056 512-byte logical blocks: (540 kB/528 KiB)
[ 5.050010] sd 6:0:0:0: [sdb] Write Protect is off
[ 5.050011] sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 5.050151] sd 6:0:0:0: [sdb] No Caching mode page found
[ 5.050152] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 5.056156] sdb:
[ 5.056842] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[ 5.068788] Console: switching to colour frame buffer device 240x67
[ 5.071377] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
[ 5.071378] i915 0000:00:02.0: registered panic notifier
[ 5.119387] Adding 2097148k swap on /dev/sda5. Priority:-1 extents:1 across:2097148k FS
[ 5.168352] fuse init (API version 7.23)
[ 5.195473] input: HDA Intel HDMI HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.0/sound/card0/input20
[ 5.195512] input: HDA Intel HDMI HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.0/sound/card0/input21
[ 5.195571] input: HDA Intel HDMI HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.0/sound/card0/input22
[ 5.208053] FAT-fs (sda2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 5.242831] systemd-journald[177]: Received request to flush runtime journal from PID 1
[ 7.509192] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2860.bin'
[ 7.519645] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.34
[ 8.951338] wlp4s2: authenticate with e8:de:27:f4:9f:e8
[ 8.959044] wlp4s2: send auth to e8:de:27:f4:9f:e8 (try 1/3)
[ 8.960912] wlp4s2: authenticated
[ 8.962265] wlp4s2: associate with e8:de:27:f4:9f:e8 (try 1/3)
[ 8.966097] wlp4s2: RX AssocResp from e8:de:27:f4:9f:e8 (capab=0x431 status=0 aid=2)
[ 8.966201] wlp4s2: associated
[ 8.966235] cfg80211: Calling CRDA to update world regulatory domain
[ 85.421055] usb 3-7: USB disconnect, device number 4
[ 89.268764] usb 3-7: new full-speed USB device number 5 using xhci_hcd
[ 89.443392] usb 3-7: ep 0x84 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 89.443983] usb 3-7: can't set config #1, error -71
[ 328.016009] xhci_hcd 0000:00:14.0: remove, state 4
[ 328.016014] usb usb4: USB disconnect, device number 1
[ 328.016145] xhci_hcd 0000:00:14.0: USB bus 4 deregistered
[ 328.016149] xhci_hcd 0000:00:14.0: remove, state 1
[ 328.016152] usb usb3: USB disconnect, device number 1
[ 328.016153] usb 3-3: USB disconnect, device number 2
[ 328.051877] usb 3-4: USB disconnect, device number 3
[ 328.242927] usb 3-7: USB disconnect, device number 5
[ 328.243395] xhci_hcd 0000:00:14.0: USB bus 3 deregistered
[ 328.243647] xhci_hcd 0000:00:14.0: xHCI Host Controller
[ 328.243651] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 3
[ 328.341680] xhci_hcd 0000:00:14.0: hcc params 0x200077c1 hci version 0x100 quirks 0x00009810
[ 328.341697] xhci_hcd 0000:00:14.0: cache line size of 64 is not supported
[ 328.342018] hub 3-0:1.0: USB hub found
[ 328.342043] hub 3-0:1.0: 14 ports detected
[ 328.366699] xhci_hcd 0000:00:14.0: xHCI Host Controller
[ 328.366714] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 4
[ 328.366981] hub 4-0:1.0: USB hub found
[ 328.366994] hub 4-0:1.0: 6 ports detected
[ 328.704933] usb 3-3: new low-speed USB device number 2 using xhci_hcd
[ 328.881338] usb 3-3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 328.883404] input: USB OPTICAL MOUSE as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:15D9:0A4D.0004/input/input23
[ 328.883642] hid-generic 0003:15D9:0A4D.0004: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-0000:00:14.0-3/input0
[ 329.041600] usb 3-4: new low-speed USB device number 3 using xhci_hcd
[ 329.226073] usb 3-4: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 329.226076] usb 3-4: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 329.234694] input: HID 04d9:1203 as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0/0003:04D9:1203.0005/input/input24
[ 329.285004] hid-generic 0003:04D9:1203.0005: input,hidraw1: USB HID v1.11 Keyboard [HID 04d9:1203] on usb-0000:00:14.0-4/input0
[ 329.298893] input: HID 04d9:1203 as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.1/0003:04D9:1203.0006/input/input25
[ 329.351641] hid-generic 0003:04D9:1203.0006: input,hidraw2: USB HID v1.11 Device [HID 04d9:1203] on usb-0000:00:14.0-4/input1
[ 329.511596] usb 3-7: new full-speed USB device number 4 using xhci_hcd
[ 329.686380] usb 3-7: ep 0x84 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 329.686966] usb-storage 3-7:1.1: USB Mass Storage device detected
[ 329.687165] scsi host7: usb-storage 3-7:1.1
[ 329.687382] cdc_acm 3-7:1.2: ttyACM0: USB ACM device
[ 330.688552] scsi 7:0:0:0: Direct-Access MBED microcontroller 1.0 PQ: 0 ANSI: 2
[ 330.688935] sd 7:0:0:0: [sdb] 1056 512-byte logical blocks: (540 kB/528 KiB)
[ 330.689089] sd 7:0:0:0: [sdb] Write Protect is off
[ 330.689091] sd 7:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 330.689284] sd 7:0:0:0: [sdb] No Caching mode page found
[ 330.689286] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[ 330.695324] sdb:
[ 330.696110] sd 7:0:0:0: [sdb] Attached SCSI removable disk
[ 352.926977] usb 3-7: USB disconnect, device number 4
[ 355.618200] usb 3-7: new full-speed USB device number 5 using xhci_hcd
[ 355.792759] usb 3-7: ep 0x84 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 355.793280] usb 3-7: can't set config #1, error -71
I want that whenever i insert the stlink board it should enumerate properly and create serial port.
Last edited by sanjuchopra (2015-05-30 14:44:25)
Offline
I got it working. Actually the cable was faulty. I tried with other cable and it worked fine. But strange thing is that after usb reset old cable works fine.
Offline