New version of Caterina bootloader

Posting this in the hopes that others may find it useful.

I've developed a modified version of the Caterina bootloader and made it publicly available on github (link below). Just to change the name a bit, it is called Katiana instead of Caterina.

What drove me to do this was frustration with COM port numbering for Atmel MCUs with built-in USB peripherals. On Windows at least, these things are assigned a COM port based solely on where you plug it in. Move it to another USB port, you get a different COM port number. That's because the bootloader and sketch don't report any serial numbers.

Well, I fixed that and found a way for the sketch to enumerate with the same serial number as bootloader w/o having to manually put that into every sketch. Now each physical board shows up with the same COM port number, regardless of which physical USB port it's plugged into. Katiana fits easily in the same 4kB boot sector that Caterina occupied.

There are many other changes, all of which are described in the (overly verbose) documentation, here:

I am using this now on an ATmega32U4. It should work with other MCUs with up to 128kB flash, but there's been zero testing of that. I'm sure there are some issues there and it should be considered a work in progress in that area; let me know if you find any and I'll try to incorporate fixes.

License is BSD, very similar to what Caterina has.

No promises, but I'll try to respond to any issues and pull requests that might pop up.

Again, I hope someone else finds this useful -- either by itself, or as a jumping off point to a different destination.


HI , this is a great work, We really needed something like that, however it is not compiling
here is the error can you tell me what is going on -i am trying to compile on unbunt 16.04.

Descriptor. error : variably modified "sramserialstring ’ at file scope "
stati unit8_t SramSerialString{Sizeof(USB_stdDescriptor_Header_T) + (strlen(usb_HDWR_SERIAL_<< 1)+2 ] ;

static uint8_t SramSerialString[ sizeof( USB_StdDescriptor_Header_t ) + (strlen(USB_HDWR_SERIAL) << 1) + 2 ];

Yeah, it doesn’t look like the compiler version you’re looking at likes being asked to call strlen() at compile time to figure out the length of the sting. A previous version might have been more lenient?
Try changing that line (in Descriptors.c) to be

static uint8_t SramSerialString[ sizeof( USB_StdDescriptor_Header_t ) + (2*sizeof(USB_HDWR_SERIAL)) ];

Just a question. How does this behave if one connects multiple 32U4 boards?

ALso the INF file is not working, it keep giving a message saying drive not compatible with X64 system

Hello. Was anyone able to compile it? Me not, issue here: