6

In one of our projects, we use an STM32L071 MCU in an LQFP48 package. It exposes GPIO port pins PA0 to PA15, PB0 to PB15 and PC13 to PC15 on the pins of the package.

The LQFP48 package doesn't expose GPIO port pins PC0 to PC12. But I can still program these pins; they are available in the GPIO registers. These pins are exposed when, for instance, using an LQFP64 package.

How are these non-exposed GPIO pins connected internally in the package? Is their 'hardware' present in the die of the MCU or are the GPIO registers not connected to anything?

I would expect that they use the same die for several packages to limit the amount of different dies they have to make or is each die made for a specific package?

If non-exposed GPIO pins are not initialised, they default to 'analog mode', so the input Schmitt-trigger is disabled. This prevents additional sleep current for these 'floating' pins.

NZD
  • 345
  • 1
  • 9
  • I suppose if it was an output it could be left floating. The issue is that GPIO pins are not only outputs, they are also inputs, as well as other functions. – DKNguyen Mar 24 '23 at 02:15
  • All of the circuitry exists on the die, but the pad on the die is simply not bonded to any package pin. It's exactly the same as if you had the larger package, but didn't connect any external circuitry to the pin. On-die features like internal pullup/pulldowns will still work. – Dave Tweed Mar 24 '23 at 04:05
  • 1
    Microchip PICs are by default initialized to analog inputs, which do not create any problems. But if they are digital inputs, without pull-ups or pull-downs, they can float to an indeterminate voltage where they can cause cross-conduction. However, if they are Schmitt trigger inputs, they have hysteresis so it may not be a problem. Check the documentation for the power-up default configuration bits for these hidden GPIOs. – PStechPaul Mar 24 '23 at 04:27

1 Answers1

2

You are likely correct when assuming the same die is used in different packages. The die pins are just not connected to anywhere, just like when you have a MCU package pin that has no connection on a PCB. To the best assumption is that the pins are there but just floating.

The default state for STM32 IO port is an analog input. It won't be a digital input unless initialized. So floating pins do not cause problems. You can also configure them as outputs or inputs with a pull-up or pull-down resistor, but leaving them as analog inputs is fine too. The worst is to confgure them as digital inputs with no pull-up or pull-down.

Justme
  • 127,425
  • 3
  • 97
  • 261
  • Also note that "the product contains the more featureful die" is an implementation detail. At any moment STM can start producing batches with a simpler die (if they see economic benefit to doing so) and all the registers documented as not available on the specific model could produce bus errors. Use of registers which the documentation indicates (do not exist / are unavailable on a particular part number) is undefined behavior. – Ben Voigt Mar 24 '23 at 14:19
  • @BenVoigt The register for whole port C must exist if the package has even one pin for port C. Also the chips of same package share both the data sheet and the reference manual which don't currently indicate any difference in register sets between packages. – Justme Mar 24 '23 at 14:23
  • 1
    That's true on this family. Other families may be marked with entire GPIO instances missing on certain models within the family. And you make a good point that present or missing goes by an entire port at a time, not individual pins/bits. – Ben Voigt Mar 24 '23 at 15:35