AnsweredAssumed Answered

Any way to determine programmatically what physical pins are on a device?

Question asked by kostka.tim on Oct 25, 2017
Latest reply on Oct 26, 2017 by kostka.tim

Is there any way to determine programmatically what physical pins exist on a device?  Or, somewhere within the HAL libraries where its defined?

 

For example, the STM32F411 chip in the UFQFPN48 package only has the PC13, PC14, and PC15 pins on the C port.  Is there a clever way to determine this?  I have determined that if I try to set the PC0 pin as output high, and it doesn't exist, it still reads as low when I probe its value.  However, this behavior is the same if the pin was physically connected to ground on the board.  So I have no way of differentiating a pin that doesn't exist from a pin physically grounded on the board.

 

The HAL libraries are nice enough to not define ports if they don't exist.  For example, GPIOF is not #defined on the STM32F411xE, but it is defined for chips that have those pins.  So that's somewhat helpful, but doesn't get me all the way there.

 

The DEV_ID field gives some information on the chip family, but not package size.  I don't see any other useful identifiers apart from that.  The size of the flash is there, but unhelpful.

 

Any other clever ideas I'm missing?

Outcomes