2022-03-24 05:07 AM
In STM32L0xx, all pins are initialized as Analog, except PA13/PA14 which are SWDIO/SWCLK, initialized as AF; and PA4, which is initialized as [digital] Input.
I can't find any reason for the latter.
It's not that important, and I can simply take it as a fact - unless it hides some nasty surprise...
Any insight?
JW
2022-03-24 11:32 AM
Well spotted, that is indeed an interesting question!
In fact, port A is only preset for the STM32L0 with GPIOx_MODER = 0xEBFF FCFF, i.e. PA4 = input. With the other STM32, either only the SWD pins or also the JTAG pins are initialized to AF, the rest either to digital input (older devices) or to analog (newer ones).
Maybe it's an Easter egg of one of the chip designers.;)
But it will probably be overwritten during initialization anyway, right?
Regards
/Peter
2022-03-24 01:35 PM
The 'L05x and 'L07x DS mention "decreased touch sensitivity" namely for PA4, so there will be some structural difference probably resulting in increased parasitic capacitance or leakage, too. Most probably an internally used, publicly undocumented feature.
> But it will probably be overwritten during initialization anyway, right?
Yes, if the program is written with this fact in mind. It just underlines the adage that documentation must be read and assumptions should not be made. At least for those who don't click in CubeMX... ;)
Jan