IMX8MN EVK GPIO in yocto linux

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

IMX8MN EVK GPIO in yocto linux

799 次查看
k_specka
Contributor II

Hi, I'm having problems to configure and set gpio on the yocto linux with the imx8mn evk.
Having LEDs connected to pins 19 (ECSPI2_MOSI GPIO5_IO11) and 40 (SAI5_RXC GPIO3_IO20) of J1003.
With a MCUXpresso build for the M7 launched from u-boot LEDs are blinking.
Now trying with linux ...

When trying to set pin 40 with 'gpioset gpiochip3 20=1'
I get the error: gpioset: invalid line value: 'gpiochip3'

Same Problem was for the mini at:
https://community.nxp.com/t5/i-MX-Processors/gpioset-not-working-when-adding-kernel-modules-in-yocto...

But following the tips there was not solving the issue.

So the steps I did are:

--- edit the device tree dtsi ---
> cd to imx-yocto-bsp
> DISTRO=fsl-imx-wayland MACHINE=imx8mn-lpddr4-evk source imx-setup-release.sh -b imx8nlpd4_build
> bitbake -c devshell virtual/kernel

(in new devshell window:)
> gedit .arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
@micfil set status to disabled

down @ &iomuxc adding:
/delete-node/ pinctrl_pdm;
pinctrl_hog: hoggrp {
fsl,pins = <
MX8MN_IOMUXC_SAI5_RXC_GPIO3_IO20 0x11
>;
};
close gedit
> make dtbs
> exit

bitbake imx-image-core
flash created wic to sd-card and boot

--- trying on the device ---
> gpiodetect
gpiochip0 [30200000.gpio] (32 lines)
gpiochip1 [30210000.gpio] (32 lines)
gpiochip2 [30220000.gpio] (32 lines)
gpiochip3 [30230000.gpio] (32 lines)
gpiochip4 [30240000.gpio] (32 lines)
gpiochip5 [2-0020] (16 lines)

> gpioset gpiochip3 20=1
gpioset: invalid line value: 'gpiochip3'

> cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/30200000.gpio, 30200000.gpio:
gpio-13 ( |ir-receiver ) in hi IRQ ACTIVE LOW
gpio-15 ( |cd ) in lo IRQ ACTIVE LOW

gpiochip1: GPIOs 32-63, parent: platform/30210000.gpio, 30210000.gpio:
gpio-42 ( |reset ) out hi ACTIVE LOW
gpio-51 ( |regulator-usdhc2 ) out hi

gpiochip2: GPIOs 64-95, parent: platform/30220000.gpio, 30220000.gpio:
gpio-80 ( |yellow:status ) out hi

gpiochip3: GPIOs 96-127, parent: platform/30230000.gpio, 30230000.gpio:
gpio-118 ( |PHY reset ) out hi ACTIVE LOW

gpiochip4: GPIOs 128-159, parent: platform/30240000.gpio, 30240000.gpio:
gpio-144 ( |scl ) out lo
gpio-145 ( |sda ) in lo
gpio-146 ( |scl ) out lo
gpio-147 ( |sda ) in lo
gpio-149 ( |wlf,mute ) out hi ACTIVE LOW

gpiochip5: GPIOs 496-511, parent: i2c/2-0020, 2-0020, can sleep:
gpio-497 ( |regulator-audio-boar) out hi

--- disable the sound driver ---
bitbake -c menuconfig virtual/kernel

deselect Device Drivers - Sound card support
save as .config and exit

bitbake imx-image-core
extract <build>/tmp/deploy/images/imx8mn-lpddr4-evk/imx-image-core-imx8mn-lpddr4-evk-<date>.wic.zst
and write the .wic to sd-card

On the device still the same problem:
> gpioset gpiochip3 20=1
gpioset: invalid line value: 'gpiochip3'

Is there something wrong with my changes or something missing?

0 项奖励
回复
1 回复

747 次查看
jimmychan
NXP TechSupport
NXP TechSupport

please try to set "gpiochip2 20=1". not gpiochip3.

 

FYI. https://variwiki.com/index.php?title=MX8M_GPIO

0 项奖励
回复