Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watchdog timer causing NMI storm #357

Open
TheMachine02 opened this issue Jun 28, 2020 · 4 comments
Open

Watchdog timer causing NMI storm #357

TheMachine02 opened this issue Jun 28, 2020 · 4 comments
Assignees
Milestone

Comments

@TheMachine02
Copy link

TheMachine02 commented Jun 28, 2020

What's wrong, and with what software version?

Operating System: Arch linux, up to date
CEmu version: latest git
Describe your issue:

I have a setup with watchdog timer at 32768Hz with a reload of 1s, set to generate NMI if count reach zero. The watchdog is periodically reset through writing to the restart register (I am writing the restart sequence byte individually), usually in the rst 38h interruption.
Randomly, CEmu execution freeze and console spew a whole load of "Watchdog NMI triggered." without watchdog count being zero (or I think, I had it occur just after the restart load). Please note that setting debugger to open to NMI works, but however stepping doesn't jump to 66h or anything and just generate new NMI without actually advancing in the code step, until randomly jumping to 66h.
It seems that the code executing just before this NMI storm occur is always a seemingly valid port writing (either mapped / or direct).

Trying to monitor port and specifically watchdog port counter 6000 make CEmu crash directly with message
" ../../core/schedule.c :137 : sched_tick: assertion « item->second >= 0 » failed"

What are the steps to reproduce this issue?

The latest git of Sorcery (https://github.com/TheMachine02/Sorcery/) reproduce this lock up in ~10 min, without touching anything

EDIT : with a bit more fiddling, I found a more consistent way to reproduce :
running above program, manually increase clock to 48Mhz, step, manually decrement to 6Mhz, step, go back and forth until it trigger NMI (in theory it shouldn't ? Port aren't zero, reading them crash with assertion until jump to rst 66 were you can read them again).

Any logs, error output, screenshot, other comments...?

It may be an issue with what I am doing, as my code is excessively prone to error and weird crash but I wasn't able to reproduce the lock up in HW.

@adriweb adriweb assigned adriweb and unassigned adriweb Jul 2, 2020
@adriweb adriweb added this to the Any version milestone Jul 2, 2020
@jacobly0
Copy link
Member

jacobly0 commented Jul 2, 2020

no u

@adriweb
Copy link
Member

adriweb commented Jul 2, 2020

(I blame misclicks due to github ui redesign)
but definitely no u

@calc84maniac
Copy link
Contributor

@TheMachine02 do you happen to know if this was fixed? And for reference, I tracked down the latest commit in your repo when this was reported: TheMachine02/Sorcery@7cf31f4

@TheMachine02
Copy link
Author

I honestly didn't try in a long time, I should spin up the latest build of CEmu to try it... When I will find time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants