Hi All,
I am currently working on the i.MX8QXP EVK board. I want to configure the FLEXCAN2_TX pin as LSIO_GPIO1_IO20 output with an initial state of 1. FLEXCAN2_TX was initially configured as UART3_TX, so I removed the following configurations related to UART3_TX from imx8x-mek.dtsi:
&lpuart3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpuart3>;
status = "okay";
};
pinctrl_lpuart3: lpuart3grp {
fsl,pins = <
IMX8QXP_FLEXCAN2_TX_ADMA_UART3_TX 0x06000020
IMX8QXP_FLEXCAN2_RX_ADMA_UART3_RX 0x06000020
>;
};
I also added the following configurations in imx8qxp-mek.dts:
&lsio_gpio1 {
pinctrl-names = "default";
pinctrl-0 = <&test_gpio>;
status = "okay";
test_gpio: gpio_val_test {
fsl,pins = <IMX8QXP_FLEXCAN2_TX_LSIO_GPIO1_IO20 0x20>;
};
};
I obtained the value 0x20 from the configuration tool. However, after flashing the image, the sysfs entry for gpio52 still shows the direction as input. Please correct me where I went wrong."
Thanks in advance!
Hi @Alejandro_Salas ,
Thank you for the response.I have tried the above mentioned changes.But still the GPIO direction while reading is "in" instead of "out".I am not sure on which register in the reference manual should I refer for this.I changed the configuration using the config tool and corresponding changes in the dts file is mapped to the device dts file.Kindly guide me.
sysfs number is calculated based on the below calculation ,
IMX8QXP_FLEXCAN2_TX_LSIO_GPIO1_IO20 belongs to gpio1 controller and hence comes in the bank gpiochip32.hence sysfs gpio number = 32+20=52
Hello @jnj
In reference manual you can look the GDIR register:
I am trying to replicate your issue but unsuccessfully.
Could you please share your device tree to try boot with it?
Best regards!
Salas.
Hi @Alejandro_Salas ,
I have attached the dtsi file where I made changes for the gpio and dtb file.Kindly go through it. Could you share me your dts and dtb file?I will check here also.
Hello @jnj ,
Apologies for delay.
I am trying to replicate the issue but unsuccesfully.
One question, what BSP version are you using?
Have you tried with gpiod? for example, typing in command line:
$gpioinfo
Best regards.
Salas.
Hi @Alejandro_Salas ,
I could control the gpio direction and value by using echo command and sysfs gpio number.But from dts configuration I couldn't control the initial state of gpio ie output and value =1.I am using linux kernel version 5.15.17 Kirkstone