I'm having some issues when I try to upload sketches to a custom board. I'm able to burn the Arduino micro bootloader using an USBASP, making sure that the fuses are correct regarding the HWB and BOOTRST. After burning the bootloader I use an USB cable to upload a Blink example file, doing this process I check the device manager on windows to see if the COM ports change after the reset command via USB. On the first try after burning the bootloader the sketch uploads with no problems, but when I try to upload the same sketch the second time the COM port doesn't change after the reset. I'm only able to reupload a different sketch if I burn the bootloader again.
I'm only able to upload the sketch once and if I want to upload another sketch I need to burn the bootloader again. Does anyone had the same issue before?
I built a few custom projects using the 32U4 and had no problems. When I need USB uploading I just bootload with the standard leonardo bootloader. I usually do not bother with it and just program via ISP. I actually use one custom board as an ISP programmer.
Your basic circuit on the processor looks fine. I, however, use 4K7 pull-ups on the I2C lines. The only question I have is, what is the purpose of R5?
Thanks for the feedback @Willem43 , I will look into the I2C resistors! The R5, I use as a pull-up resistor on the D+. I put it on a project using an STM32F1 and I had some problems using the USB without this resistor.
But apparently this resistor(R5) was the problem on the 32U4! I removed it from my board and it now resets the MCU and enters in the bootloader mode. Probably this resistor was messing up on the reset process with the 1200baud rate I think? Maybe some internal pull-up/pull-down was messing with the signal after I burned the first sketch.
The bad thing about the USB bootloader is the fact that it starts a new device enumeration every time you try to upload. It helps to keep the reset button pressed till avrdude starts - but you'd need a reset button in the first place