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
This commit is contained in:
Kévin Redon
2018-06-07 18:56:41 +02:00
committed by Harald Welte
parent 2c4e2af21f
commit 45ad62d8d4
4 changed files with 65 additions and 68 deletions

View File

@@ -36,7 +36,7 @@ static const conf_func config_func_ptrs[] = {
.init = Sniffer_init,
.exit = Sniffer_exit,
.run = Sniffer_run,
.usart1_irq = Sniffer_usart1_irq,
.usart0_irq = Sniffer_usart0_irq,
},
#endif
#ifdef HAVE_CCID
@@ -144,6 +144,7 @@ extern int main(void)
g_unique_id[0], g_unique_id[1],
g_unique_id[2], g_unique_id[3]);
TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos);
TRACE_INFO("USB configuration used: %d\n\r", simtrace_config);
board_main_top();