VIM3 adding GPS driver files in Android source

Good day. I ordered equipment and found the driver source code on the manufacturer’s website. According to the instructions, the folder is loaded into the hardware directory. After starting the kernel build, such an error:

322/957] including hardware/amlogic/hwcomposer/Android.mk …
“Build HWC 2.0”
[359/957] including hardware/stm/teseo/Android.mk …
hardware/stm/teseo/libteseo.config/Android.mk: libteseo.config: Only vendor modules using LOCAL_USE_VNDK may use LOCAL_COPY_HEADERS
build/make/core/copy_headers.mk:26: error: done.
20:15:41 ckati failed with: exit status 1

How can this be fixed?
And as I understand it, this error indicates that VNDK is turned on. It can be turned off and whether the system will work at the same time and whether the make-up will load the system.img my new driver?
@Terry @goenjoy @Gouwa @tsangyoujun @hyphop

1 Like

Can you provide the stm path for me? And I will confirm it.
Thanks!

1 Like

Link to source: https://github.com/STMicroelectronics/STADG_Teseo_Android_HAL
Link to board: https://www.st.com/en/positioning/teseo-liv3f.html (or Liv3r.html)
A couple of days I tried to figure out the installation myself, but my knowledge was not enough. I’m just starting to learn Khadas and Android Source.
I tried to do the following:

  1. Made such changes in the / hardware / stm / testo folder to each android .mk file, where the lines LOCAL_COPY_HEADERS_TO are present and
    added LOCAL_PROPRIETARY_MODULE: = true
    In the hope that VNDK will cease to give the LOCAL_COPY_HEADERS_TO error
  2. I changed the following lines with the Android.mk file in the hardware / stm / teseo folder: include $ (call all-makefiles-under, $ (LOCAL_PATH)) — I deleted it
    instead, I wrote: include $ (call all-subdir-makefiles)
    Then I made the changes described in the instructions on the github.
    Error VNDK disappeared. The build was completed.
    There is no way to try GPS work yet. I ordered it and he is still on the way. I decided in advance to prepare software for the arrival of the device
    As a result, files and packs of the teeso appeared in the / out folder. The only thing I did not understand was that they wrote on the github: The build should contain the following file /system/lib64/hw/gps.hikey960.so.
    This file should appear as a result of the build of Android or do I need to put it there?

I don’t know if I did everything right :grinning: But if you can, look at the github, see if I can do it))) I have hands, I have a some brain :rofl:

1 Like

The source code is too old, and many compile issues on it.

hardware/amlogic/stm/teseo/libteseo.utils/../include/teseo/utils/Signal.h:300:35: error: unused parameter 'args' [-Werror,-Wunused-parameter]
        void logw(const char * fmt, T... args)
                                         ^
hardware/amlogic/stm/teseo/libteseo.utils/../include/teseo/utils/Signal.h:306:25: error: unused parameter 'fmt' [-Werror,-Wunused-parameter]
        void loge(const char * fmt, T... args)
                               ^
hardware/amlogic/stm/teseo/libteseo.utils/../include/teseo/utils/Signal.h:306:35: error: unused parameter 'args' [-Werror,-Wunused-parameter]
        void loge(const char * fmt, T... args)
                                         ^
In file included from hardware/amlogic/stm/teseo/libteseo.utils/src/NmeaStream.cpp:28:
In file included from hardware/amlogic/stm/teseo/libteseo.utils/../include/teseo/utils/NmeaStream.h:38:
hardware/amlogic/stm/teseo/libteseo.utils/../include/teseo/utils/IByteStream.h:68:2: error: control reaches end of non-void function [-Werror,-Wreturn-type]
        }
        ^
In file included from hardware/amlogic/stm/teseo/libteseo.utils/src/NmeaStream.cpp:28:
hardware/amlogic/stm/teseo/libteseo.utils/../include/teseo/utils/NmeaStream.h:48:2: error: direct base 'Trackable' is inaccessible due to ambiguity:
    class stm::stream::NmeaStream -> class stm::stream::IStream -> class Trackable
    class stm::stream::NmeaStream -> class Trackable [-Werror,-Winaccessible-base]
        public Trackable
        ^~~~~~~~~~~~~~~~
hardware/amlogic/stm/teseo/libteseo.utils/../include/teseo/utils/NmeaStream.h:56:7: error: private field 'continueReading' is not used [-Werror,-Wunused-private-field]
        bool continueReading;

Thanks for the answer!
Do I understand correctly that the problem is from STM?
this cannot be solved by our forces, because Need to rewrite libraries by Pie? Should I write in STM about the issue if I don’t have enough knowledge?)

Yes, you are right. You can write it to STM.

What does STM stand for?

1 Like

Terry hello. I have not been answered from ST about Teseo yet. And I have not yet arrived microcontroller parts. I also bought a GNSS Sim68V module (GPS, Glonass). Connected it to UART (pin 15 and 16). On cat dev\ttyS3 I have a gps data stream. Added lines to device.mk: android.hardware.gnss@1.0-impl \ android.hardware.gnss@1.0-service.
Uploaded gps.default.so to system / lib / hw.

When I start the logcat, the following information comes out:

04-24 18: 04: 34.423 8097 8097 E android.hardware.gnss@1.0-service: Could not get passthrough implementation for android.hardware.gnss@1.0 :: IGnss / default.
04-24 18: 04: 34.854 5074 5074 W Service Management: Waited one second for android.hardware.radio@1.0 :: IRadio / slot1. Waiting another …
04-24 18: 04: 37.855 5074 5074 I chatty: uid = 1001 (radio) com.android.phone identical 3 lines
04-24 18: 04: 38.855 5074 5074 W Service Management: Waited one second for android.hardware.radio@1.0 :: IRadio / slot1. Waiting another …
04-24 18: 04: 39.419 3300 3300 W hwservicemanager: getTransport: Cannot find entry android.hardware.gnss@1.0 :: IGnss / default in either framework or device manifest.
04-24 18: 04: 39.426 8099 8099 E GnssHAL_GnssInterface: gnss hw_get_module gps failed: -2

And there is no way to enable location in the menu. Only on and off.
here are a few questions:

  1. Are GNSS errors related to the incorrect installation of the gps.android.so library?
  2. GNSS errors associated with the fact that in the source GNSS and GPS are disabled?
    In general, what needs to be done to enable GPS via UART? Do you need to switch the UART mode?

While I have a lot of free time, I would like to deal with this GPS to the end, so that by the next release of firmware for Khadas there was a ready-made solution. A lot of people are waiting for GPS because they use VIM in cars.

When I write a logcat / grep gps, the following comes out:

04-24 18:24:43.201  6017  6017 E GnssHAL_GnssInterface: gnss hw_get_module gps failed: -2
04-24 18:24:48.209  6021  6021 E GnssHAL_GnssInterface: gnss hw_get_module gps failed: -2
04-24 18:24:53.207  6022  6022 E GnssHAL_GnssInterface: gnss hw_get_module gps failed: -2

Then I tried to transfer the file gps.default.so to /vendor/lib/hw and the following errors appeared in the logcat:

04-24 20:20:11.119  3303  3303 W hwservicemanager: getTransport: Cannot find entry android.hardware.gnss@1.0::IGnss/default in either framework or device manifest.
04-24 20:20:11.123  7547  7547 E vndksupport: Could not load /vendor/lib/hw/gps.default.so from default namespace: dlopen failed: library "libstdc++.so" not found.
04-24 20:20:11.123  7547  7547 E HAL     : load: module=/vendor/lib/hw/gps.default.so
04-24 20:20:11.123  7547  7547 E HAL     : unknown
04-24 20:20:11.123  7547  7547 E GnssHAL_GnssInterface: gnss hw_get_module gps failed: -22
04-24 20:20:11.125  7547  7547 E android.hardware.gnss@1.0-service: Could not get passthrough implementation for android.hardware.gnss@1.0::IGnss/default.
04-24 20:20:11.868  5069  5069 W ServiceManagement: Waited one second for android.hardware.radio@1.0::IRadio/slot1.

@Terry
In general, I spent half a night, I don’t remember what I was doing))))
Changed libraries, made changes to the source code.
Found the manifest in the folder /device/hadas/common/product/mbox/manifest/manifest_aosp.hml
Added the following to it:

+    <hal format="hidl">
+       <name>android.hardware.gnss</name>
+       <transport>hwbinder</transport>
+       <version>1.0</version>
+       <interface>
+           <name>IGnss</name>
+           <instance>default</instance>
+       </interface>
+   </hal>
+
 </manifest>

After burn firmware, GNSS and GPS data began to appear in the logcat:

01-01 12:06:38.330  7974  7988 E GnssLocationProvider: no AGPS interface in set_agps_server
01-01 12:06:38.975  3433  3433 E gps_glonass_serial: Setting gps baud rate to 9600
01-01 12:06:38.976  7974  7988 E GnssLocationProvider: no AGPS interface in set_agps_server
01-01 12:06:39.977  7974  8028 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556161,14.062525 hAcc=1 et=?!? vel=0.5453111 bear=335.38 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:40.818  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556161,14.062517 hAcc=1 et=?!? alt=38.0 vel=0.5195889 bear=329.97 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:41.813  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556165,14.062517 hAcc=1 et=?!? alt=38.0 vel=0.0 bear=343.93 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:42.793  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556169,14.062517 hAcc=1 et=?!? alt=12.08vel=0.4372778 bear=336.09 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:43.797  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556169,14.062513 hAcc=1 et=?!? alt=12.08 vel=0.41155556 bear=337.81 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:44.806  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556172,14.062513 hAcc=1 et=?!? alt=12.089998474121094 vel=0.40126666 bear=335.2 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:45.805  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556172,14.062513 hAcc=1 et=?!? alt=12.089998474121094 vel=0.0 bear=326.03 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:46.783  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556169,14.062513 hAcc=1 et=?!? alt=12.089998474121094 vel=0.4527111 bear=312.19 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:47.813  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556169,14.062510 hAcc=1 et=?!? alt=12.089998474121094 vel=0.0 bear=312.19 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:48.846  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556169,14.062510 hAcc=1 et=?!? alt=12.089998474121094 vel=0.0 bear=312.19 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:49.852  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556169,14.062510 hAcc=1 et=?!? alt=12.089998474121094 vel=0.0 bear=312.19 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:50.816  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556169,14.062510 hAcc=1 et=?!? alt=12.089998474121094 vel=0.0 bear=312.19 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:51.847  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.5569,14.062510 hAcc=1 et=?!? alt=12.088998474121094 vel=0.40126666 bear=297.74 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:52.871  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.556169,14.062510 hAcc=1 et=?!? alt=12.089998474121094 vel=0.0 bear=312.19 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:53.826  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 49.559.732510 hAcc=1 et=?!? alt=12.088474121094 vel=0.0 bear=312.19 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:54.814  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 4.5169,14.062510 hAcc=1 et=?!? alt=38.099998474121094 vel=0.0 bear=312.19 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:55.827  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 46.543169,14.062510 hAcc=1 et=?!? alt=12.756756 vel=0.41155556 bear=325.79 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:56.819  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 43.596169,14.062498 hAcc=1 et=?!? alt=37.900001525878906 vel=0.4835778 bear=337.63 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:57.818  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt=38.0 vel=0.49386665 bear=325.42 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:58.817  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 4 hAcc=1 et=?!? alt=38.0 vel=0.8076778 bear=309.01 vAcc=??? sAcc=??? bAcc=???])
01-01 12:06:59.816  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 47 hAcc=1 et=?!? alt=38.0 vel=0.8436889 bear=315.34 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:00.860  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 3 hAcc=1 et=?!? alt= vel=0.79224443 bear=321.25 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:01.816  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.68421113 bear=320.44 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:02.780  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.4167 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:03.799  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt=38.5 vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:04.780  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt=38.5 vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:05.760  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:06.759  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt=6 vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:07.758  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 7 hAcc=1 et=?!? alt=vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:08.738  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 7 hAcc=1 et=?!? alt=06 vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:09.729  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps 2487 hAcc=1 et=?!? alt= vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:10.719  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:11.853  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:12.739  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:13.735  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:14.750  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])
01-01 12:07:15.758  7974  8356 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_LOCATION, 1, Location[gps  hAcc=1 et=?!? alt= vel=0.0 bear=327.12 vAcc=??? sAcc=??? bAcc=???])

But at the same time, the system boots up for a long time, during its operation a black screen constantly appears and the desktop reboots. He writes that SystemUI is not responding. Shows the Wifi network but does not connect to them. And still not possible to install any .apk
Below I apply a general logcat, please help me sort out!!)))

01-01 12:07:25.310  9081  9106 V AVUtils : AVUtils::getComponentRole
01-01 12:07:25.311  9081  9106 I OMXClient: IOmx service obtained
01-01 12:07:25.311  3540  3540 I OMXMaster: makeComponentInstance(OMX.google.h263.decoder) in omx@1.0-service process
01-01 12:07:25.313  3540  3540 E OMXNodeInstance: getExtensionIndex(0xb191cba0:google.h263.decoder, OMX.google.android.index.configureVideoTunnelMode) ERROR: UnsupportedIndex(0x8000101a)
01-01 12:07:25.314  3540  3540 E OMXNodeInstance: getExtensionIndex(0xb191cba0:google.h263.decoder, OMX.google.android.index.enableAndroidNativeBuffers) ERROR: UnsupportedIndex(0x8000101a)
01-01 12:07:25.320  3540  8349 D OmxVideoDecoder: setInputCoding video_decoder.hevc
01-01 12:07:25.321  3540  8349 E OMXNodeInstance: getParameter(0xb1903bac:amlogic.hevc.decoder.awesome, ParamVideoProfileLevelQuerySupported(0x600000f)) ERROR: BadParameter(0x80001005)
01-01 12:07:25.321  3540  8349 D OmxComponent: getExtensionIndex 1123 name="OMX.google.android.index.describeColorFormat"
01-01 12:07:25.327  3540  3540 E OMXNodeInstance: getExtensionIndex(0xb191cba0:google.hevc.decoder, OMX.google.android.index.configureVideoTunnelMode) ERROR: UnsupportedIndex(0x8000101a)
01-01 12:07:25.327  3540  3540 E OMXNodeInstance: getExtensionIndex(0xb191cba0:google.hevc.decoder, OMX.google.android.index.enableAndroidNativeBuffers) ERROR: UnsupportedIndex(0x8000101a)
01-01 12:07:25.328  9081  9106 I AmAVUtils: AmAVUtils::getComponentRole isEncoder :0 mime:video/mjpeg 
01-01 12:07:25.328  9081  9106 V AVUtils : AVUtils::getComponentRole
01-01 12:07:25.369  3540  3540 V AmlogicSoftOMXPlugin: destroyComponentInstance 113
01-01 12:07:25.373  9081  9106 I AmAVUtils: AmAVUtils::getComponentRole isEncoder :0 mime:video/rm40 
01-01 12:07:25.373  9081  9106 V AVUtils : AVUtils::getComponentRole
01-01 12:07:25.374  9081  9106 I OMXClient: IOmx service obtained
01-01 12:07:25.374  3540  8349 I OMXMaster: makeComponentInstance(OMX.amlogic.rm40.decoder.sw) in omx@1.0-service process
01-01 12:07:25.374  3540  8349 V AmlogicSoftOMXPlugin: makeComponentInstance 101

If necessary, there is a full logcat

UPD.
If I remove GNSS data from the manifest, then the device works fine.

Thank’s!)))

understood further. As a result, GPS started. but there is one problem, until the given data from the GPS in the GNSS system hangs and taps. as soon as the data appears - while everything is working fine

It seems that GPS defeated. STM promises to release the source code by the end of Q2 2020. Until the Teseo binding came, I use the Sim68 GNSS module. On tests, everything works fine.! connected everything via UART so as not to occupy the USB port
image|666x500

1 Like

Very cool! You love to see it!

Thanks for your efforts. What’s the model of your GPS? And Can you provide the gps.default.so source code for me? I will buy it and have a test.

1 Like

Hello Terry. I’ll will be sent library in a few days. Need more time to debug it on my Vim3 & Vim3L. The module is Sim68V.
I testing all functions of it. All is working (on-off location, gps,glonass).And it’s working on GPIO UART.

Is it source code?
Can you provide the purchase link for me?

No, it’s only a library, no source code.
I bought Sim68V in russia. Only module, without electronic components and a board. its operation requires a board with power components, communication lines and antenna components.