I am trying to program an ATMega32u4 microcontroller through arduino IDE. I have added external oscillator(16Mhz) and capacitors and few other connections according to the Schematic. I had put a sparkfun bootloader onto it(caterina) using Avr Pocket Programmer. A usb 2.0 is connected to the microcontroller. Arduino IDE recognizes microcontroller as Arduino Leonardo with the help of this usb. Bootloader file.
I was able to upload codes into the microcontroller but the issue is, I have to put the reset pin to ground momentarily each time when the IDE goes to uploading stage. If i do not reset it, the COM Port for leonardo disappears but it never comes back until I reset it manually and therefore the uploading bar just gets stuck. I have also added the circuit connected to the Reset Pin according to the schematic but even if i remove all of it and just connect a switch, no difference can be observed. No power on reset is working.
Since one can upload codes without having to manually reset each time in Arduino Leonardo, I was wondering what could be the issue here.