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.
This commit is contained in:
Kévin Redon
2018-06-07 18:56:41 +02:00
parent 5a7c848b43
commit 7ddf46ce1c
4 changed files with 65 additions and 70 deletions

View File

@@ -54,7 +54,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
@@ -165,8 +165,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("cfg %d\n\r", simtrace_config);
TRACE_INFO("USB configuration used: %d\n\r", simtrace_config);
board_main_top();