<p>Rebased, now that <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="424588802" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11252" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11252/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11252">#11252</a> is merged.</p>
<p>I dropped my own <code>tests/periph_wdt</code> in favor of the one from <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=23060007" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/fjmolinas">@fjmolinas</a></p>
<p>However, the test will always fail:</p>
<pre><code>PASSED target time: 100.0[ms], actual_time: 127.561[ms]
PASSED target time: 500.0[ms], actual_time: 502.736[ms]
PASSED target time: 1000.0[ms], actual_time: 999.896[ms]
FAILED target time: 5000.0[ms], actual_time: 7984.307[ms]
</code></pre>
<p>The result is the same on samr21-xpro and same54-xpro.<br>
This is because the Watchdog only has 4 bits for window and period respectively.<br>
Only powers of 2 can be configured, so for 5000ms the next power of two (8192/1024Hz = 7938.48 ms) is selected.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11520?email_source=notifications&email_token=ABE7WYH5NI2UI4JTT6FWLN3QJNNUVA5CNFSM4HMRYJ3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6UQW3Y#issuecomment-531172207">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYFUM26RHMYC7V4EPKTQJNNUVANCNFSM4HMRYJ3A">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYGBR56T3QS7VCLBS43QJNNUVA5CNFSM4HMRYJ3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6UQW3Y.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11520?email_source=notifications\u0026email_token=ABE7WYH5NI2UI4JTT6FWLN3QJNNUVA5CNFSM4HMRYJ3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6UQW3Y#issuecomment-531172207",
"url": "https://github.com/RIOT-OS/RIOT/pull/11520?email_source=notifications\u0026email_token=ABE7WYH5NI2UI4JTT6FWLN3QJNNUVA5CNFSM4HMRYJ3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6UQW3Y#issuecomment-531172207",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>