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

A way to nicely recreate usb device #6

Open
kanashimia opened this issue Jul 12, 2022 · 1 comment
Open

A way to nicely recreate usb device #6

kanashimia opened this issue Jul 12, 2022 · 1 comment

Comments

@kanashimia
Copy link

kanashimia commented Jul 12, 2022

Basically i have usbd-serial device in the main loop, and i want to use serial device to log errors in the panic handler.

There are two solutions for this:

  1. Make a global serial singleton.
  2. Reset the device somehow.

First one should just work, but i want to implement second one, and have encountered problems with this.

I have tried setting a static mut var in the .noinit section, similar to how lufa jumps to bootloader, to keep that variable between reboots, then have used watchdog to reset the program, and then on the start of the program checked if that variable is set do the actual panic handling, but even that doesn't work, for some unknown reason, i have to wait until PC powercycles the devices itself.

I have tried .reset() method on the bus, but that doesn't work.

I have found .force_reset() method that is currently unimplemented and i think that is what i need probably, so what i ask is for its implementation.

@agausmann
Copy link
Owner

Sorry I haven't responded to this, I have a bit of trouble understanding what you're asking.

However, force_reset has now been implemented and merged (#13), if you want to try that.

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

No branches or pull requests

2 participants