Pinout designer and Torizon OS and Custom boards

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


To control the pin multiplexing (pin mux) on Torizon OS, you will need to modify the device tree. Torizon OS itself does not provide a direct mechanism to control pin muxing dynamically; instead, this is typically done through device tree modifications.

Here are the general steps you would follow:

  1. Identify the Pins and Their Functions:

    • Use the Pinout Designer to identify the pins you want to use as GPIO and the ones you want to disable (like CAN, PWM, SD, etc.).
  2. Modify the Device Tree:

    • You will need to create or modify a device tree overlay to change the pin functionalities. This involves editing the device tree source files to set the desired pins to GPIO mode and disable the functions you don’t need.
    • Refer to the Pin Multiplexing - Changing Pin Functionalities in the Linux Device Tree article for detailed instructions on how to do this.
  3. Compile the Device Tree:

    • After making the necessary changes, compile the device tree source files to generate the device tree blob (DTB) file.
  4. Deploy the Device Tree:

    • Replace the existing DTB file on your Torizon OS with the newly compiled one. This can be done by copying the DTB file to the appropriate location on the boot partition of your device.
  5. Reboot the Device:

    • Reboot your device to apply the changes. The new pin configurations should now be in effect.

Example Steps:

  1. Edit the Device Tree Source:

    • Locate the device tree source file for your specific SoM and carrier board.
    • Modify the pinctrl settings to set the desired pins to GPIO mode. For example:
      &iomuxc {
          pinctrl_gpio: pinctrl_gpio {
              fsl,pins = <
                  MX8MM_IOMUXC_SODIMM_210_GPIO3_IO05 0x1c4 /* Set SODIMM_210 to GPIO */
                  /* Add more pins as needed */
              >;
          };
      };
      
  2. Compile the Device Tree:

    • Use the device tree compiler (DTC) to compile the source file:
      dtc -I dts -O dtb -o my_custom.dtb my_custom.dts
      
  3. Deploy the Device Tree:

    • Copy the compiled DTB file to the boot partition of your Torizon OS device:
      cp my_custom.dtb /boot/
      
  4. Update the Boot Configuration:

    • Ensure that the bootloader (U-Boot) is configured to use your custom DTB file.
  5. Reboot:

    • Reboot the device to apply the new configuration.

By following these steps, you can control the pin muxing on Torizon OS to configure the pins as GPIO and disable the features you don’t need. If you need more detailed guidance, refer to the Toradex documentation on device tree customization.

Please, also check if these links can help you solve your problem:

Pinout Designer Tool | Toradex Developer Center.