Closed LeoChang88 closed 2 years ago
If you just issue gpioset command to setting the GPIO value directly, it still failed??
@LeoChang88 Any update?
Hello @wigcheng "gpioset" command is not working, but the "legacy sysfs-based GPIO" way is working.
Very strange, so it's command issue, but I tested here before and it works, could you provide your command detail?
Can I test pin 249 (GPIO4_IO06) directly, or your target pin is another one?
Thanks
I have tested both pin 249 & pin 251 and this is my command history: history.txt
Hmm... I think GPIO249 should be use gpioset gpioset gpiochip1 6=1, could you try again?
It works, but is it inconsistent with the document?
gpioset Set a the value of a GPIO. For example, setting the value of line 9 of gpio bank 3 to 1 below:
root@pico-imx8mm:~# gpioset gpiochip3 9=1
Finding gpio number To use a GPIO its number needs to be known. If we know the bank and io number, the kernel's number can be calculated with
N = (BANK – 1) * 32 + IO
Shell For example GPIO2_IO12 would get the kernel GPIO number
N = (2 – 1) * 32 + 12 = 44
Yeah I know your point, that strange why libgpiod initial sequence is difference with generic gpio way. I think root cause could be this libgpiod is tweaked by me because normal libgpiod is not compatible with android, sorry cause your inconvenience!
I'll fix it later when I have time, and thanks a lot about feedback this bug!
Thank you, should I try Android 10 first? Is it more stable?
No, Android 11 is more stable (kernel was be fine tuned), this is libgpiod bug only, I'll take a look.
OK, I will wait for your new patch.
I fixed this bug already, please update libgpiod and kernel_imx repo and recompile again, should be works.
Any update?
I will test it as soon as possible, thanks.
@wigcheng How can I update libgpiod and kernel_imx repo? I issued the following commands but nothing changed: $ repo init -u https://github.com/technexion-android/manifest -b tn-android-11.0.0_1.2.0_8m-next $ repo sync -j2 $ throw $ source cookers/env.bash.imx8.edm-g-imx8mp.wandboard.hdmi $ merge_restricted_extras $ cook -j2
So did you re-download the source code again? It will auto update if you re-downloaded. A quick way is force delete folders and sync again such as: $ rm -rf (source)/vendor/nxp-opensource/kernel_imx $ rm -rf (source)/external/libgpiod
Sync the source again $ repo sync --force-sync (source)/vendor/nxp-opensource/kernel_imx $ repo sync --force-sync (source)/external/libgpiod
Please try it, thanks :)
@wigcheng I have tried but not working :( Do you need any information?
give me your 'uname -r' information in runtime Android
edm_g_imx8mp:/ # uname -r 5.4.70-gdf5e0707dd2a
You already updated your kernel, that's very strange.... So your gpiochip sequence is the same if you issue 'gpiodetect' command on the runtime stage?
edm_g_imx8mp:/ # 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 [1-0021] (16 lines) gpiochip6 [1-0023] (16 lines)
So it seems fix the issue already, right? Original one is gpiochip0 [30200000.gpio] (32 lines) gpiochip1 [30230000.gpio] (32 lines) gpiochip2 [1-0021] (16 lines) gpiochip3 [1-0023] (16 lines) gpiochip4 [30210000.gpio] (32 lines) gpiochip5 [30220000.gpio] (32 lines) gpiochip6 [30240000.gpio] (32 lines)
I don't know you said the issue still exist is means....???
edm_g_imx8mp:/ # gpioset gpiochip4 6=1 but the status of pin 249 is still low.
For pin 249 case, you should issue command as follows: edm_g_imx8mp:/ # gpioset gpiochip3 6=1
you can use 'gpioinfo' to check specific number first, libgpiod assign gpiochip number from 0, so you need (n-1), n is your real bank number.
Please try again and let me know if works Thanks
gpioset is working now, but the APP GPIOD_JNI_TEST is still not working.
Oops, selinux permission issue on app, just fixed and update source code already, please update these two repos: (source)/system/sepolicy (source)/device/nxp/
Should be works
@wigcheng Is it correct?
It seems you sync failed because you modified the source code, right? a quick way is pull the specific repos manually: cd (source)/system/sepolicy; git pull tn_github tn-android-11.0.0_1.2.0_8m-next cd (source)/device/nxp/; git pull tn_github tn-android-11.0.0_1.2.0_8m-next
Don't forget backup your modified code to avoid disappear.
@wigcheng It works, thank you.
Hello,
I was finished the Android 11 image building for EDM-G-IMX8M-PLUS board, and boot successfully, but I can not using the APP "GPIOD_JNI_TEST" to change the gpio status, For example: pin 249 is GPIO4_IO06 so i choose gpio bank 4 and gpio line 6, but not working.