Closed ViRb3 closed 5 years ago
It looks to me that TC0 is not used or initialized yet we are waiting for it to be zeroed?
No clue if a proper fix, but the below seems to work: https://github.com/RfidResearchGroup/proxmark3/blob/a3962c16c3ef14c9c5d82755b2b36dcaea87b2f1/armsrc/hitag2.c#L742 Change to:
while (AT91C_BASE_TC1->TC_CV > 0) {}; // wait until TC1 returned to zero
And of course remove the clear at the end: https://github.com/RfidResearchGroup/proxmark3/blob/a3962c16c3ef14c9c5d82755b2b36dcaea87b2f1/armsrc/hitag2.c#L890
Clock 0 - AT91C_BASE_TC0 vs Clock 1 - AT91C_BASE_TC1
Hm, is there any more references to clock 0 in the hitag code? If no, then a change to clock1 is ok.
A quick look at it, looks like it only use clock1. Make a PR for your suggested fix :)
Wouldn't it be better if we use clock0 instead?
Don't think it does any difference. clock1 in the sniff code will do just fine.
Hitag sniff works only if it's the first command you run. If it's preceded by any other command (e.g.
lf search
) it deadlocks here forever:https://github.com/RfidResearchGroup/proxmark3/blob/a3962c16c3ef14c9c5d82755b2b36dcaea87b2f1/armsrc/hitag2.c#L742