Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Need Help: Smart Card Implementation for Nios II Linux (USB Problem)

Hi guys,

Have anyone try to port PCSC-Lite to Nios II Linux for the purpose of smart card implementation before?

I have successfully cross compile pcsc-lite 1.8.3, ccid 1.4.5 and libusb 1.0.

In Nios II Linux, the card reader and smart card are successfully detected, but when I try to transmit data in the form of APDU, libusb error of -9 (LIBUSB_ERROR_PIPE) is reported.

Hereby I include the debug log generated from pcscd:

00040814 ccid_usb.c:365:OpenUSBByName() Checking device: 1/3
00000264 ccid_usb.c:420:OpenUSBByName() Trying to open USB bus/device: 1/3
00008273 ccid_usb.c:509:OpenUSBByName() Found Vendor/Product: 04E6/E001 (SCM Microsystems Inc. SCR 331)
00000249 ccid_usb.c:511:OpenUSBByName() Using USB bus/device: 1/3
00004439 ccid_usb.c:1029:ControlUSB() request: 0x03
00001622 ccid_usb.c:1042:ControlUSB() control failed (1/3): -9 No such file or directory
00000227 ccid_usb.c:973:get_data_rates() IFD does not support GET_DATA_RATES request: -9
00054297 ccid_usb.c:1078:InterruptRead() before (0)
00002343 ccid_usb.c:1120:InterruptRead() after (0) (0)

00001139 winscard.c:1539:SCardTransmit() Send Protocol: T=0
00000304 APDU: 80 84 00 00 08 
00000257 ifdhandler.c:1244:IFDHTransmitToICC() usb:04e6/e001:libusb-1.0:1:3:0 (lun: 0)
00000532 commands.c:1615:CmdXfrBlockTPDU_T0() T=0: 5 bytes
00000768 -> 000000 6F 05 00 00 00 00 07 00 00 00 80 84 00 00 08 
02009386 ccid_usb.c:687:ReadUSB() read failed (1/3): -9 Success
00000224 SW: 
00000227 ifdwrapper.c:520:IFDTransmit() Card not transacted: 612
00000234 winscard.c:1564:SCardTransmit() Card not transacted: 0x80100016
00000243 winscard_svc.c:604:ContextThread() TRANSMIT rv=0x80100016 for client 4

Any advices or comments regarding the LIBUSB_ERROR_PIPE error that I encounter?

Any connection with the USB settings in SOPC Builder or in kernel configuration?

Thanks and regards,

Gladion

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Gladion,

    When I compile pcsc-lite, it show some error, could u please show me your configure options?

    Thanks!

    BR,

    Y.H