How to access RTD GPIO in i.MX 8ULP Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to access RTD GPIO in i.MX 8ULP Linux

Jump to solution
350 Views
ryo_agrass
Contributor II

Hello, Everyone.

Currently, my company is developing a custom board for i.MX 8ULP.
However, I'm having trouble accessing PTB0 and PTB1 on Linux.

~# gpioset gpiochip1 0=1
gpioset: error setting the GPIO line values: Invalid argument
~# gpioget gpiochip1 0
gpioget: error reading GPIO values: Invalid argument

Even if you try to define PTB0 and PTB1 as GPIOs in the device tree, they cannot be defined in the same way as PTD and PTF.
Instead, something like `rpmsg_gpiob` is defined.

rpmsg_gpiob: gpio@1 {
	compatible = "fsl,imx-rpmsg-gpio";
	port_idx = <1>;
	gpio-controller;
	#gpio-cells = <2>;
	#interrupt-cells = <2>;
	interrupt-controller;
	interrupt-parent = <&rpmsg_gpiob>;
	status = "okay";
};

So, upon investigating i.MX 8ULP SoC, it was determined that PTB0 and PTB1 are RTDs.

I am currently developing with Yocto. Is it possible to enable access to PTB0 and PTB1 on Linux using Yocto?

Labels (1)
0 Kudos
Reply
1 Solution
133 Views
ryo_agrass
Contributor II

Although we ultimately couldn't resolve it, meeting the deadline was unrealistic, so we had the hardware team implement the change to APD.

Should a similar issue arise, I will ask again.

Thank you so much.

View solution in original post

0 Kudos
Reply
3 Replies
314 Views
joanxie
NXP TechSupport
NXP TechSupport

you need enable it in the config file, you can refer to my document which I tested on theimx8ulp with PTF0

i.mx8ulp gpio hog usage - NXP Community

0 Kudos
Reply
303 Views
ryo_agrass
Contributor II

Hi, @joanxie 

What I want to do this time is precisely to configure pinctrl of rpmsg_gpiob.

What steps are required to configure this like gpiof ?
When I set fsl,pins = <MX8ULP_PAD_PTB0__PTB0 0x3> , compile error occurred because MX8ULP_PAD_PTB0__PTB0 does not exist.

Thanks.

0 Kudos
Reply
134 Views
ryo_agrass
Contributor II

Although we ultimately couldn't resolve it, meeting the deadline was unrealistic, so we had the hardware team implement the change to APD.

Should a similar issue arise, I will ask again.

Thank you so much.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2202249%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20access%20RTD%20GPIO%20in%20i.MX%208ULP%20Linux%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202249%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%20Everyone.%3C%2FP%3E%3CP%3ECurrently%2C%20my%20company%20is%20developing%20a%20custom%20board%20for%20i.MX%208ULP.%3CBR%20%2F%3EHowever%2C%20I'm%20having%20trouble%20accessing%20PTB0%20and%20PTB1%20on%20Linux.%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E~%23%20gpioset%20gpiochip1%200%3D1%0Agpioset%3A%20error%20setting%20the%20GPIO%20line%20values%3A%20Invalid%20argument%0A~%23%20gpioget%20gpiochip1%200%0Agpioget%3A%20error%20reading%20GPIO%20values%3A%20Invalid%20argument%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EEven%20if%20you%20try%20to%20define%20PTB0%20and%20PTB1%20as%20GPIOs%20in%20the%20device%20tree%2C%20they%20cannot%20be%20defined%20in%20the%20same%20way%20as%20PTD%20and%20PTF.%3CBR%20%2F%3EInstead%2C%20something%20like%20%60rpmsg_gpiob%60%20is%20defined.%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Erpmsg_gpiob%3A%20gpio%401%20%7B%0A%09compatible%20%3D%20%22fsl%2Cimx-rpmsg-gpio%22%3B%0A%09port_idx%20%3D%20%26lt%3B1%26gt%3B%3B%0A%09gpio-controller%3B%0A%09%23gpio-cells%20%3D%20%26lt%3B2%26gt%3B%3B%0A%09%23interrupt-cells%20%3D%20%26lt%3B2%26gt%3B%3B%0A%09interrupt-controller%3B%0A%09interrupt-parent%20%3D%20%26lt%3B%26amp%3Brpmsg_gpiob%26gt%3B%3B%0A%09status%20%3D%20%22okay%22%3B%0A%7D%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3ESo%2C%20upon%20investigating%20i.MX%208ULP%20SoC%2C%20it%20was%20determined%20that%20PTB0%20and%20PTB1%20are%20RTDs.%3C%2FP%3E%3CP%3EI%20am%20currently%20developing%20with%20Yocto.%20Is%20it%20possible%20to%20enable%20access%20to%20PTB0%20and%20PTB1%20on%20Linux%20using%20Yocto%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2202249%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX8ULP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2202516%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20access%20RTD%20GPIO%20in%20i.MX%208ULP%20Linux%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202516%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F39586%22%20target%3D%22_blank%22%3E%40joanxie%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20want%20to%20do%20this%20time%20is%20precisely%20to%20configure%26nbsp%3Bpinctrl%20of%20rpmsg_gpiob.%3C%2FP%3E%3CP%3EWhat%20steps%20are%20required%20to%20configure%20this%20like%20gpiof%20%3F%3CBR%20%2F%3EWhen%20I%20set%26nbsp%3Bfsl%2Cpins%20%3D%20%3CMX8ULP_PAD_PTB0__PTB0%200x3%3D%22%22%3E%20%2C%20compile%20error%20occurred%20because%20MX8ULP_PAD_PTB0__PTB0%20does%20not%20exist.%3C%2FMX8ULP_PAD_PTB0__PTB0%3E%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2202379%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20access%20RTD%20GPIO%20in%20i.MX%208ULP%20Linux%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202379%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eyou%20need%20enable%20it%20in%20the%20config%20file%2C%20you%20can%20refer%20to%20my%20document%20which%20I%20tested%20on%20theimx8ulp%20with%20PTF0%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2Fi-mx8ulp-gpio-hog-usage%2Fta-p%2F2161010%22%20target%3D%22_blank%22%3Ei.mx8ulp%20gpio%20hog%20usage%20-%20NXP%20Community%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E