AM62: Unused GPIO states in devicetree

Hello,

Is it ok to keep unused GPIO pins (floating, not connected to anywhere) as PIN_INPUT state in the Device Tree?

Or shall we define them as PIN_INPUT_PULLDOWN?

Can floating pins on this SOM module cause high current consumptions like it does on some MCUs?

Thanks,
MF.

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello MF,

Great questions! For unused GPIO pins on Toradex System on Modules (SOMs), it is recommended to configure them with a defined state rather than leaving them floating.

1. State of Unused GPIO Pins:
While it’s technically possible to leave an unused GPIO as PIN_INPUT, it’s better practice to set them as either PIN_INPUT_PULLDOWN or PIN_INPUT_PULLUP using the internal pull resistors in the Device Tree. This avoids unintended behavior and helps ensure the pins do not float.

2. Floating Pins and Current Consumption:
Yes, floating GPIO pins can sometimes cause increased current consumption—just as you observed with MCUs. Floating pins may switch rapidly and draw unnecessary current or pick up noise, which can adversely affect both stability and power consumption.

3. Best Practice for Toradex SOMs:
For Toradex modules, the documentation suggests unused GPIO signals do not need external termination, but it’s recommended to configure them with an internal pull-down (PIN_INPUT_PULLDOWN) in your Device Tree for best results. This will ensure the pins are at a defined logic level and minimize potential issues with current consumption.

Here are some helpful references from the Toradex documentation:

Summary:
Set unused GPIO pins to use internal pull-down or pull-up resistors (preferably pull-down) rather than leaving them as plain inputs/floating. This approach ensures defined levels and prevents unwanted current draw or erratic system behavior.

If you have a specific Toradex module in mind, I can help with example Device Tree configuration as well.

Best regards,
Toradex AI Assistant.

Hello @Fide,

If the pins are left unconnected and there is no external pull-up or pull-down resistors, they can either be left unconfigured or with the internal pull down.
Configuring them as inputs would be problematic, please see the following quote from the AM62x Datasheet:

Any IO with its input buffer (RX) turned off is allowed to float without damaging the device. However, any IO with its input buffer (RX) turned on shall never be allowed to float to any potential between VILSS and VIHSS. The input buffer can enter a high-current state which could damage the IO cell if allowed to float between these levels.

Best Regards,
Bruno

1 Like

Thank you Bruno for the information.

If we define the pins as PIN_INPUT in the device tree, as in the example below, but leave them unconnected, is the RX buffer still considered enabled?

	/* Verdin SPI_2 */
	pinctrl_spi2: main-spi2-default-pins {
		pinctrl-single,pins = <
			AM62X_IOPAD(0x01b0, PIN_INPUT, 1) /* (A20) MCASP0_ACLKR.SPI2_CLK */ /* SODIMM 131 */
			AM62X_IOPAD(0x0198, PIN_INPUT, 1) /* (A19) MCASP0_AXR2.SPI2_D1   */ /* SODIMM 133 */
			AM62X_IOPAD(0x0194, PIN_INPUT, 1) /* (B19) MCASP0_AXR3.SPI2_D0   */ /* SODIMM 135 */
		>;
	};

Hello @Fide,

It depends if the respective pinctrl is used by another node.
If not, the pins will remain in their default state.

If yes, it will be configured as an input, unless the node’s driver configures in in another way.
In this specific example, it is SPI, so if the pinctrl is used by a node for an SPI instance the driver may reconfigure the input buffer.
Regardless, it would be a best practice to disable the SPI node which uses pinctrl_spi2 if these pins are left unconnected.

Best Regards,