2021-02-12 02:13 PM
Hello.
I have a circuit containing notably: (i) MCU pin PA2 connected to both a ULN2003 transistor-array input and a 10k pulldown resistor and (ii) the corresponding output of the ULN2003 is connected to a small beeper GND. In theory, this circuit is supposed to maintain the transistor input at logical zero when the MCU pin is floating, hence preventing the beeper from ever turning on unless it is desired.
I noticed the following:
The datasheet for this MCU, the STM32G0, indicates "By default, all GPIOs are configured in analog input".
So there is something weird, because the default state as shipped by the factory and after mass erase seems, for few pins at least, to be output (I can sink 6mA to gnd from these pins when using a 500ohms load), so they are not floating).
I also found other pins that have the same behavior, such as SCL and SDA on PB10 and PB11. These pins are only conencted to a header, so the 3.3V found on these pins at boot can't come from anywhere else than the pins themselves.
Any clue what might be happening?
Thank you !
Solved! Go to Solution.
2021-02-13 12:30 AM
There is a flash empty check switching to the internal bootloader activating boot interfaces: https://community.st.com/s/article/Empty-check-mechanism-on-SMT32
2021-02-13 12:30 AM
There is a flash empty check switching to the internal bootloader activating boot interfaces: https://community.st.com/s/article/Empty-check-mechanism-on-SMT32
2021-02-13 03:10 AM
Probably PA2 is involved in the sytem bootloader and set to a state that ectivates your beeper. Study AN2606!
2021-02-13 08:08 AM
Many thanks to KnarfB and Uwe, it seems that you gave me a good pointer to important information I was not aware of.
2021-02-21 07:54 PM
The issue was indeed related to the initial state "output high" of some pins after a chip erase operation. Thanks to everyone who contributed. JL