Switching to config 1 and 2 works, but to 3 and 4 usb_enum.py is
hanging for some reason. Switching the USB config from Sniffer to
CCID reader was not tested yet.
It is possible to use sniffer.py to sniff the phone-simcard-communication.
To be fixed: The buffer size read is fixed and the data is only send
over USB if the buffer max length is reached. which means we don not
get the last bytes of the transaction.
This should be changed in one of the next commits. Maybe the former
simtrace code can give some inspiration on this topic.
In the standard atmel lib only one configuration was possible.
On a GETDESCRIPTOR request the board would always return the full buffer
with both configurations.
The USB driver requests each configuration one after another, using the
configuration index number.
The atmel lib did not support more than one USB configuration.
But only when you program the chip. At some point it stops printing
the received bytes because the interrupt is not triggered anymore.
I do not know yet how and why this happens.
Even after restarting the board this state is maintained.
CLK_SIM, I/O_SIM, CLK_PHONE, I/O_PHONE: Each of these lines connect
two pins of the microcontroller. Therefore they should NEVER be
configured as output line simultaneously. Otherwise the uC might get
destroyed.
Serial smartcard reader sends data which should be processed.
In the USART1 IRQ a status variable is set to show that data has
arrived, which should be checked for in the main function.
The second argument for PIO_Configure is the list size,
which can be determined using the macro PIO_LISTSIZE.
You should pass the list (which is an array of pins) to it.
Refrain from passing the ADDRESS of the list to it, otherwise
the pin configuration is never applied and you find yourself
debugging for 3 days.
In other words:
It's working, don't touch it or it will break again!
For now the inttypes.h of the development computer is used.
Which is a bad state. The reason is
It should be fixed by creating a stdint.h in the Baselib, which
defines types like uint32_t, etc., or by entirely replacing the Baselibs
with the newlib.