Close

LUFA Demos

A project log for ESP8266 with True USB

Make it act as a USB disk and just copy files on it.

dehipudeʃhipu 02/25/2018 at 23:064 Comments

Today I tried to actually compile the arduino firmware for the atmega16u2, however, without much success. It seems to be written for an unspecified version of LUFA different than the current release. Rather than try to guess what version it should be, I decided to instead try the demos included with LUFA. That turned out to be remarkably simple.

All you have to do is unpack the LUFA zip file, open a terminal in the directory of one of the demos, edit the Makefile to replace "at90usb1287" with "atmega32u4", "8000000" with "16000000", and "USBKEY" with "LEONARDO", edit the sources to remove all references to joystick and instead make it spew some text constantly, and then do:

make all
avr-objcopy -j .text -j .data -O ihex VirtualSerial.elf VirtualSerial.hex
avrdude -c usbtiny -p atmega32u4 -U flash:w:VirtualSerial.hex:i

(I have and USBTiny ISP programmer connected to pins 14, 15 and 16 of the Pro Micro.) 

And it works — I get spam from the serial on the /dev/ttyACM0 device. Yay.

Sadly, I can't see any demo that would be reading from the serial, but I hope I can steal that from the Arduino firmware code.

Discussions

davedarko wrote 02/26/2018 at 08:16 point

I'd suggest buying a pro micro (clone) with a 3.3V regulator and 8MHz crystal though, so you don't need any level-shifting later..

  Are you sure? yes | no

deʃhipu wrote 02/26/2018 at 08:43 point

I know there are 3.3V pro minis, but I haven't heard about 3.3V pro micros. Got a link?

  Are you sure? yes | no

davedarko wrote 02/26/2018 at 08:56 point

easiest way to find them on any platform is looking for "pro micro 8mhz"

  Are you sure? yes | no

deʃhipu wrote 02/27/2018 at 10:55 point

Thanks, ordered!

  Are you sure? yes | no