Hello.
I am interested whether “serial_tx_rx” works for CW Husky to work with the smart card in the half duplex mode.
The FPGA UART module can be configured as
target.ser.cwlite_usart.init(baud=19200, stopbits=2, parity="even") and it works fine. I am able to get an ATR.
The unclear thing is whether below parameters works as I expect - to work in the half duplex mode to send and receive APDU messages.
scope.clock.clkgen_freq = 7142857
scope.io.hs2 = 'clkgen'
scope.io.target_pwr = True
scope.io.tio3 = "serial_tx_rx"
scope.io.tio1 = "high_z"
scope.io.tio2 = "high_z"
I definitely able to receive data (ATR response) but I am not sure whether data can be transmitted to the smart card side (the card doesn’t respond on the message to be sent). The only TX echo is received.
So my question is whether “serial_tx_rx” configures Husky’s FPGA to use a single wire SC_IO to talk with the card or my understanding of serial_tx_rx is incorrect? Or this functionality is just broken?
More likely serial_tx_rx doesn’t implement open drain which causes collisions on the IO line. The echo bytes are slightly damaged and one byte is missed. So the card just wait for the data and doesn’t respond.
Thanks for noting this. While we considered smart card support a long time ago, we decided against it.
We forgot to remove the serial_tx_rx option from the API – it’s never actually been supported by any of the capture hardware (Lite/Pro/Husky). I’ve removed it now.
Thanks for the feedback.
One more question. What is the simple and reliable option to measure the smart card processing time in terms of internal Husky’s measurement unit (I guess the “trig_count“ value)?
Suppose I want to measure the “smart card processing“ interval [ APDU message … 55 AA ] [ smart card processing ] [ status word 90 00 ]. Do I need to setup the UART trigger for the 55 AA pattern first and then to use the arm and capture functionality? If so, how to stop counting of the “trig_count” on getting the start bit of the first status word byte?
scope.adc.trig_count only counts how many cycles the trigger line is high, which is only really useful when using scope.trigger.module = “basic”.
The UART trigger is like any other trigger: you arm the scope, and the trigger (whether UART or whatever else) triggers the capture.
It’s not clear what you’re trying to do, but Husky doesn’t have the ability to count cycles starting from a UART trigger event.