How to port GPIO_LED in Linux BSP L5.10.35 for i.MX8QXP MEK Si B0

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

How to port GPIO_LED in Linux BSP L5.10.35 for i.MX8QXP MEK Si B0

Jump to solution
3,528 Views
josephzhou1
Contributor V

hi, I have followed yours Application Note ANnnnn (below),Pages 151--154

i like to port GPIO_LED to imx8 linux bsp L5.10.35

i changed the circuit , connected R147 one end to LED1 one end , and  i want to control the pin "PCIE_CTRL_PERST_B"  0 or 1 to turn led D44 on / off(pictures below)

 

but your Linux BSP version is L4.14.98 GA , now is L5.10.35 , even the Pins definitions all are changed , i  cannot find the pin "PCIE_CTRL_PERST_B" any more:(

i guess this pin now become PCIE_CTRL0_PERST_B ??????

how your NXP do like this ? even Pin Assignments  also r differences then how to stable it???

so

that s possible or not , how to do step by step . or where can get reference manual please adv me urgently

thank you all

Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
0 Kudos
1 Solution
3,372 Views
jimmychan
NXP TechSupport
NXP TechSupport

1) As you are using "pinctrl-0 = <&pinctrl_pcieb>;" in the leds node, do you add the pin below define in the pinctrl_pcieb?

IMX8QXP_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO00 0x06000021

 

2) gpios = <&gpio4 0 GPIO_ACTIVE_LOW >; // is this ok??  Yes. It is ok.

 

3) core-image-full-cmdline is a smaller image that contains basic linux commands.  For details, please read the core-image-full-cmdline.bb file in the folder sources/poky/meta/recipes-extended/images/core-image-full-cmdline.bb.

 

4) Sure, you can still build your image imx-image-multimedia. My core-image-full-cmdline is just an example for your reference.

 

5) Yes, ok.

View solution in original post

8 Replies
3,496 Views
jimmychan
NXP TechSupport
NXP TechSupport

You can find the corresponding pin in this header file

https://source.codeaurora.org/external/imx/linux-imx/tree/include/dt-bindings/pinctrl/pads-imx8qxp.h...

 

The GPIO pin of this PAD is:

IMX8QXP_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO00

 

Then, you can define it under &iomuxc in the board .dts file.

e.g. https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8x-mek.dt...

So, for example, add the pin in the pinctrl_hog.

IMX8QXP_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO00    0x06000021

 

 

3,490 Views
josephzhou1
Contributor V

ah really you guys changed the pin definition already just from imx6 to imx8   as i mentioned before 

/* pin id */
#define IMX8QXP_PCIE_CTRL0_PERST_B 0

 

 

thank you but not complete answers !!

 

1 i have already cloned down all the linux-imx  to my computer , but yet no  have pad*.H  and *.dtsi  files , how come?  is it just cloned the master then need more branches??

 

2

is it possible to do the customization GPIO_LED in imx8qxp or not?

 

3

how to do?

you got steps or some application notes for me ?

 

 

thanks 

Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
0 Kudos
3,465 Views
jimmychan
NXP TechSupport
NXP TechSupport

We have different version of BSP.

 

You don't need to clone the linux-imx source code.

You can follow the Yocto User's guide to build the BSP.

https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applicat...

 

After built the BSP, the linux-imx is located in <build_dir>/tmp/work/<board-poky-linux>/linux-imx/<version>/git/.  Then you can modify the linux-imx source code in your BSP folder.

 

 

3,454 Views
josephzhou1
Contributor V

ok got it.

 

but what is the next......

 

how to make DTS and copy to target and light up the LED based on my Circuits i uploaded before, please more steps pls more details pls

Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
Tags (1)
0 Kudos
3,421 Views
jimmychan
NXP TechSupport
NXP TechSupport

Firstly, you build the image for your board.

e.g.

$ DISTRO=fsl-imx-xwayland MACHINE=imx8qxpmek source imx-setup-release.sh -b build-xwayland

$ bitbake core-image-full-cmdline

(core-image-full-cmdline is a smaller image so the build time is shorter. no gui.)

 

Then, you can follow the document ANnnnn to modify the dts file for adding the gpio-led.

After the modification, run the following command to build the linux and the whole image again.

$ bitbake linux-imx -c compile -f

$ bitbake core-image-full-cmdline -f

 

Then, go to the deploy folder : <build_dir>/tmp/deploy/images/

The new updated images can be found in the deploy folder. Then you can use UUU to program the images to your board. The simply method is download the i.MX8QXPMEK demo image from the web. In the demo image, there is an uuu.auto script. Modify the filename of .wic in the script to your new updated image .wic file. Then run "uuu uuu.auto" to program the image to your mek board.

3,409 Views
josephzhou1
Contributor V

hi,

THANK YOU VERY MUCH , THAT IS WHAT I WANT ! almost done , please help to confirm a few points below and if go smoothly I will closed ticket soon:

2

I JUST ADD A LED:(imx8x-mek.dtsi)

leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pcieb>;
led1: user1 {
label = "user1";
gpios = <&gpio4 0 GPIO_ACTIVE_LOW >;           // is this ok??>
default-state i2= "on";
linux,default-trigger = "heartbeat";
};
};

 

AND  DISABLE THE pcieb (IT IS NOW USE AS GPIO)

&pcieb{

status = "disabled";
};

 

THEN FORCE REBUILD IT !!!

PLEASE REVIEW MY CODES ABOVE , PLEASE ADVICE ME IS IT OK ???

3

FOR BITBAKE  AND UUU , I HAVE DONE SOME SUCCESSFUL . I JUST CHECK WITH YOU 

 

I ALWAYS BUILD IT 

bitbake imx-image-multimedia  

i no have 

$ bitbake core-image-full-cmdline -f

where you got this image "core-image-full-cmdline" ???

 

4

n can i still build mine??

 

 

5 uuu i only do a single cmmd line 

is it ok ??

uuu  -b emmc_all imx-boot-imx8qmmek-sd.bin-flash_linux_m4 imx-image-full-imx8qmmek.wic

please help me verify it cmd  ok or not, i test it is OK ? please 

 

thanks

 

Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
0 Kudos
3,373 Views
jimmychan
NXP TechSupport
NXP TechSupport

1) As you are using "pinctrl-0 = <&pinctrl_pcieb>;" in the leds node, do you add the pin below define in the pinctrl_pcieb?

IMX8QXP_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO00 0x06000021

 

2) gpios = <&gpio4 0 GPIO_ACTIVE_LOW >; // is this ok??  Yes. It is ok.

 

3) core-image-full-cmdline is a smaller image that contains basic linux commands.  For details, please read the core-image-full-cmdline.bb file in the folder sources/poky/meta/recipes-extended/images/core-image-full-cmdline.bb.

 

4) Sure, you can still build your image imx-image-multimedia. My core-image-full-cmdline is just an example for your reference.

 

5) Yes, ok.

3,365 Views
josephzhou1
Contributor V

of cause have lah;  in line 1406# of file imx8x.dtsi

 

pinctrl_pcieb: pcieagrp{
fsl,pins = <
IMX8QXP_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO00 0x06000021
IMX8QXP_PCIE_CTRL0_CLKREQ_B_LSIO_GPIO4_IO01 0x06000021
IMX8QXP_PCIE_CTRL0_WAKE_B_LSIO_GPIO4_IO02 0x04000021
>;
};

 

 

thank you as you helps r great !!! i accepted it as a solution , thank you again

Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
0 Kudos