Kévin Redon
c9bd715289
sniffing: fix procedure byte handling and make TPDU parsing more strict
...
Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f
2018-07-04 17:55:20 +02:00
Kévin Redon
35e8bdf879
sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU)
...
Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a
2018-07-04 17:55:20 +02:00
Kévin Redon
709a431ab9
sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture
...
Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961
2018-07-04 17:55:20 +02:00
Kévin Redon
30f90a78fc
console: drop data to be send when buffer is already full
...
don't wait for space to be available in the buffer since since would
prevent from processing non-console (e.g. debug) more important data
Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28
2018-07-04 17:10:08 +02:00
Kévin Redon
7406337a7f
sniffer: display F and D values frim PPS
...
Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0
2018-07-04 17:10:08 +02:00
Kévin Redon
6e3f1121e6
host USB: add host application to receive and display USB sniffing messages sent by firmware
...
Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d
2018-07-04 17:10:08 +02:00
Kévin Redon
de97fd25bd
sniffer USB: implement USB communication and send parsed messages
...
Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b
2018-07-04 17:10:08 +02:00
Kévin Redon
012940f48e
USB device: add USB message structure for sniffer communication
...
Change-Id: Id2c6f32ade2fec9b9ef91bd8c5e1fd195f2d7351
2018-07-04 17:10:08 +02:00
Kévin Redon
e2f84f6a8b
host USB: use central SIMtrace USB ID definition header
...
Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9
2018-07-04 17:10:08 +02:00
Kévin Redon
4d6a4b949c
host usb_util fix: used provided class, sub-class, and interfave when finding matching interfaces
...
Change-Id: Ibc06e751e6ca0f9e9a40d82c4eeddfb975240f91
2018-07-04 17:10:08 +02:00
Kévin Redon
a1012b170a
USB: add central file to define USB IDs, classes, and endpoints
...
Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f
2018-07-04 17:10:06 +02:00
Kévin Redon
42bd026416
minor: fix typos in comment
...
Change-Id: I01b49e047a586dff449d4e134751108e391a8822
2018-07-04 16:33:00 +02:00
Kévin Redon
638cec820f
sniff: add WT timeout detection using USART timeout (TC is not required)
...
Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c
2018-07-04 16:33:00 +02:00
Kévin Redon
00ec89d73f
sniff: add TPDU parsing (TPDUs become APDUs on the upper layer)
...
Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347
2018-07-04 16:33:00 +02:00
Kévin Redon
cf59919494
sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed)
...
Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e
2018-07-04 16:33:00 +02:00
Kévin Redon
11914d9658
LED: add short LED pulse blinking pattern
...
Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447
2018-07-04 16:32:54 +02:00
Kévin Redon
3113e3d2e5
update_fidi: remove debug output since this function is called in time critical ISR
...
Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559
2018-07-04 14:29:28 +02:00
Kévin Redon
9def7631ba
DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity
...
Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb
2018-07-04 14:29:28 +02:00
Kévin Redon
ca9e4bf4ba
board: fix LED pin definition
...
Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db
2018-07-04 14:29:28 +02:00
Kévin Redon
8210ec3f62
DFU: remove force bootloader button debug message since the console is output message is not initialized yet
...
Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a
2018-07-04 14:29:28 +02:00
Kévin Redon
8fa6ff5979
sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update
...
Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922
2018-07-04 14:29:28 +02:00
Kévin Redon
866d20b10e
trace: increase watchdog for 500 to 2000 ms to provide more time handling buffered data
...
Change-Id: Iacd85525f05e692b44183bd4c4585b9e70865cfe
2018-07-04 14:29:28 +02:00
Kévin Redon
4fe99fad59
ISO7816: change update_fidi to use provided USART
...
Also disables write protection for USART register if required
Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98
2018-07-04 14:29:28 +02:00
Kévin Redon
7be52ec1ce
SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the sniffer ISO state
...
Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5
2018-07-04 14:29:28 +02:00
Kévin Redon
a2b367633c
SIMtrace: fix default SIM_RST pin state to allow phone controlled reset
...
Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654
2018-07-04 14:29:28 +02:00
Kévin Redon
927ffb46eb
SIMtrace: only enable main sniffing mode on SIMtrace board
...
Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b
2018-07-04 14:29:28 +02:00
Kévin Redon
d7a6de57d2
sniffer: add state definitions, improve IRQ handling, update pins configuration
...
Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5
2018-07-04 14:29:27 +02:00
Kévin Redon
353351ddf4
simtrace: add support for sniffing on both USART
...
Change-Id: I69eb458e7cb186c990e5d6fbc780f37fdd0cd884
2018-07-04 14:28:19 +02:00
Kévin Redon
4091d78c4b
board: comment USART definitions and add corresponding IRQ numbers
...
Change-Id: I3c38e7d75bc7b511827c33af69e335e50d0b35d2
2018-07-04 14:28:19 +02:00
Kévin Redon
ee62a9da56
simtrace: add dedicated power pins configuration for sniffing
...
Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39
2018-07-04 14:28:17 +02:00
Kévin Redon
45ad62d8d4
sniff: use USART 0 instead of USART 1
...
Use USART 0 connected to the SIM card side to sniff the communication.
The card side can also measure ETU times.
Do proper pin initialization.
This code can already capture the ATR communication between phone and card.
Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6
2018-07-04 11:24:13 +00:00
Kévin Redon
2c4e2af21f
SIMtrace board: comment and fix pin definition
...
Change-Id: Ic77ad5bf6c00c9122c6bb0e12b90e6c5406855fd
2018-07-04 11:24:13 +00:00
Kévin Redon
7b73462442
sniff mode: handle USART 1 RX interrupt to show sniffer data
...
Change-Id: I5504369aed39844b7cf21e5b3ccb542daa6b946e
2018-07-04 11:24:13 +00:00
Kévin Redon
36abece0b1
enable (empty) sniffer support for SIMtrace board
...
Change-Id: I51619135fd6f5423542f261e7d76bab1a5713e2b
2018-07-04 11:24:13 +00:00
Kévin Redon
f9997e9d26
copy working cardem app to trace
...
because the applications share the board capabilities defined in
libboard/*/include/board.h and USB configurations are enabled according
to the previously defined capabilities in libcommon/source.usb.c, all
applications actually offer the same functions.
thus creating the trace application is only mainly a cosmetic change, as the
sniffer function will also be present and enabled in the cardem application.
Change-Id: I24b3500a0905cbd622507722280b3c7e7f188bde
2018-07-04 11:24:13 +00:00
Kévin Redon
a9bca48914
ring buffer: increase buffer size from 128 to 256 to cope with large debug output
2018-06-29 20:07:31 +02:00
Kévin Redon
eac1bec428
console: use buffer and interrupts instead of busy loops for UART debug output
2018-06-29 20:07:31 +02:00
Kévin Redon
51c128bc35
DFU: fix typo in USB strings
2018-06-29 20:07:31 +02:00
Kévin Redon
869dbfafe4
DFU: incread watchdog timeout and restart watchdog before writing in flash to prevent the watchdog to trigger while flashing
2018-06-29 20:07:31 +02:00
Kévin Redon
80303c135b
DFU: only boot the application if it has a valid start
2018-06-29 20:07:31 +02:00
Kévin Redon
d86cab0080
DFU: uncomment print message when DFU is forced using the button
2018-06-29 20:07:31 +02:00
Kévin Redon
b73f0a00bc
DFU: unlock the flash before writing, verify written data, and relock it
2018-06-29 20:07:31 +02:00
Kévin Redon
f5869d4a59
USB: implement USB reset by setting the on-board pull-up on D+ low
2018-06-29 20:07:31 +02:00
Kévin Redon
4136c242a8
USBD: send empty packet when non-existing descriptor string is requested
...
Sometimes descriptor string 0xee is requested.
This is a mechanism used by Microsoft Windows to further identify the USB device.
Instead of stalling, as is the original code, leading to an USB reset, we send an empty packet.
I am not sure if sending an empty string would be better, but an empty packet seems sufficient.
2018-06-29 20:07:31 +02:00
Kévin Redon
318309f30f
dfu: fix address destination check and add stack overwrite check in USBDFU_handle_dnload
...
During DFU download the destination start address is checked to not exceed the
RAM or flash end address, but it is also necessary to check if the end of the
data to be downloaded is also within the allowed range.
When downloading to RAM it is also necessary to check if the data to be
downloaded does not overwrite (i.e. corrupt) the stack.
2018-06-29 20:07:31 +02:00
Kévin Redon
0828b914e7
README: rewrite to better explain environment variables and point to the wiki for flashing
2018-06-29 20:07:31 +02:00
Kévin Redon
76be7c806e
fix pointer casting warning
...
fixes following warning:
libboard/common/source/board_cstartup_gnu.c:137:11: warning: assignment to 'void (*)(void)' from 'unsigned int' makes pointer from integer without a cast [-Wint-conversion]
appReset = pSrc[1];
2018-06-29 20:07:31 +02:00
Kévin Redon
a38a126361
fix: initialize uninitialized variable in USBDFU_DFU_RequestHandler
2018-06-29 20:07:31 +02:00
Kévin Redon
6822716428
add printf attribute declaration to remove warning
...
the __attribute__ ((format (printf, 1, 0))) declaration remove the following
compilation warning:
warning: function 'osmo_panic' might be a candidate for 'gnu_printf' format
attribute [-Wsuggest-attribute=format]
osmo_panic_default(fmt, args);
2018-05-21 17:18:58 +02:00
Kévin Redon
a93f7273b3
fix: remove duplicate volatile declaration
2018-05-21 17:17:20 +02:00
Kévin Redon
432ba5140e
add copyright notice
...
The original board startup script is provided by Atmel.
It has been modified to handle application or DFU booting.
The copyright notice has been updated to reflect this change.
2018-05-21 17:13:50 +02:00