How to Activate I2C and UART on Android 6 with Ublox M8N GPS

I have just received the Ublox M8N, connected the I2C and UART, but I can’t get the Ublox UCenter app to read the data from I2C… did the Android 6 we have has support for I2C?

Update

Thanks to @BPI_Justin Justin Chen from BPI, Answer found and solved!

as shown in the pic above, the Ublox M8N GPS is detected as built-in GPS.

to get the UART working for PB0(pin 8, TX) and PB1(pin 10, RX) must modify the sys_config.fex and change the uart2_used = 0 to become 1 as shown below:

[uart2]
uart2_used       = 1
uart2_port       = 2
uart2_type       = 2
uart2_tx         = port:PB0<2><1>< default>< default>
uart2_rx         = port:PB1<2><1>< default>< default>
uart2_rts        = port:PB2<2><1>< default>< default>
uart2_cts        = port:PB3<2><1>< default>< default>

put the GPS driver source to the device folder: android/device/softwinner/bpi-m64-hdmi

then add the following line to bpi-m64-hdmi.mk

#gps $(call inherit-product, device/softwinner/bpi-m64-hdmi/gps/gps.mk

and then rebuilt and repack.

after flashed into the eMMC and booted up, then do the following

adb devices
adb root
adb remount
adb shell

after inside the shell type the following and press enter: setenforce 0

then reboot the device again, it will be detected.

1 Like

please send mail to : [email protected]

Hi. I’m try to the same, but with ublox neo M6 Can you explain better the part of put gps driver source to the device folder? And i did not found the bpi-m64-hdmi.mk

i’m using the imgeRepacker to extract

Hello Chong_Thien_Pow:

   I want to use M3 to accept GPS data, i connected the gps pins to the uart2,also i have must modify the sys_config.fex and change the uart2_used = 0 to become 1 as shown below:

[uart2]
uart2_used = 1
uart2_port = 2
uart2_type = 2
uart2_tx = port:PB0<2><1>< default>< default>
uart2_rx = port:PB1<2><1>< default>< default>
uart2_rts = port:PB2<2><1>< default>< default>
uart2_cts = port:PB3<2><1>< default>< default>

but i can not accept data from the ttys2.

Where did you get the gps driver source? For the M3 , the file is bpi-m3-hdmi.mk ? and where i could find the file? thank you

Nice, but I have a little problem: in the source that i was downloaded has no device/softwinner/bpi-m64-hdmi/gps/gps.mk btw device/softwinner/bpi-m64-hdmi/gps also missed. where can get the gps folder and its content?

You need to get gps driver yourself.I use this driver :https://github.com/zxcwhale/android_hal_gpsbds,and it is work for me!