mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
Bumping PMC_MAIN_OSC_STARTUP_DELAY to solve slow clock on some devices, thanks @iceman1001!
This commit is contained in:
parent
3fce47d023
commit
0877802ded
1 changed files with 4 additions and 1 deletions
|
@ -19,12 +19,15 @@ void mck_from_slck_to_pll(bool cold) {
|
|||
// worst case scenario, with MAINCK = 16MHz xtal, startup delay is 1.4ms
|
||||
// if SLCK slow clock runs at its worst case (max) frequency of 42kHz
|
||||
// max startup delay = (1.4ms*42k)/8 = 7.356 so round up to 8
|
||||
// UPDATE:
|
||||
// we observed on 10% of the devices very wrong initial slow clock RC TIA measures.
|
||||
// Bumping delay to 16 helps fixing the issue even on the most screwed RC.
|
||||
|
||||
// enable main oscillator and set startup delay if cold boot
|
||||
if (cold) {
|
||||
AT91C_BASE_PMC->PMC_MOR =
|
||||
AT91C_CKGR_MOSCEN |
|
||||
PMC_MAIN_OSC_STARTUP_DELAY(8);
|
||||
PMC_MAIN_OSC_STARTUP_DELAY(16);
|
||||
} else {
|
||||
AT91C_BASE_PMC->PMC_MOR = AT91C_CKGR_MOSCEN;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue