arduino / arduino/ArduinoCore-megaavr
[Technical Question] USB passthrough possible with custom firmware?
- Dominant language
- C++
- Stars
- 111
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
So I'm wondering about the feasibility of this idea for a while now, and I thought I could ask here to get some facts straight.
If I understood this correctly, the Arduino Nano Every has 2 "arduino-compatible" chips on it, right?
The ATMega4809 (main chip) and the ATSAMD11D14A which is used to reprogram the former, whenever new software is flashed onto the board.
To ensure communication can happen through the serial interface to an attached computer, both chips continue to communicate over a serial connection with each other if I understand this part of the code correctly:
https://github.com/arduino/ArduinoCore-megaavr/blob/8e89372cc6ff183c0d97c4d5e4feceb09de03088/firmwares/MuxTO/MuxTO.ino#L72-L90
Only the ATSAMD11D14A has native USB support, and if I understand the datasheet correctly USB communication works by writing to the correct registers and letting the hardware handle the rest. (Maybe oversimplified?)
So is there anything that would speak against extending the MuxTO firmware for the ATSAMD11D14A to allow the serial interface to use some sort of protocol that allows the ATMega4809 to write data into those registers?
It would obviously introduce some overhead, but on the other hand it would allow people to use their Nano Every as a proper USB device, with some limitations.
Is there any fundamental flaw I'm missing here? Or is it just something that nobody bothered doing so far? Also I'm not sure how exactly arduinos communicate with a PC over USB by default, so maybe there is no way to still flash new software using the IDE or CLI after changing the firmware?
I'd be happy if you could grant me any insights on this topic, for now I'm just really curious.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with firmwares/MuxTO/MuxTO.ino, particularly the serial communication code linked in lines 72-90, and review the Arduino Nano Every's ATmega4809 and ATSAMD11D14A USB capabilities. Determine whether a protocol could expose USB functionality through the serial link while preserving IDE or CLI flashing; the issue currently provides no defined implementation scope or acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100