VID: 0x2c99 → manufacturer string: "Prusa Research (prusa3d.com)"
PID: 0x0003 → product string: "Original Prusa i3 MK3 Multi Material 2.0 upgrade (bootloader)"
PID: 0x0004 → product string: "Original Prusa i3 MK3 Multi Material 2.0 upgrade"
When the application is running, the board identifies itself with a PID 0x0004, and the MMU Control Board pops up twice in the device list: As a composite device and as a CDC (serial) device. There is no easy way to get rid of the composite device without ditching Arduino, and it is not possible to configure the serial number or version number reported to the host, as this functionality is part of the core Arduino library, and the provided PluggableUSBModule API is of limited functionality.
When the bootloader is active, the board identifies itself with a PID 0x0003, and just a single CDC (serial) device is active (no composite device, thank you). As we have full control over the USB code in the bootloader, a 20 BCD digits serial number is reported based on http://ww1.microchip.com/downloads/en/AppNotes/doc8201.pdf
Compiling the Caterina bootloader:
The current Caterina bootloader source code is available at https://github.com/bubnikv/caterina
You have to extract the LUFA USB library version 111009 into the lufa directory and run make.
When compiling on Windows, the Atmel provided GCC based tool chain is recommended: https://github.com/eerimoq/avr-toolchain-windows , as the WinAVR contains an old GCC toolchain, which optimizes purely and the resulting binary does not fit the reserved FLASH space.
Programming the Caterina bootloader:
You may try to run
make program
or type
avrdude -p atmega32u4 -P usb -c usbasp -U flash:w:Caterina.hex
FIXME: The current bootloader is part of the "Original Prusa i3 MK3 Multi Material 2.0 upgrade" board definition for Arduino, see below, but the flashing of a boot loader from Arduino does not seem to work correctly. Fix it!
bootloader built for an initial timeout of 2 resp. seconds
Installing the "Original Prusa i3 MK3 Multi Material 2.0 upgrade" board into Arduino
The "Original Prusa i3 MK3 Multi Material 2.0 upgrade" board aka "MMU Control Board" is derived from the Arduino Leonardo board. Unfortunately the USB support of the Arduino Leonardo boards is difficult to configure, and the only way to enforce own USB VID/PID identifiers is to provide a custom Arduino board definition.
The Arduino definition for our MMU Control Board is available at https://github.com/prusa3d/Arduino_Boards/ , which is heavily based on http://github.com/sparkfun/Arduino_Boards .
To get the MMU Control Board available in Arduino, one has to enter the following link into the "Additional Boards Manager URLs" of the Preferences dialog, and to install the board through the "Boards Manager".
The installation procedure is described by SparkFun in detail here:
https://github.com/sparkfun/Arduino_Boards#installation-instructions
The MMU Control Board will be then available as "Original Prusa i3 MK3 Multi Material 2.0 upgrade" from the Arduino IDE, and as PrusaResearch:avr:prusa_mm_control from the command line.
Programming the application into the MMU Control Board (on Windows):
To compile the application, execute the following command from the command line:
arduino_debug.exe --pref build.path=output --verify --board PrusaResearch:avr:prusa_mm_control -v --preserve-temp-files MM-control-01.ino
To flash the firmware, run
arduino_debug.exe --pref build.path=output --upload --port COMxx --board PrusaResearch:avr:prusa_mm_control -v --preserve-temp-files MM-control-01.ino
Debugging the USB descriptors on Windows:
The following application is useful to inspect USB descriptors:
https://www.nirsoft.net/utils/usb_devices_view.html
Programming the application into the MMU Control Board (on Linux):
If you have the modemmanager installed, you either need to deinstall it, or blacklist the Prusa Research USB devices:
/etc/udev/rules.d/99-mm.rules
# Original Prusa i3 MK3 Multi Material 2.0 upgrade
ATTRS{idVendor}=="2c99", ATTRS{idProduct}=="0003", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="2c99", ATTRS{idProduct}=="0004", ENV{ID_MM_DEVICE_IGNORE}="1"
$ sudo udevadm control --reload-rules
A request has been sent to Ubuntu, Debian and ModemManager to blacklist the whole Prusa Research VID space.
https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1781975
https://bugs.debian.org/cgi-bin/pkgreport.cgi?dist=unstable;package=modemmanager
and reported to
https://lists.freedesktop.org/archives/modemmanager-devel/2018-July/006471.html
Preliminary .inf for windows: