i am porting a common license PWM-sample-drumbox to teensy2++ over teensyduino/teensy loader V1.51. The project reads 8bit array values from Progmem into a ringbuffer and generates audio with hardware PWM. Everything is working perfect, the code occupies about 12% of progmem, 8% ram.

Now i fill more and more program memory with these audio-sample arrays for having more audiosamples to play. From a certain point of used program memory - somewhere around 53% - i get a problem: after flashing over usb (and the rebooting display in the loader), windows loses the USB device and the project does not work anymore. I have to replug USB with the button pressed down and flash a smaller project first until the teensy2.0++ will be recognized by USB and working properly again.

To me it looks like a program occupying more than 53% starts to 'overwrite' parts of the bootloader/USB driver. Having written bootloaders myself (for flashing firmwares over UART/MIDI) i doubt the usb/flashing functionality occupies nearly 50%/64k of the progmem.

If someone please could give me a hint what might be wrong, most probably i misunderstood something essential about the teensy/usb flashing concept?

thanks in advance