Hi All
I now need to manually control the w_disable2 pin of the M2 slot on i.mx8QM-MEK for BT control.
I want to use the "gpioset" command directly in the console or control it within my code. However, I am unsure about its correct GPIO number. How can I find out?
Regards,
CH
Hi
I can directly set GPIO374 to 1 or 0 now. And confirm the result by cat /sys/class/gpio/gpio374/value
However, after bringing up the NXP 9098 combo module and successfully executing hciattach,Bluetooth functionality works fine.
At this point, when I set GPIO374 to 1 or 0, I didn't see the 9098 module being reset. Is this behavior normal?
Regards,
CH
Hi
I can directly set GPIO374 to 1 or 0 now. And confirm the result by cat /sys/class/gpio/gpio374/value as below picture,
No matter whether I set GPIO347 to high or low, when I measure pin 54 of the M.2 slot, the result is always high. Can you provide some suggestions?
Hi Chavira
I could see below code on imx8qm-mek.dts,
pinctrl_modem_reset: modemresetgrp {
fsl,pins = <
IMX8QM_QSPI1A_DQS_LSIO_GPIO4_IO22 0x06000021
>;
};
but when I execute $gpioset 4 22=1 , then $gpioget 4 22 ,
the result always is 0, not 1
Do I need to do more modificaton?
Regards,
CH
gpio-374 ( |sysfs ) out hi
gpio-374 ( |sysfs ) out lo
cat /sys/kernel/debug/gpio
gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:
gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpio-341 ( |wp ) in hi
gpio-342 ( |cd ) in hi IRQ
gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-358 ( |ss-sel ) out lo
gpio-359 ( |sw-3p3-sd1 ) out lo
gpio-371 ( |reset ) out hi
gpio-374 ( |sysfs ) in hi
gpio-379 ( |SATA CLKREQ ) out lo
echo 374 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio374/direction
echo 1 > /sys/class/gpio/gpio374/value
echo 0 > /sys/class/gpio/gpio374/value
root@imx8qmmek:~# echo 374 > /sys/class/gpio/export
root@imx8qmmek:~# echo out > /sys/class/gpio/gpio374/direction
root@imx8qmmek:~# echo 1 > /sys/class/gpio/gpio374/value
root@imx8qmmek:~# cat /sys/kernel/debug/gpio
gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:
gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpio-341 ( |wp ) in hi
gpio-342 ( |cd ) in hi IRQ
gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-358 ( |ss-sel ) out lo
gpio-359 ( |sw-3p3-sd1 ) out lo
gpio-371 ( |reset ) out hi
gpio-374 ( |sysfs ) out hi
gpio-379 ( |SATA CLKREQ ) out lo
gpiochip3: GPIOs 384-415, parent: platform/5d0b0000.gpio, 5d0b0000.gpio:
gpiochip2: GPIOs 416-447, parent: platform/5d0a0000.gpio, 5d0a0000.gpio:
gpiochip1: GPIOs 448-479, parent: platform/5d090000.gpio, 5d090000.gpio:
gpio-461 ( |epdev_on ) out hi
gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-511 ( |headphone detect ) in lo IRQ
root@imx8qmmek:~# echo 0 > /sys/class/gpio/gpio374/value
root@imx8qmmek:~# cat /sys/kernel/debug/gpio
gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:
gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpio-341 ( |wp ) in hi
gpio-342 ( |cd ) in hi IRQ
gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-358 ( |ss-sel ) out lo
gpio-359 ( |sw-3p3-sd1 ) out lo
gpio-371 ( |reset ) out hi
gpio-374 ( |sysfs ) out lo
gpio-379 ( |SATA CLKREQ ) out lo
gpiochip3: GPIOs 384-415, parent: platform/5d0b0000.gpio, 5d0b0000.gpio:
gpiochip2: GPIOs 416-447, parent: platform/5d0a0000.gpio, 5d0a0000.gpio:
gpiochip1: GPIOs 448-479, parent: platform/5d090000.gpio, 5d090000.gpio:
gpio-461 ( |epdev_on ) out hi
gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-511 ( |headphone detect ) in lo IRQ
root@imx8qmmek:~#
Hi dTony
After referencing your DTS file and making modifications to the imx8qm-mek.dts,
I am now able to read and write to GPIO 4 22 (gpio374) as per your testing steps.
I greatly appreciate your assistance!
Regards,
CH
cat /sys/kernel/debug/gpio
gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:
gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpio-341 ( |wp ) in hi
gpio-342 ( |cd ) in hi IRQ
gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-358 ( |ss-sel ) out lo
gpio-359 ( |sw-3p3-sd1 ) out lo
gpio-371 ( |reset ) out hi
gpio-374 ( |sysfs ) in hi
gpio-379 ( |SATA CLKREQ ) out lo
echo 374 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio374/direction
echo 1 > /sys/class/gpio/gpio374/value
echo 0 > /sys/class/gpio/gpio374/value
root@imx8qmmek:~# echo 374 > /sys/class/gpio/export
root@imx8qmmek:~# echo out > /sys/class/gpio/gpio374/direction
root@imx8qmmek:~# echo 1 > /sys/class/gpio/gpio374/value
root@imx8qmmek:~# cat /sys/kernel/debug/gpio
gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:
gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpio-341 ( |wp ) in hi
gpio-342 ( |cd ) in hi IRQ
gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-358 ( |ss-sel ) out lo
gpio-359 ( |sw-3p3-sd1 ) out lo
gpio-371 ( |reset ) out hi
gpio-374 ( |sysfs ) out hi
gpio-379 ( |SATA CLKREQ ) out lo
gpiochip3: GPIOs 384-415, parent: platform/5d0b0000.gpio, 5d0b0000.gpio:
gpiochip2: GPIOs 416-447, parent: platform/5d0a0000.gpio, 5d0a0000.gpio:
gpiochip1: GPIOs 448-479, parent: platform/5d090000.gpio, 5d090000.gpio:
gpio-461 ( |epdev_on ) out hi
gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-511 ( |headphone detect ) in lo IRQ
root@imx8qmmek:~# echo 0 > /sys/class/gpio/gpio374/value
root@imx8qmmek:~# cat /sys/kernel/debug/gpio
gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:
gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpio-341 ( |wp ) in hi
gpio-342 ( |cd ) in hi IRQ
gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-358 ( |ss-sel ) out lo
gpio-359 ( |sw-3p3-sd1 ) out lo
gpio-371 ( |reset ) out hi
gpio-374 ( |sysfs ) out lo
gpio-379 ( |SATA CLKREQ ) out lo
gpiochip3: GPIOs 384-415, parent: platform/5d0b0000.gpio, 5d0b0000.gpio:
gpiochip2: GPIOs 416-447, parent: platform/5d0a0000.gpio, 5d0a0000.gpio:
gpiochip1: GPIOs 448-479, parent: platform/5d090000.gpio, 5d090000.gpio:
gpio-461 ( |epdev_on ) out hi
gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-511 ( |headphone detect ) in lo IRQ
root@imx8qmmek:~#
Hi @ChChang!
You have to configure the GPIO in the device tree first.
If you want to power off/wake the Bluetooth function using our Bluetooth/Wifi devices you can do with the commands described in the Linux User guide.
If you have another Bluetooth card please refer to the drivers and commands available for your device.
Best Regards!
Chavira
Hi @ChChang!
Thank you for contacting NXP Support!
According to the schematic of the board, the pin ball is called "QSPI1A_DQS" and by searching in the Reference Manual (page 782) you can mux the pin to GPIO4 IO22.
You can download the documentation by following the links:
Best Regards!
Chavira