-
-
Notifications
You must be signed in to change notification settings - Fork 80
[EV3] Implement reset via watchdog timer #343
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
Conversation
dlech
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you also plan on creating a watchdog driver for EV3 to implement pbdrv_watchdog_update()?
|
I actually didn't realize there was also a watchdog framework. I'll revisit this to take that into account. |
| // if it has already been configured. If it has *not* been configured, | ||
| // that means we are crashing in early boot, and we let the jump back | ||
| // to the reset vector take care of rebooting the system. | ||
| HWREG(SOC_TMR_1_REGS + TMR_WDTCR) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a new pbdrv_reset_reason_t for panic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need one? It currently reports as a watchdog reset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it is worth it or not. That is why I ask. 😄
There is a slight difference in that the true watchdog reset only happens if the event loops stops running while a panic is a different mode of failure. So could be potentially useful for getting info on the cause of a crash. But would anyone ever actually do that? Maybe not very likely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem too likely, since right now crash dumps aren't saved anywhere and you need to have the debug console connected to see them.
Perhaps we can change "watchdog" to a generic "fatal error"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, we'll leave it the way it is. I would prefer to stick with calling it watchdog and add a new reason if we need to differentiate.
This helps detect if the system locks up and stops running the idle loop. If the system locks up for more than 3 seconds, the system will reset.
The watchdog is the only way to reset *everything* on the AM1808. It performs the same function as a power-on reset.
This helps determine whether the system was soft-rebooted, booted from cold, or reset due to a crash.
Currently contains a compiler memory barrier and fall-through marker. These operations will be needed throughout the driver layer.
|
I rebased this and fixed the conflicts. |
Implements both resetting as well as booting into firmware update mode.
Note that the ev3dev documentation is incorrect. The correct magic flag address is 0xFFFF1FFC and not 0xFFFF1FFA.This issue has been corrected in the ev3dev documentation.