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

Grab reset flags on startup #485

Merged
merged 9 commits into from
Dec 3, 2024
Merged

Conversation

caila-marashaj
Copy link
Contributor

@caila-marashaj caila-marashaj commented Nov 22, 2024

Overview

There have been a couple of instances in abr where the thermocycler and the heater-shaker's firmware have unexpectedly restarted. Since the reason this happened isn't obvious, let's grab the HAL's provided reset flags, and give the modules the ability to ask for them.

According to the internet, this value needs to be grabbed as soon as possible into hardware initialization. So, this code saves it to a public variable inside motor_hardware_setup where it can be passed up to the usb bus whenever.

Changelog

  • create GetResetReason gcode and task messages
  • handle new messages
  • get the value of the HAL RCC flag in motor_harwdware.c
  • add the ability to pass that upward and send it in a flag over usb

TODO

  • Implement this for flex stacker and temp deck also
  • In the Python side, send a GetResetReason message on module connection and log the response
  • Add some tests in a follow-up pr

Test Plan

  • Make sure each module sends a flag containing the last reset reason in response to a M114 message (works on the thermocycler atp)

Is there any way to test/simulate reasons other than a regular power cycle to see if the values show up in the response message?

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@caila-marashaj caila-marashaj marked this pull request as ready for review December 3, 2024 16:53
@caila-marashaj caila-marashaj merged commit 0e7f28f into edge Dec 3, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants