Hello, hope everyone is doing well.
I have designed an STM32F1 board variation. I have multiple power sources. One of them is USB 5V and the other is JTAG 3V3. 5V is converted to 3V3 through a MIC5205-3.3YM5 regulator with a 2.2uF bypass cap on its output. The thing is, when i plugged the JTAG connector and powered the circuit from JTAG 3V3 input, after a little while, the 2.2uF bypass cap of the regulator started to smoke. Then i checked, there was short circuit. I tested again after 10 mins, and the short circuit was gone. Then i plug the USB this time, and after a while the regulator input pins started to smoke and there was little sparks. I measured the reg output, it was 3.3V then there was a short again. Now i reflowed the reg and caps again (thinking maybe there were a tiny solder paste leftover would have been stuck in between the legs) and plugged the USB back. I am measuring the reg output and it is currently 1.8V, no smoke or sparks. And when i unplug the USB and plug the JTAG 3.3V again, the same cap starts to smoke again, creating a short. I am lost, i can't find the reason behind this. I am attaching the reg schematic and PCB layout. I am happy to hear any ideas, thanks!