- Notifications
You must be signed in to change notification settings - Fork5
mmoskal/uf2-uno
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This projects allows flashing of Arduino UNO R3 via USB Mass Storage(i.e., file copy or drag and drop without needed to install any software).
It implements it in firmware of the ATmega16u2 - the USB interface chipon the Arduino UNO. This firmware in turn talks to theoptiboot
bootloaderrunning on the main ATmega328p chip.
The mass storage interface accepts files inUF2format. The new format (i.e., not.hex
and not.bin
) is necessary to implementa reliable mass storage flashing in the 512 bytes of RAM of the ATmega. The UF2 repositorycontains some conversion tools, and recent PXT versions havepxt hex2uf2
command.
There's now ablog post up about how itworks and how it came about.
$ git clone https://github.com/abcminiuser/lufa lufa$ cd lufa/Projects$ git clone https://github.com/mmoskal/uf2-uno$ cd uf2-uno$ make
I'm using LUFA170418
right now. You need to haveavr-gcc
etc inPATH
.I'm using 4.9.
Check outbinary releases.
- place the ATmega in DFU update mode by shorting two pins sticking out closest to the USB plug
- under macOS or Linux install
dfu-programer
and runmake burn
- under Windows useAtmel FLIP
Arduino providesmore detailed instructions.
Note: this bootloader is not currently compatible with Arduino IDE. If you wantthat, go back to the original bootloader (also following the instructions from the Arduinopage above).
The firmware exposes a custom raw HID interface, implementing a small subset ofHF2 protocol, in particularthe serial-forwarding parts. The serial can be accessed using the C-baseduf2tool
or usingPXT command line.
On the Arduino side you have to useSerial.init(115200);
insetup()
,and not any other baud rate.
MIT
This code is based on the Mass Storage example fromLUFA,has a few lines and the RingBuffer from theArduino USBSERIAL firmware,and lifts some code from theSAMD21 UF2 Bootloader.All these are MIT licensed.
About
USB Mass Storage bootloader for Arduino UNO R3 with ATmega16U2