I have some experience working with stm32 but I only ever used them on dev boards.
On first power up, the mcu makes some little noises like burning after a few seconds, and 2 minutes later its drawing 100mA and smoking.
I think there is some important details that I'm missing. What could go wrong in a simple setup like this? (only vdd,vss, decoupling cap and st-link)
I tried over 20 times with both stm8 and stm32.
I got the decoupling cap as close as possible and supplied them with 3.3v.
A few times I was able to program and verify the flash but it showed some weird behavior * and again went up in smokes a few minutes later.
I tried drag soldering, regular soldering with smd tip and temperature as low as 260C and cooldown time after each pad. I also tried hot air gun on 270C and I'm close to sure the problem is not soldering.
I also tried with NRST pull-up and BOOT0 pull-down.
*weird behavior: "random" like timing on a simple led blinker or a pwm signal that only goes down to around 2.8v instead of 0v. overall its 'kinda' working but only for 1min.
** the problem is not st-link. its flashing the dev-board just fine
EDIT 1: Here's the schematic (for stm32)(Connections to ST-Link marked with labels):
there is nothing beneath. just another (unpopulated) footprint connected to pins.
EDIT 2: continuity test: no shorts, all pins contacts are OK
EDIT 3: connected VDDA and VDD and added another 4.7uF on VDD. still fried up. VDD measured directly on device: 3.36v
EDIT 4: current draw behavior: in all cases when the chip is fried, it draws around 20-40mA and sometimes suddenly goes up to 100-240mA for some seconds and then zeroes out(less than 10mA). and stays at zero for some time before start again.
UPDATE: i soldered another STM8S003F3P6,1uF on VCAP and 2x100nF and 10uF on VDD. and used a battery as source and made a little capacitance multiplier and emitter follower to make the 3.3v with lots of ceramic and low-ESR caps, and a current limit set on 15mA. the voltage had less than 30mV noise over 50MHz. then i connected the MCU (freshly soldered). current draw was less than 4mA and voltage was stable. i left it be. after a minute or two, it suddenly started to go over 15mA limit and trig the PDR. and now it starts to do that immediately (even with the NRST asserted). seems this one is gone too...