Go Down

Topic: New version of Caterina bootloader (Read 1 time) previous topic - next topic

aweatherguy

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.

http://www.github.com/aweatherguy/Katiana

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:


https://github.com/aweatherguy/Katiana/blob/master/Katiana-Bootloader.pdf


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.

Cheers,

bemin

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.

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

westfw

Code: [Select]
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


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

sterretje

Just a question. How does this behave if one connects multiple 32U4 boards?
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

bemin

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

Benik3

Hello.
Was anyone able to compile it?
Me not, issue here: https://github.com/aweatherguy/Katiana/issues/2

Go Up