STM32F0 standby current way too high

I need your expertise here. Having a problem with current draw in Standby mode ( STM32F091).

I developed custom board with some external components like Accelerometer, Pressure sensor, temperature sensor, RF comm, EEPROM chip. It is powered from two AAA cels.I attempted several times to go into STANDBY mode, I have obviously shut down all listed components. After all no success, my board takes around 630uA, it can't go any lower.

I wanted to rule out component by component, difficult to do it on final PCB. I had one spare board, so I mounted only power supply part (boost regulator 3.3V). It consumes only 6uA (quiscent current).Next I mounted STM32F091, and few capacitors mainly ceramic 100nF + 4uF tanatalum, all as advices per ST app note.

Basically I have very clean, isolated setup STM32 + power supply.

At this stage, I doubt there is a hardware issue in the circuit.I was looking into capacitor leakage, but certainly I did not find anything that adds up to 630 uA of total current.

Did I miss something, can you guys suggest how to approach this problem.

If you want the pins in High-Z state without massive current flow, set the pins to Analog. Analog mode disables the input amplifier. This amplifier draws high cuurent when the input voltage is not near the rails.

Something strange is going on here, I'm sure there is an explanation, but I have no clue at the moment.

I was almost there, having only some problems with MCP9808 (temp.sensor).

My problem is still with Hi-Z state, but I have to stress, I'm talking about Hi-Z in standby mode. Datasheet says, that after switching to standby, all pins are in Hi-Z state, with some exceptions like reset and wakeup pins.

Setting PULL/NO PULL for all pins does not change the situation.There should be no hardware fault, because when I load normal firmware ( not using standby), all functions work properly.

I also verified that MCU was actually in standby mode, by checking the flag with:

PWR_GetFlagStatus(PWR_FLAG_SB);

One important note, when I'm in standby, current consumption is now over 2 mA, therefore it's much worse than it was in the initial state (630uA).

@UweThanks for advice. Sorry for being dumb, I wanted to take a shortcut, was looking for quick wins, but again experience shows there is no such thing, you need to learn everythin hard way

Took me lot of time. I was depending on Hi-Z state of MCU i/o pins. Somehow randomly my RF chip (ST Spirit1) was going to sleep, and occasionaly it did not happen. Lot of confusion. Therefore I have added very weak pull-up (680k) on spitrit's SDN pin (shutdown), this step reduced current by few mA.

Yet another problem 170uA consumed by LIS3DH, some kind of hardware bug (undocumented) i2c address line (SDO) connected to GND was causing this. After connecting SDO to VCC, current consumed by LIS3DH went down to few uA.

Last one, BME280 from Bosch, was taking constanlty around 400 to 500 uA, putting chip in sleep mode did not help (there is i2c command). Finally I found out that there is a reset command, when I did this 3ms after data readout, chip went to low power mode.