AnsweredAssumed Answered

How to fix FRDM-KL25Z USB errors under Linux

Question asked by Ned Konz on Nov 21, 2012
Latest reply on May 2, 2013 by Lars Knudsen

I'm trying to use my new FRDM-KL25Z boards and am running into problems with the mass-storage peripheral (both in bootloader mode and in normal target-loader mode).

 

Though this board appears to work OK under Windows, connecting it to my Linux (Ubuntu 12.04 64-bit) system results in errors that keep me from being able to program the target processor.

 

Here's what happens when I connect to the debug USB connector, then plug in board with the reset button held:

kernel: [21855.408099] usb 2-4.2: new full-speed USB device number 72 using ehci_hcd
kernel: [21855.496096] usb 2-4.2: device descriptor read/64, error -32
kernel: [21855.710350] scsi35 : usb-storage 2-4.2:1.0
mtp-probe: checking bus 2, device 72: "/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4.2"
mtp-probe: bus: 2, device: 72 was not an MTP device
kernel: [21856.708856] scsi 35:0:0:0: Direct-Access     FSL      FSL/PEMICRO MSD  0001 PQ: 0 ANSI: 4
kernel: [21856.709567] sd 35:0:0:0: Attached scsi generic sg12 type 0
kernel: [21856.710095] sd 35:0:0:0: [sdl] 1983999 512-byte logical blocks: (1.01 GB/968 MiB)
kernel: [21856.710590] sd 35:0:0:0: [sdl] Write Protect is off
kernel: [21856.710594] sd 35:0:0:0: [sdl] Mode Sense: 00 00 00 00
kernel: [21856.712913] sd 35:0:0:0: [sdl] Asking for cache data failed
kernel: [21856.712919] sd 35:0:0:0: [sdl] Assuming drive cache: write through
kernel: [21856.715967] sd 35:0:0:0: [sdl] Asking for cache data failed
kernel: [21856.715971] sd 35:0:0:0: [sdl] Assuming drive cache: write through
kernel: [21856.725391]  sdl:
kernel: [21856.727595] sd 35:0:0:0: [sdl] Asking for cache data failed
kernel: [21856.727599] sd 35:0:0:0: [sdl] Assuming drive cache: write through
kernel: [21856.727603] sd 35:0:0:0: [sdl] Attached SCSI removable disk
kernel: [21886.904105] usb 2-4.2: reset full-speed USB device number 72 using ehci_hcd
udevd[12506]: timeout '/sbin/blkid -o udev -p /dev/sdl'
kernel: [21918.008112] usb 2-4.2: reset full-speed USB device number 72 using ehci_hcd
udevd[12506]: timeout: killing '/sbin/blkid -o udev -p /dev/sdl' [12702]
6]: last message repeated 30 times
kernel: [21948.984120] usb 2-4.2: reset full-speed USB device number 72 using ehci_hcd
udevd[12506]: timeout: killing '/sbin/blkid -o udev -p /dev/sdl' [12702]
6]: last message repeated 30 times
kernel: [21979.960133] usb 2-4.2: reset full-speed USB device number 72 using ehci_hcd
udevd[12506]: timeout: killing '/sbin/blkid -o udev -p /dev/sdl' [12702]
6]: last message repeated 30 times
kernel: [22010.936139] usb 2-4.2: reset full-speed USB device number 72 using ehci_hcd
udevd[12506]: timeout: killing '/sbin/blkid -o udev -p /dev/sdl' [12702]
6]: last message repeated 30 times
kernel: [22041.912148] usb 2-4.2: reset full-speed USB device number 72 using ehci_hcd
udevd[12506]: '/sbin/blkid -o udev -p /dev/sdl' [12702] terminated by signal 9 (Killed)
udevd[12506]: timeout 'udisks-part-id /dev/sdl'
kernel: [22042.020900] sd 35:0:0:0: [sdl] Unhandled error code
kernel: [22042.020904] sd 35:0:0:0: [sdl]  Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
kernel: [22042.020909] sd 35:0:0:0: [sdl] CDB: Read(10): 28 00 00 1e 45 00 00 00 08 00
kernel: [22042.020918] end_request: I/O error, dev sdl, sector 1983744
kernel: [22042.020923] Buffer I/O error on device sdl, logical block 1983744
kernel: [22042.020928] Buffer I/O error on device sdl, logical block 1983745
kernel: [22042.020930] Buffer I/O error on device sdl, logical block 1983746
kernel: [22042.020933] Buffer I/O error on device sdl, logical block 1983747
kernel: [22042.020935] Buffer I/O error on device sdl, logical block 1983748
kernel: [22042.020938] Buffer I/O error on device sdl, logical block 1983749
kernel: [22042.020941] Buffer I/O error on device sdl, logical block 1983750
kernel: [22042.020943] Buffer I/O error on device sdl, logical block 1983751

Then I unplug the board, and see a disconnect. Re-connecting it without the reset button held results in a similar set of problems:

kernel: [22075.824154] usb 2-4.2: new full-speed USB device number 73 using ehci_hcd
kernel: [22075.934856] cdc_acm 2-4.2:1.0: This device cannot do calls on its own. It is not a modem.
kernel: [22075.934878] cdc_acm 2-4.2:1.0: ttyACM0: USB ACM device
kernel: [22075.935530] scsi36 : usb-storage 2-4.2:1.2
mtp-probe: checking bus 2, device 73: "/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4.2"
mtp-probe: bus: 2, device: 73 was not an MTP device
kernel: [22076.932792] scsi 36:0:0:0: Direct-Access     FSL      FSL/PEMICRO MSD  0001 PQ: 0 ANSI: 4
kernel: [22076.933544] sd 36:0:0:0: Attached scsi generic sg12 type 0
kernel: [22076.934072] sd 36:0:0:0: [sdl] 1983999 512-byte logical blocks: (1.01 GB/968 MiB)
kernel: [22076.936039] sd 36:0:0:0: [sdl] Write Protect is off
kernel: [22076.936049] sd 36:0:0:0: [sdl] Mode Sense: 00 00 00 00
kernel: [22076.936674] sd 36:0:0:0: [sdl] Asking for cache data failed
kernel: [22076.936678] sd 36:0:0:0: [sdl] Assuming drive cache: write through
kernel: [22076.939779] sd 36:0:0:0: [sdl] Asking for cache data failed
kernel: [22076.939783] sd 36:0:0:0: [sdl] Assuming drive cache: write through
kernel: [22076.950187]  sdl:
kernel: [22076.952411] sd 36:0:0:0: [sdl] Asking for cache data failed
kernel: [22076.952416] sd 36:0:0:0: [sdl] Assuming drive cache: write through
kernel: [22076.952420] sd 36:0:0:0: [sdl] Attached SCSI removable disk
kernel: [22107.896168] usb 2-4.2: reset full-speed USB device number 73 using ehci_hcd
kernel: [22107.984167] usb 2-4.2: device descriptor read/64, error -32
kernel: [22108.176164] usb 2-4.2: device descriptor read/64, error -32
kernel: [22108.368167] usb 2-4.2: reset full-speed USB device number 73 using ehci_hcd
kernel: [22108.456165] usb 2-4.2: device descriptor read/64, error -32
kernel: [22108.648169] usb 2-4.2: device descriptor read/64, error -32
kernel: [22108.840168] usb 2-4.2: reset full-speed USB device number 73 using ehci_hcd
kernel: [22109.248017] usb 2-4.2: device not accepting address 73, error -32
kernel: [22109.336163] usb 2-4.2: reset full-speed USB device number 73 using ehci_hcd
kernel: [22109.744017] usb 2-4.2: device not accepting address 73, error -32
kernel: [22109.744320] sd 36:0:0:0: Device offlined - not ready after error recovery
kernel: [22109.744330] sd 36:0:0:0: [sdl] Unhandled error code
kernel: [22109.744332] sd 36:0:0:0: [sdl]  Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
kernel: [22109.744337] sd 36:0:0:0: [sdl] CDB: Read(10): 28 00 00 00 01 20 00 00 08 00
kernel: [22109.744346] end_request: I/O error, dev sdl, sector 288
kernel: [22109.744351] Buffer I/O error on device sdl, logical block 288
kernel: [22109.744355] Buffer I/O error on device sdl, logical block 289
kernel: [22109.744357] Buffer I/O error on device sdl, logical block 290
kernel: [22109.744360] Buffer I/O error on device sdl, logical block 291
kernel: [22109.744362] Buffer I/O error on device sdl, logical block 292
kernel: [22109.744365] Buffer I/O error on device sdl, logical block 293
kernel: [22109.744367] Buffer I/O error on device sdl, logical block 294
kernel: [22109.744370] Buffer I/O error on device sdl, logical block 295
kernel: [22109.744387] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744395] sd 36:0:0:0: killing request
kernel: [22109.744406] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744414] usb 2-4.2: USB disconnect, device number 73
kernel: [22109.744427] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744436] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744442] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744448] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744453] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744459] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744464] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744532] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744545] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744550] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744556] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744561] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744567] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744572] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744577] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744583] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744601] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744610] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744616] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.744621] sd 36:0:0:0: rejecting I/O to offline device
kernel: [22109.832163] usb 2-4.2: new full-speed USB device number 74 using ehci_hcd
kernel: [22109.920162] usb 2-4.2: device descriptor read/64, error -32
kernel: [22110.112165] usb 2-4.2: device descriptor read/64, error -32
kernel: [22110.304163] usb 2-4.2: new full-speed USB device number 75 using ehci_hcd
kernel: [22110.392163] usb 2-4.2: device descriptor read/64, error -32
kernel: [22110.584166] usb 2-4.2: device descriptor read/64, error -32
kernel: [22110.776164] usb 2-4.2: new full-speed USB device number 76 using ehci_hcd
kernel: [22111.184019] usb 2-4.2: device not accepting address 76, error -32
kernel: [22111.272164] usb 2-4.2: new full-speed USB device number 77 using ehci_hcd
kernel: [22111.680020] usb 2-4.2: device not accepting address 77, error -32
kernel: [22111.680182] hub 2-4:1.0: unable to enumerate USB device on port 2

 

So it appears that the behavior of the mass-storage emulation on the K20 is not reliable, at least on my system. I have no problem with other USB devices, though, even somewhat peculiar composite devices with strange storage layouts.

 

It may even be that the device is not following the requirements of the USB spec for the mass storage class. After all, "it seems to work in Windows" is not a guarantee of correct operation.

 

I could get USB traces next week to verify the behavior, if that would help.

 

Can anyone suggest how I might be able to fix this problem?

Outcomes