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

Adding CAN-FD bootloader support as well? #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dgrnbrg
Copy link

@dgrnbrg dgrnbrg commented Sep 13, 2021

Hello, I was hoping to ask you a question about how this bootloader works. I have a project that I'd like to be able to program via a USB port as well as over CAN-FD when it's built into a robot. I found your fork of this DFU bootloader which supports the SAMD51--my project uses the SAME51, which I think is identical except for the added CAN-FD hardware. I wanted to see if you think that this structure (essentially polling for CAN & USB alternatingly) would work.

Do you think this is the best way to insert another hardware programming protocol?

Thank you!

@CraigHutchinson
Copy link

HI @dgrnbrg . You are correct, the 'E' variant is the same as the 'D' but adds Ethernet And/or CAN. Fundamentally the code does need a good set of clean-up and its very much resolving around USB.

I don't feel you really want to perform both USB+CAN at the same time as that sounds like a recipe for easily bricking a device i.e. If I started DFU on both USB and CAN at the same time, or triggered a USB reset during a FW update etc.
Ideally, I'd think you'd want to have an initial Idle state that that has both busses enabled and then sets the appropriate mode once a connection on either is started. In this manner activity on another bus cannot interfere with the important firmware upload process.:

  1. Idle - USB + CAN enabled
  • awaiting initial request, enter state 2 or 3 accordingly
  1. USB DFU
  • CAN disabled
  • Returns to Idle on complete
  1. CAN DFU
  • USB disabled
  • Returns to Idle on complete

As CAN is completely out of scope for our work I cannot help there but if You find bugs/issues in the existing code we are happy to assist in those parts as to mutually benefit us both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants