Hey Todd,
I've been testing it, thanks!
I see the place to fix it in the 1.0 (beta) USBCore.cpp, at least I think that's it:
" if ((u8)setup.wLength < desc_length) // bit of a cheat limiting to 255 bytes TODO (saved 8 bytes)
desc_length = (u8)setup.wLength; "
Backing up a bit, I've spent the holidays and last few weeks on and off in testing and design of a 32U4 breakout board which is a special giveaway for 600 happy attendees next week at the big open source developers conference here, linux.conf.au 2012
So I've tried the beta 1.0 bootloader on both the Adafruit 32U4 breakout board, and our one which is just a little smaller but plugs straight into the PC USB port like a memory stick.
Since they're pretty much a 32U4 MCU and not much else they all work the same as each other so far!
So far I've tried ubuntu 11.04, OSX 10.5 Leopard, Windows XP, Windows 7 32 bit and two Windows 7 64 bit machines (one no service pack, one SP1). All seemed fine except for Windows 7 64 bit.
Ubuntu 11.04 had a couple of kernel panics on insertion early on but they disappeared and haven't come back, not sure what that was.
The main issue is the driver/bootloader combination seems to blow up on Windows 7 64 bit, and I assume on other 64 bit OS's.
On my Windows 7 64 bit PC, it really predictably throws a blue screen of death (BSOD) of BAD_POOL_CALLER either at the end of the first driver installation process, or after that, if the board is simply plugged in.
I've done sooo many hours of troubleshooting so far, and inspected the device loading and enumeration logs, (setupapi.dev.log) and compared it to other successful installs of other boards, tweaked files, rolled back registry entries, and it seems to be either something to do with the song-and-dance that the bootloader does first, then sketch separately does seconds after with its USB enumeration and feature declarations, or maybe some issue with the new MI_00 multi-instance option at the end of the definition. Or a couple of other candidates I've written more notes on at home.
I must setup a test PC so I'm not doing this to my main computer
Now this is weird:
The "255+" fixed bootloader that you made actually makes my Win7 64 bit PC's BSOD more.
Whereas the original 'beta' bootloader from 1.0 can go maybe 10-20 inserts before it triggers the crash.
Maybe it's because the other error is gone, I'm going to go back and test some more on Windows 7 32 bit for you specifically about the Error 10 (device cannot start) comparison.
Also, the board is much less likely to BSOD Windows if the board has a sketch loaded on it.
If it's never had a sketch loaded on it, the bootloader is the only thing in the flash and the only item to enumerate and maintain the USB COM port connection in Windows. For some reason the bootloader by itself like this is much more likely to trigger the BSOD crash.
* Note, the bootloader and sketch handle USB separately, they both have separate handlers built into their application.
If there is a sketch loaded, the bootloader jumps to the sketch pretty fast, and the driver enumeration from there for that seems to go much smoother.
In fact what happens in Windows is if the board has *always* had a sketch loaded first; you never get a chance to load the driver (.inf file) for the bootloader side as it disappears fast. However the sketch is then handling USB after seems to work out to be a bit more stable at the moment.
This type of crash is supposedly a low level hardware/driver issue, so I reckon they're already on top of this.
So we are deliberately giving away these boards for linux.conf.au with a sketch loaded, so with any luck the beta/bootloader side of USB handling shouldn't be as much of an issue at the moment.
Still to chase down is clearing out my PC's remembered COM port attachments, I'm a bit sus on those as there was an earlier time where for the first 30-40 inserts into my laptop with the beta 1.0 bootloader went fine.
Anyway hope this helps out!
I'm going to see who to get in touch with and support more testing too, I'm up to my ears in PC's and 32U4 boards at the moment so it's a good time
Cheers,
Marc