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

Add graceful shutdown support #623

Closed
ataffanel opened this issue Sep 24, 2020 · 0 comments · Fixed by #844
Closed

Add graceful shutdown support #623

ataffanel opened this issue Sep 24, 2020 · 0 comments · Fixed by #844

Comments

@ataffanel
Copy link
Member

Currently to shut-down the Crazyflie, the nRF51 simply cut the power to the system. This was working fine until we started implementing SD-card functionality: when shutting down the system that way we have huge chances of corrupting the SD-card filesystem. This has lead to implementation of very inefficient sd-car logging procedure to decrease the probability of corruption.

A better solution for the shutdown problem would be to implement a graceful shutdown in the system:

  • When the nRF51 wants to shutdown the system (ie. after a button press), it sends a message to the stm32 requesting shutdown.
  • In the stm32, modules that wants to be notified of shutdown are called in sequence and return when they are ready for shutdown
  • When all the module have returned, the stm32 sends to the nRF51 a "ready for shutdown" message
  • The nRF51 cuts the power. If no "ready to shutdown" was received after a timeout, the power is cut anyway.

This will for now only be used for the SD-card, but it could be useful for other part of the system as well in the future.

@ataffanel ataffanel added this to the next-release milestone Sep 24, 2020
@krichardsson krichardsson removed this from the next-release milestone Jan 25, 2021
jonasdn added a commit that referenced this issue Sep 3, 2021
Currently to shut-down the Crazyflie, the nRF51 simply cut the power
to thae system. This was working fine until we started implementing
SD-card functionality: when shutting down the system that way we have
huge chances of corrupting the SD-card filesystem. This has lead to
implementation of very inefficient sd-car logging procedure to decrease
the probability of corruption.

A better solution for the shutdown problem would be to implement a
graceful shutdown in the system ...

  ... when the nRF51 wants to shutdown the system (ie. after a button
      press), it sends a message to the stm32 requesting shutdown

  ... in the stm32, modules that wants to be notified of shutdown are
      called in sequence and return when they are ready for shutdown

  ... when all the module have returned, the stm32 sends to the nRF51 a
      "ready for shutdown" message

  ... the nRF51 cuts the power. If no "ready to shutdown" was received
      after a timeout, the power is cut anyway

Closes #623
jonasdn added a commit that referenced this issue Sep 3, 2021
Currently to shut-down the Crazyflie, the nRF51 simply cut the power
to thae system. This was working fine until we started implementing
SD-card functionality: when shutting down the system that way we have
huge chances of corrupting the SD-card filesystem. This has lead to
implementation of very inefficient sd-car logging procedure to decrease
the probability of corruption.

A better solution for the shutdown problem would be to implement a
graceful shutdown in the system ...

  ... when the nRF51 wants to shutdown the system (ie. after a button
      press), it sends a message to the stm32 requesting shutdown

  ... in the stm32, modules that wants to be notified of shutdown are
      called in sequence and return when they are ready for shutdown

  ... when all the module have returned, the stm32 sends to the nRF51 a
      "ready for shutdown" message

  ... the nRF51 cuts the power. If no "ready to shutdown" was received
      after a timeout, the power is cut anyway

Closes #623
jonasdn added a commit that referenced this issue Sep 3, 2021
Currently to shut-down the Crazyflie, the nRF51 simply cut the power
to thae system. This was working fine until we started implementing
SD-card functionality: when shutting down the system that way we have
huge chances of corrupting the SD-card filesystem. This has lead to
implementation of very inefficient sd-car logging procedure to decrease
the probability of corruption.

A better solution for the shutdown problem would be to implement a
graceful shutdown in the system ...

  ... when the nRF51 wants to shutdown the system (ie. after a button
      press), it sends a message to the stm32 requesting shutdown

  ... in the stm32, modules that wants to be notified of shutdown are
      called in sequence and return when they are ready for shutdown

  ... when all the module have returned, the stm32 sends to the nRF51 a
      "ready for shutdown" message

  ... the nRF51 cuts the power. If no "ready to shutdown" was received
      after a timeout, the power is cut anyway

Closes #623
jonasdn added a commit that referenced this issue Sep 8, 2021
Currently to shut-down the Crazyflie, the nRF51 simply cut the power
to thae system. This was working fine until we started implementing
SD-card functionality: when shutting down the system that way we have
huge chances of corrupting the SD-card filesystem. This has lead to
implementation of very inefficient sd-car logging procedure to decrease
the probability of corruption.

A better solution for the shutdown problem would be to implement a
graceful shutdown in the system ...

  ... when the nRF51 wants to shutdown the system (ie. after a button
      press), it sends a message to the stm32 requesting shutdown

  ... in the stm32, modules that wants to be notified of shutdown are
      called in sequence and return when they are ready for shutdown

  ... when all the module have returned, the stm32 sends to the nRF51 a
      "ready for shutdown" message

  ... the nRF51 cuts the power. If no "ready to shutdown" was received
      after a timeout, the power is cut anyway

Closes #623
cafeciaojoe pushed a commit to cafeciaojoe/crazyflie-firmware that referenced this issue Sep 27, 2024
hide labels based on basestation availability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants