Is there any chance to read 2000A using STM32? I searched the Internet for low-value shunt resistor but nothing found. maybe some kind of current transformer could do the job!! any help will be usefull.
The field from 2000A flowing in a conductor will be quite significant, and linear with the current. Just dangle an analogue output Hall effect IC close to the cable.
Better still, have two Hall effect ICs, one either side of the wire. Align one up, one down, so they both read the conductor field in the same direction, but read external fields in opposite directions. Add them together, and this arrangement will reject external fields. Feed detected voltage into the STM32's ADC.
Reading 2000A with a proper current shunt has nothing to do with the ADC or the STM32.
The fundamental criteria is choosing a proper Kelvin shunt for the application, usually limited to 50mV as the default standard voltage drop.
Ram Meter Inc. RFL2000A50 - 2000 Amp 50 mV DC Current Shunt
What Lord Kelvin in the 19th century realized was that the voltage sensing must avoid the gradients due to current spreading at the interface of the shunt and thus sense a short distance outside the interface. Notice the location of the sense voltage screws above. This is a Kelvin Shunt. Otherwise known as a 4 wire shunt and is how they are calibrated.
There are a few different ways to measure current. Others have touched on the idea of a shunt, which means that your MCU is electrically connected to the current you're measuring. This is an inexpensive and direct method of measuring current.
For AC, you could use a current transformer, which is basically a torroid and burden resistor; the wire with the current you're measuring passes through the center of the torroid, making a 1-turn primary. The number of turns on the torroid determines the scaling factor. e.g. if your current transformer has 1000 turns on it, then 1A of current flowing through the primary will be 1mA on the secondary. You would add a burden resistor so that this current develops a voltage within the range usable by your measuring equipment, and then possibly need some rectification, filtering, etc. before being presented to the MCU. Current transformers are also inexpensive and allow a LOT of flexibility in the measurement of the current, but only work for AC signals. They also offer isolation; your measuring circuitry is not electrically connected to the current you're measuring. Current transformers also have frequency-dependent effects and need to be selected so that the current range you're interested in falls within the linear region of the CT's response curve.
Hall-effect devices are the next step up in price and performance. Companies like LEM make hall-effect current transducers which allow you to measure DC or AC, including high frequency harmonics, up to many thousands of Amps. These devices work by measuring the magnetic field through a calibrated Hall-effect sensor. The output can usually be directly connected to the MCU ADC input.
For your application, it sounds like your most straightforward and safest solution would be to use a Hall effect device. Looking at your schematic, though, it looks like you could also use a resistor divider across the discharge resistor and measure the current directly there.