We are using the Colibri iMX8X SoM and I am running into an issue with the GPIO behaviour on start-up.
I have configured it so that three pins are set to their GPIO function.
Pin 98 configured to GPIO0-25 is used as an input, I have not observed trouble with that.
Pin 133 configured to GPIO3-21 is used as an output and configured in the device tree as pull-down. There is also an external pull-down on the circuit it connects to.
Pin 103 configured to GPIO4-04 is configured and used the same way as 3-21.
I have observed the output pins which are configured to pull-down and have external pull-downs, are pulled high for about 3 seconds after boot. It seems that the bootloader is pulling both pins high, I measured it on a scope to see that if I interrupt the boot process the pins stay high until I proceed to boot.
I tested this also with the external circuit disconnected so it was only the toradex on a viola carried board, and also verified the same behaviour on the larger colibri evaluation board.
In the picture below we can see both pin states. The horizontal div is 5s. A reboot is triggered, the pins are pulled low, then back high for 3.2 seconds, then back to low. After ~30s the controlling software has started and pulls one of the lines high.
After the bootloader is finished the pins return to low state and respond to control by the software when it is up and running, so I believe that the device tree configuration is good, I include it below:
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello,
Thank you for reaching out with your question. The behavior you’re observing, where GPIO pins are pulled high during the bootloader phase, is likely due to the default configuration of the bootloader, which can set GPIO states before the Linux kernel takes over. This is a common issue when the bootloader initializes hardware differently than the final operating system configuration.
To address this, you can modify the U-Boot bootloader configuration to ensure that the GPIO pins are set to the desired state during the boot process. Here are some steps you can take:
Check U-Boot Configuration:
Access the U-Boot source code for your Colibri iMX8X module, typically available in the Toradex BSP (Board Support Package).
Locate the board-specific configuration files, which might be under a directory like board/toradex/colibri_imx8x/.
Modify GPIO Initialization:
In the U-Boot source, look for the GPIO initialization code, often found in board-specific files or common initialization routines.
Ensure that the GPIO pins in question are configured as pull-downs during the bootloader phase. You may need to add or modify code to explicitly set these pins to the desired state.
Rebuild U-Boot:
After making the necessary changes, rebuild the U-Boot bootloader. Follow the Toradex documentation for building and deploying U-Boot to your module.
Test the Changes:
Flash the modified U-Boot to your module and observe the GPIO behavior during boot. Verify that the pins remain in the pull-down state as expected.
By ensuring that the bootloader configures the GPIO pins correctly, you can prevent them from being pulled high during the boot process. If you continue to experience issues, double-check the device tree and U-Boot configurations to ensure consistency across all stages of the boot process.
I hope this helps resolve your issue. If you have any further questions, feel free to ask.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem:
@ToradexAI bot is correct. This is the expected behavior.
The device tree overlays are stacked when the kernel is launched, so in the first few seconds before, the pins are going to be configured by the U-boot device tree before the Linux kernel takes over.