Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello,
For configuring GPIOs on the Colibri iMX7-1G, indeed, adjustments in the device tree are necessary to ensure the pins are set up correctly for your application. Given the pins you’re interested in (SODIMM 46, 48, 50), you’ll need to modify the device tree to change their functionality to GPIO and set their direction and default state if needed.
Here’s a general approach to achieve this:
Locate the Device Tree Source (DTS) file: For the Colibri iMX7-1G, the relevant DTS files are typically found within the Linux kernel source tree under arch/arm/boot/dts/. The exact file depends on your specific carrier board and configuration. You might be looking for a file named similar to imx7d-colibri-eval-v3.dtsi or another variant that matches your carrier board.
Modify the Pin Configuration: Within the DTS file, locate the pinmux settings for the pins you wish to use as GPIO. You will need to ensure that the pins are not assigned to another peripheral function. The pin configuration is defined using the pinctrl nodes. You would define your GPIOs within a pinctrl node, specifying the pin function, direction, and any other required properties.
This is a hypothetical example. You’ll need to replace MX7D_PAD_SAI1_TX_BCLK__GPIO6_IO20, MX7D_PAD_SAI1_TX_SYNC__GPIO6_IO21, and MX7D_PAD_SAI1_RX_DATA__GPIO6_IO22 with the correct pad names for the pins
Please, also check if these links can help you solve your problem:
I tried to set clear from uboot and the GPIO is working
The pin 44 seams to be used to something else because it continue to switch at fixed frequency. I suspect i need to disable the lcd controller that looks like it is using it.
More over, is there any tutorial to learn how to edit the device tree and build with the image compatible with the toradex easy installer?
In there the possibility to add a recipe in yocto to do this?
After checking Colibri iMX7D 1GB eMMC Evalboard’s device tree, we can see on imx7-colibri.dtsi that the pins SODIMM 46, 48 and 50 are not configured as GPIOs, which is what you need. They could be configured as LCD_DATA* if &lcdif was enabled.
You can check for the &lcdif (disabled) and the strings SODIMM 46, SODIMM 48 and SODIMM 50 in the file below.
I read the document regarding the device tree modification and it is clear to me.
We use Zynq on tens of our product and I’m used to make custom device tree.
Is there any easy way to apply a modification in device tree form yocto recipe? Like that I put a dtsi file in a layer and than I build everything with bitbake
The device tree costumization procedure explained by Toradex requires a two step generation of the tar deploy image. I generate the image with bitbake with default device tree and than I replace it with the custom one.
This make more complex the generation of the image in cicd pipeline.
Xilinx has in Petalinux an elegant solution. There is a custom dtsi in bsp layer. You can edit that and you will get a final images with updated device tree.
This is a possible approach during development. For production, for sure you will want a streamlined way to have your customized device tree on your image. This is more related to Yocto itself than to the Device Tree. So you need to go to Yocto-related documentation. On Toradex Developer we have some articles about Yocto, for example:
Feel free search for more Yocto-related documentation in Toradex Developer, but please keep in mind that the complete Yocto documentation is in their own website (be sure to always access the documentation for the Yocto version you are using - BSP 6 is Kirkstone):
Related to this: I am not sure if you have taken a look at Torizon OS. Such device tree modification is way easier to do on Torizon OS, by using our TorizonCore Builder tool. Also the image customization process is way less computing intensive.