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

Prevent system reset on firmware update #36

Open
jackpot51 opened this issue Mar 3, 2020 · 2 comments
Open

Prevent system reset on firmware update #36

jackpot51 opened this issue Mar 3, 2020 · 2 comments

Comments

@jackpot51
Copy link
Member

No description provided.

@MilesBHuff
Copy link

This would be great. As it is now, any IO is brutally interrupted. A smart user isn't likely to knowingly be doing important IO while flashing their EC; nevertheless, it's better safe than sorry, and the current instant-off that happens is definitely not ideal.

@crawfxrd
Copy link
Member

crawfxrd commented Jul 15, 2024

System reset due to WDT timeout is unavoidable, and is in fact desired behavior.

The problem is using WDT timeout to restart the EC after a firmware update. Preferably, the EC moves from Scratch ROM back to main app without triggering an EC reset.

  • Host signals to EC to enter Scratch ROM before starting flash
  • EC performs minimal operations while waiting for flash to complete
  • Host signals to EC to exit Scratch ROM after finishing flash
  • EC disables host writing to flash and jumps to main app, exiting scratch ROM
  • EC detects that this "soft reset" has occurred and performs any additional required logic
  • EC operations continue normally

Some questions about this:

  • What should the EC actually be doing while in Scratch ROM?
  • Can we jump to main()? Is it possible to even know where main() is?
  • If not, can we jump to the reset vector? Will whatever SDCC injects there before jumping to main() cause issues?
  • What are the differences in initialization between EC reset and this "soft reset"?
  • What state is lost and would have to be reacquired?
  • Does state stored in RAM need to be declared at fixed addresses?
  • What integration with system firmware would be required?

@crawfxrd crawfxrd changed the title Prevent system reset on EC reset Prevent system reset on firmware update Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants