KL82Z USB CCID on Linux and macOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KL82Z USB CCID on Linux and macOS

12,969 Views
ND2
Contributor III

Hello,

We are trying to use the KL82Z as a CCID device on Linux and macOS. We have ordered the FRDM-KL82Z as well as the TWR board but while we wait for the boards to be delivered to us we wanted to check and make sure that the USB CCID stack works on both Linux and macOS.

 

We understand that the PN7462AU stack works on both the operating systems and we have installed the relevant libraries as well for it on Linux and macOS. Just want to make sure that the KL82Z will also work on both operating systems.

0 Kudos
Reply
17 Replies

12,917 Views
CarlosGarabito
NXP TechSupport
NXP TechSupport

The KL82Z is recognized by both systems, just make sure you have your rules right in the udev in the case of linux.

0 Kudos
Reply

12,891 Views
ND2
Contributor III

Thank you for the confirmation.

 

Can you please share the udev settings to take care of?

 

Any specific settings to take care for macOS?

Tags (2)
0 Kudos
Reply

12,827 Views
CarlosGarabito
NXP TechSupport
NXP TechSupport

Normally, when you install MCUXpresso, these rules are added in the installation, I am using Ubuntu and I have no problems with this card, in the case of mac, it should be the same way as linux.

0 Kudos
Reply

12,792 Views
ND2
Contributor III

Hi @CarlosGarabito 

 

We are talking about client computers. We cannot install MCU Expresso on all computers.

 

So if you can provide us some details on the udev rules that will be great. Once we get the udev rules for Linux we will try the same on macOS as well

Tags (2)
0 Kudos
Reply

12,755 Views
ND2
Contributor III

Hello,

 

We followed your suggestion but we are not able to get the device to mount as a CCID device. The lsusb command shows that there is a USB device but not sure how it is mounted as.

We were looking for something like a guide like this

https://community.nxp.com/t5/NFC-Knowledge-Base/How-to-Use-Linux-CCID-driver-for-PN7462-DEMO-Board/t...

Can you provide the same to us?

Or tell us what changes are to be made to the udev rules file please?

 

0 Kudos
Reply

12,663 Views
CarlosGarabito
NXP TechSupport
NXP TechSupport

Did you have a 99-jlink.rules on /etc/udev/rules.d/?

0 Kudos
Reply

12,640 Views
ND2
Contributor III

Yes we looked at the 99-jlink.rules on /etc/udev/rules.d/

 

Some properties in the file did change but the device still did not mount as a CCID device. We ran the pcscd_scan command and nothing showed up even thought we could see that the 99-jlink.rules file had some changes made.

 

Attached image shows the difference before and after the installation of MCU Expresso on ubuntu 22.04

image_2023_06_02T12_41_55_445Z.png

0 Kudos
Reply

12,586 Views
CarlosGarabito
NXP TechSupport
NXP TechSupport

The lines starting with # are comments, so no matter where they are or what they say, they do not affect the code.

 

0 Kudos
Reply

12,580 Views
CarlosGarabito
NXP TechSupport
NXP TechSupport

Maybe you need to add the sample on the board first, and then, can works on CCID mode.

SDK_2_5_0_TWR-KL82Z72M\boards\twrkl82z72m\usb_examples\usb_device_ccid_smart_card\bm

CarlosGarabito_0-1686584639832.png

 

 

0 Kudos
Reply

12,573 Views
ND2
Contributor III

Dear @CarlosGarabito 

 

We have already loaded the suggested code on the board. The controller gets mounted as a USB device but just not as a CCID device. We also saw the link regarding the MK64 and none of the attachments are now available. The links on them seem to be broken.

 

Please advice on the next steps.

0 Kudos
Reply

12,579 Views
CarlosGarabito
NXP TechSupport
NXP TechSupport
0 Kudos
Reply

12,583 Views
ND2
Contributor III

Hello @CarlosGarabito 

 

Those were the only changes we saw in the document.

 

Can you please now point out what changes should be made in Linux as well as on the macOS to get the KL82 to get recognised as a CCID device please?

IF changes are to be made to the udev rules can you please provide the changes that need to be made so that we can make those and proceed forward with the rest of the development?

Your prompt response will be highly appreciated

0 Kudos
Reply

12,541 Views
CarlosGarabito
NXP TechSupport
NXP TechSupport

There are no more changes in the rules.d, rather, could you tell me what and how you are doing for the CCID usage? Are you connecting directly to the USB? Or are you using some additional hardware, did you put the CCID example on the card? Anything additional to what is mentioned in this tread may help.

Although it is not from the card, maybe this Knowledge base page can help you a little more.

https://community.nxp.com/t5/NFC-Knowledge-Base/Installation-of-Linux-CCID-driver-For-NFC-Reader/ta-...

0 Kudos
Reply

12,523 Views
ND2
Contributor III

Dear @CarlosGarabito 

Absolutely I can.

We have loaded the CCID code on the KL82 FRDM board and it compiled as well as got loaded without any errors. We, then, installed all packages that were mentioned on this link:

https://community.nxp.com/t5/NFC-Knowledge-Base/Installation-of-Linux-CCID-driver-For-NFC-Reader/ta-...

We connected the FRDM-KL82Z board to the Linux PC directly via the USB port and when we ran the lsusb command we are able to see the KL82 CCID device however we are then trying to load the pcsc scan command and the FRDM-KL82Z CCID device doesn't show up there.

On the same Linux PC we are able to mount and see the PN7462 development kit as suggested in the link above.

There is no smart card attached to the KL82Z during the entire testing. Such said, the PN7462 Development kit also did not have the Smart Card attached to it when we were testing that.

Hopefully this will get you better clarity on our situation.

We believe this is a challenge from some Linux driver level setting which we are missing which is possibly unique to the KL82Z and doesn't apply to the PN7462

 

0 Kudos
Reply

12,490 Views
ND2
Contributor III

Dear @CarlosGarabito 

PFA the screenshots that will showcase the fact the the KL82Z FRDM board gets mounted but doesn't show up in the pcsc_scan command.

Let me know if there is any other information we can help with.

 

0 Kudos
Reply

12,299 Views
CarlosGarabito
NXP TechSupport
NXP TechSupport

Noting down the steps here for further reference.

  1. Below are the Mandatory dependencies to run the CCID on Linux that we had to install.

# sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev

# sudo apt-get install x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z1-dev

# sudo apt-get install libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils xsltproc uuid-dev:i386 liblzo2-dev:i386

# sudo apt-get install gcc-multilib g++-multilib

# sudo apt-get install subversion

# sudo apt-get install openssh-server openssh-client

# sudo apt-get install libudev-dev

# sudo apt-get install openssl

# sudo apt-get install libssl-dev         

 

  1. Install Libusb on Linux

sudo apt-get update

sudo apt-get install libusb-1.0-0-dev

sudo apt-get install libusb-dev libusb++

 

  1. Install Pcsc Lite on Linux

sudo apt-get install libpcsclite1 libpcsclite-dev

 

  1. Install Opensc on Linux

sudo apt-get install -y opensc

 

  1. CCID Driver installation

Please refer the CCID Driver installation (Step 3 ) on the below link.

https://community.nxp.com/t5/NFC-Knowledge-Base/Installation-of-Linux-CCID-driver-For-NFC-Reader/ta-...

 

  1. Download ccid-1.4.27.tar.bz2
  2. Decompress the download
  3. Compile the package using the below steps  

./configure

Make

Sudo make install

 

  1. Add the product ID and Vendor ID of the board on the below path

/etc/libccid_Info.plist.

CarlosGarabito_0-1687972899688.png

 

 

 

CarlosGarabito_1-1687972899505.png

 

 

 

CarlosGarabito_2-1687972899531.png

 

 

 

Attaching our file for your reference.

 

  1. Install and restart the PCSC Scan tool using the below command

sudo apt install pcsc-tools

sudo systemctl restart pcscd.socket

 

  1. After the above steps by reconnecting the hardware and calling the pcsc_scan command we are able to see the below output at our end

We have used FRDM-KL27Z development board for our trials.

CarlosGarabito_3-1687972899787.png

I am informed that you have already been informed about this with a ticket, please follow the steps that my peer tell you in the ticket

 

0 Kudos
Reply

12,272 Views
ND2
Contributor III

Dear @CarlosGarabito 

 

What works for the KL27Z doesn't work for the KL82. Can you please recheck? Also, can you please share the steps for getting the KL82 to work on macOS as well?

I am aware of the ticket but there the communication was regarding the KL27Z and not KL82.

0 Kudos
Reply