Newer
Older
TTXS - A CCID firmware implementation
What's this?
============
This is an implementation of firmware for smartcard reader. It uses
standard USB CCID protocol. It also can run with serial line instead
of USB.
The protocol for serial line is unfortunately not standardized. In
this implementation, it follows the protocol of Microchip's
SEC1110/SEC1210.
Building the firmware
=====================
For ST Nucleo L432 on USB
-------------------------
$ cd src
$ ./configure --enable-usb
$ make
For ST Nucleo F103 on serial line
---------------------------------
$ ./configure --enable-serial --target=ST_NUCLEO_F103
For ST Nucleo L432
------------------
Here is an example using OpenOCD.
$ openocd -f interface/stlink-v2-1.cfg -f target/stm32l4x.cfg \
-c "program build/ttxs.elf verify reset exit"
For ST Nucleo F103
------------------
$ openocd -f interface/stlink-v2-1.cfg -f target/stm32f1x.cfg \
-c "program build/ttxs.elf verify reset exit"
============= /etc/reader.conf.d/libccidtwin
FRIENDLYNAME "TTXS serial"
LIBPATH /usr/lib/pcsc/drivers/serial/libccidtwin.so
=============
# LIBCCID_ifdLogLevel=0xffff pcscd -f --debug
When test without pcscd:
# stty -F /dev/ttyACM0 raw cstopb -parenb cs8 115200
In my Debian system, I put this lines to the file
/etc/udev/rules.d/61-ttxs.rules:
===============================
SUBSYSTEM=="usb", ATTR{idVendor}="234b", ATTR{idProduct}=="0005", MODE="664", \
ENV{ID_SMARTCARD_READER}="1", ENV{ID_SMARTCARD_READER_DRIVER}="gnupg"
===============================
This software is only tested against OpenPGP card.
OpenPGP card ATR is:
3b ; TS
da ; T0 : TA1 TC1 TD1 available, historycal bytes = 10-byte long
18 ; TA1 : F = 372 (max 5MHz), D = 8
ff ; TC1 : guard time = 1 etu for T=1, 2 etu for T=0
b1 ; TD2 : TA3, TB3, TD3 available, T=1
fe ; TA3 : IFSC = 254
75 ; TB3 : BWI = 7, CWI = 5
1f ; TD3 : TA4 available, T=15
03 ; TA4 : 3.3V and 5V, no clock stopping
00 31 f5 73 c0 01 60 00 90 00; historycal bytes
1c ; check byte
Absence of TA2 means, it is in the "negotiable mode" to accept a PTS
(Protocol Type Selection) command.