Skip to content

A way to nicely recreate usb device #6

@kanashimia

Description

@kanashimia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions