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

Jump to bootloader from software #2

Open
stephenhensley opened this issue Nov 18, 2020 · 4 comments
Open

Jump to bootloader from software #2

stephenhensley opened this issue Nov 18, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@stephenhensley
Copy link
Collaborator

Requirements:

  • libdaisy needs a ResetToBootloader function
  • Class for initializing DaisySeed USB in CDC mode (VCOM port), and a short callback for receiving some sort of jump to bootloader message. (could be in libdaisy or in the code generator)
  • Serial Tx from Node to the Daisy to send message for reset before running make program-dfu.
@stephenhensley stephenhensley self-assigned this Nov 18, 2020
@stephenhensley stephenhensley added the enhancement New feature or request label Nov 18, 2020
@stephenhensley
Copy link
Collaborator Author

@grrrwaaa Do you know of a Serial communication library for node (or if there's any native support for connecting to USB/Virtual COM ports?). I'll probably be merging in the libdaisy function for jumping to the system bootloader. So I want to start on a plan of attack for adding it to oopsy.

The first thing that came to mind was maybe just using MIDI program change message, but A: That would require MIDI or B: would need USB MIDI to work, which is still not set up.

So unless we want to wait until USB MIDI is in place, we'll have to connect to the device via the Virtual COM port and tell it to restart. (That's the only thing I can think of that would work universally without any special consideration for the board.

We could add a UI option to the Display UIs, but that's not really much different than pushing the buttons.

Definitely interested in your thoughts.

@grrrwaaa
Copy link
Contributor

Yeah I've been followinig this addition with excitement!

Various options for serial communciation from Node.js, including some pure-javascript ones (see https://www.npmjs.com/search?q=serial%20port).
An example tutorial oriented to arduino: https://itp.nyu.edu/physcomp/labs/labs-serial-communication/lab-serial-communication-with-node-js/ --

I think that all we need to know is the address of the virtual serial port....and lots of testing ;-)

@stephenhensley
Copy link
Collaborator Author

Indeed! Thanks for sharing those links, I'll try to get a proof of concept together in the next few weeks.

One thing I foresee being an issue is detecting which "virtual serial port" belongs to the daisy. On windows, and mac they generally appear as some ambiguous name. That said, we might be able to query them based on the USB device descriptor, however the system information is a bit weird for that (at least on my machine here).

On my windows desktop I the device is recognized as "Daisy Seed Built In", but in the System Information/Device Manager, it appears as "STM32 Virtual COM Port" (possibly because of the VID in the descriptor).

So as long as we're able to reliably select the Daisy when it is connecting/reconnecting constantly then the rest should be fairly trivial. (Send message to Daisy, Daisy does reset).

@grrrwaaa
Copy link
Contributor

We had some progress on this today -- at least, the ability to jump to bootloader on receipt of MIDI reset (0xFF), as well as some preliminary progress toward sending a reset message via USB serial interface. However some current challenges in libdaisy/USB (electro-smith/libDaisy#343) need to be taken into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants