Hi,
I am working with an i.MX6ULL-based custom SOM module. For our requirements, we are configuring the pins using Config Tools for i.MX Processors. In Config Tools, I selected Create a Standalone Project, then selected i.MX 6ULL → (6Y2...05).
Our requirement is to configure the pins using Config Tools, take the generated .dtsi file, and use the same file to build the image. However, this did not work initially.
For UART, I understood that we need to add the corresponding device node and set its status to okay. Similarly, a small modification was also required in the generated .dtsi file.
I have attached the .dtsi file generated by Config Tools. Please have a look at it. In that file, when I commented out the imx6ull-board line, the configurations started working properly.
After UART, I moved on to ADC configuration. When I checked the ADC configuration in Config Tools, I noticed that the ADC appears to use the same GPIO pin. However, I observed that when I configure one GPIO pin as GPIO and another GPIO pin as ADC, the generated IOMUX configuration looks the same. Why is this the case? Is this the expected behavior?
Could you please help me understand the correct way to configure and test the ADC on our i.MX6ULL custom SOM?
Also, our original requirement was to configure the pins using Config Tools, take the generated configuration file, and directly use it to build and flash the image. I would like to confirm whether this approach should work for our custom board or whether additional changes are required in the generated .dtsi file.
I have attached the dts and .dtsi file generated from Config Tools for your reference.
what actually does this meant by?
Hello @Et_MM
It seems to be a bug from Config Tools for i.MX6ULL.
Please clarify what GPIO you want as ADC and what other for GPIO function.
I can help you to generate the correct &adc1 node and the correct pinmux.
Best regards,
Salas.
Hello @Et_MM
Hope you are doing very well.
Yes, ADC1 is the just one available.
For your use case, please use the below to your device tree:
&adc1 {
num-channels = <10>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_adc1>;
status = "okay";
};
&iomuxc {
pinctrl_adc1: adc1grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0x3000
MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0x3000
>;
};
};
That will use just the GPIO1_IO03 and GPIO1_IO04 as ADC channels.
root@imx6ul7d:/sys/bus/iio/devices/iio:device1# cat in_voltage3_raw
75
root@imx6ul7d:/sys/bus/iio/devices/iio:device1# cat in_voltage4_raw
0
root@imx6ul7d:/sys/bus/iio/devices/iio:device1# cat name
2198000.adc
Best regards,
Salas.
I want GPIO01_IO01 , GPIO01_IO02 as GPIO itself and GPIO01_IO03,GPIO01_IO04 as ADC.
when i searched the dtsi file it looked like we have only one adc that is adc1. adc2 is not available. please correct me if i am wrong.
Also guide me how can i test and verify that adc and gpio pins that we configured is working. How can i test that?
Already i have shared the dts and dtsi file that we are using. Hoping that you have already seen that. Is the configuration in mentioned for adc is wrong in that?
Thank you for the reply.
if i want to configure GPIO01_IO01 , GPIO01_IO02 as GPI. How does the configuration will be could you please help me with that also.
Hello!
You can simply add the below inside the &iomux:
pinctrl_hog: hoggrp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0x10b0
MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0x10b0
>;
};
Just be sure that is not claimed by another perupheral.
Best regards,
Salas.
Hi, Thank you for the reply i will try this.
I have tried the ADC with the configuration you gave and when i run those commands this is my output:
root@imx6ul7d:/sys/bus/iio/devices/iio:device0# cat in_voltage1_raw
78
root@imx6ul7d:/sys/bus/iio/devices/iio:device0# cat in_voltage4_raw
74
But any other way to test this pins so i can confirm this is working.