Forums - failed to run calculator example

19 posts / 0 new
Last post
failed to run calculator example
raziebe
Join Date: 17 Jan 16
Posts: 13
Posted: Wed, 2016-06-29 23:54

Hey

I am trying to run the calculator example on the adsp.  Running it locally is ok , but on the adsp it fails.Logcat claims that I have some directories missing but I DO NOT KNOW WHERE to find them.

E/adsprpc ( 3803): vendor/qcom/proprietary/adsprpc/src/listener_android.c:104:listener using ion heap: -1
E/adsprpc ( 3803): vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:33:apps_std fopen failed: ./libadspmsgd_adsp_skel.so No such file or directory
E/adsprpc ( 3803): vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:33:apps_std fopen failed: /system/lib/rfsa/adsp/./libadspmsgd_adsp_skel.so No such file or directory
E/adsprpc ( 3803): vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:33:apps_std fopen failed: /system/vendor/lib/rfsa/adsp/./libadspmsgd_adsp_skel.so No such file or directory
E/adsprpc ( 3803): vendor/qcom/proprietary/adsprpc/src/../inc/mod_table_imp.h:346::error: 2: 0 == (nErr = invoke_func_ptr(sc, pra))
 

  • Up0
  • Down0
chenna
Join Date: 4 Feb 16
Posts: 54
Posted: Thu, 2016-06-30 01:31

Which target and which SDK are you using ? 

can you please run calc_walkthrough script and share the output of it along with logcat

 

 

  • Up0
  • Down0
raziebe
Join Date: 17 Jan 16
Posts: 13
Posted: Thu, 2016-06-30 05:17

Target: hexagon
Thread model: posix
QuIC LLVM Hexagon Clang version 7.2.12
 "/home/raz/Qualcomm/HEXAGON_Tools/7.2.12/Tools/bin/hexagon-link" -march=hexagon -mcpu=hexagonv60 -shared -call_shared -G0 -o hexagon_Debug_dynamic/libcalculator_skel.so /home/raz/Qualcomm/HEXAGON_Tools/7.2.12/Tools/bin/../target/hexagon/lib/v60/G0/pic/initS.o -L/home/raz/Qualcomm/HEXAGON_Tools/7.2.12/Tools/bin/../target/hexagon/lib/v60/G0/pic -L/home/raz/Qualcomm/HEXAGON_Tools/7.2.12/Tools/bin/../target/hexagon/lib/v60/G0 -L/home/raz/Qualcomm/HEXAGON_Tools/7.2.12/Tools/bin/../target/hexagon/lib -L/home/raz/Qualcomm/HEXAGON_Tools/7.2.12/Tools/bin/../target/hexagon/lib/v60 -Bsymbolic /home/raz/Qualcomm/HEXAGON_Tools/7.2.12/Tools/target/hexagon/lib/v60/G0/pic/libgcc.a --wrap=malloc --wrap=calloc --wrap=free --wrap=realloc --wrap=memalign --wrap=__stack_chk_fail -lc -Map=hexagon_Debug_dynamic/libcalculator_skel.so.map -soname=libcalculator_skel.so --start-group hexagon_Debug_dynamic/calculator_skel.o hexagon_Debug_dynamic/calculator_imp.o --end-group --start-group -lgcc --end-group /home/raz/Qualcomm/HEXAGON_Tools/7.2.12/Tools/bin/../target/hexagon/lib/v60/G0/pic/finiS.o
make: Leaving directory `/opt/Qualcomm/Hexagon_SDK/3.0/examples/common/calculator'
---- root/remount device ----
restarting adbd as root
error: device not found
error: device not found
error: device not found
error: device not found
ERROR: testsig:-o is not a valid 32 bit integer
---- root/remount device ----
adbd is already running as root
remount succeeded
---- Push Android components ----
797 KB/s (32080 bytes in 0.039s)
238 KB/s (12924 bytes in 0.052s)
 ---- Push Hexagon Components ----
324 KB/s (17992 bytes in 0.054s)
---- Run Calculator Example Locally on Android ----

- starting calculator test
adspmsgd not supported
- allocate 4000 bytes from ION heap
- creating sequence of numbers from 0 to 999
- compute sum locally
- sum = 499500
- success

adspmsgd_stop failed
---- Run Calculator Example on aDSP ----

- starting calculator test
adspmsgd not supported
- allocate 4000 bytes from ION heap
- creating sequence of numbers from 0 to 999
- compute sum on the aDSP
Error: compute on aDSP failed

usage: /data/calculator <1/0 run locally> <1/0 logcat> <uint32 size>

adspmsgd_stop failed
Done
raz@raz:/opt/Qualcomm/Hexagon_SDK/3.0/examples/common/calculator$


Error: compute on aDSP failed

usage: /data/calculator <1/0 run locally> <1/0 logcat> <uint32 size>

adspmsgd_stop failed
Done
 

  • Up0
  • Down0
chenna
Join Date: 4 Feb 16
Posts: 54
Posted: Thu, 2016-06-30 21:44

From the log I see that getserail failed to generate testsig. Please try following to get the serial number 

adb shell cat /sys/devices/soc0/serial_number

convert the serial number to hex, and pass it to elfsigner.py as follows 

python tools/elfsigner/elfsigner.py -t serialNum 

testsignature will be saved at tools\elfsigner\output\testsig-xxxx.so 

push it to device 

adb push testsig-xx.so /system/lib/rfsa/adsp/

and try rerunning the calculator 

 

  • Up0
  • Down0
raziebe
Join Date: 17 Jan 16
Posts: 13
Posted: Sun, 2016-07-03 01:08

There is no such file : /sys/devices/soc0/serial_number

I tried sdk 2.0, sdk 3.0 . I am using msm8974 with Android 4.4. kernel 3.4.0 . i cloned it from

[email protected]:lumus-optical/kernel.git

  • Up0
  • Down0
raziebe
Join Date: 17 Jan 16
Posts: 13
Posted: Sun, 2016-07-03 01:09

There is no such file : /sys/devices/soc0/serial_number

I tried sdk 2.0, sdk 3.0 . I am using msm8974 with Android 4.4. kernel 3.4.0 . i cloned it from

[email protected]:lumus-optical/kernel.git

  • Up0
  • Down0
chenna
Join Date: 4 Feb 16
Posts: 54
Posted: Sun, 2016-07-03 21:07

For msm8974 you should use 2.0 SDK, Can you please run testsig.sh and provide the output of it 

  • Up0
  • Down0
raziebe
Join Date: 17 Jan 16
Posts: 13
Posted: Sun, 2016-07-03 23:24

Logging to /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/Elfsigner_log.txt
Signing a file may take up to 3 minutes due to network connectivity. Please wait patiently.
------------------------------------------------------------
Logging to /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/secimage_output/SecImage_log.txt
Config path is set to: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/testsig-0x18faee3_generated_config.xml
WARNING: OEM ID is set to 0 for sign_id "testsig_local"
Output dir is set to: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/secimage_output
Openssl v1.0.1 or greater is available at: "/usr/bin/openssl"
------------------------------------------------------
Processing 1/1: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/opendsp/testsigbase.so

WARNING: Loadable segment - 3 is of size: 4
Signing image: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/opendsp/testsigbase.so
attestation_certificate_extensions = /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/data_prov_assets/General_Assets/Signing/openssl/v3_attest.ext
ca_certificate_extensions = /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/data_prov_assets/General_Assets/Signing/openssl/v3.ext
openssl_configfile = /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/data_prov_assets/General_Assets/Signing/openssl/opensslroot.cfg
Using a predefined Root certificate and a predefined key
Key Used: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/data_prov_assets/Signing/Local/opendsp_presigned_certs-key2048_exp3/qpsa_rootca.key
Certificate Used: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/data_prov_assets/Signing/Local/opendsp_presigned_certs-key2048_exp3/qpsa_rootca.cer
Using a predefined Attestation CA certificate and a predefined key
Key Used: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/data_prov_assets/Signing/Local/opendsp_presigned_certs-key2048_exp3/qpsa_attestca.key
Certificate Used: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/resources/data_prov_assets/Signing/Local/opendsp_presigned_certs-key2048_exp3/qpsa_attestca.cer
Generating new Attestation certificate and a random key

Attestation Certificate Properties:
| SW_ID     | 0x0000000000000000  |
| HW_ID     | 0x0000000000000000  |
| DEBUG     | 0x0000000000000002  |
| OEM_ID    | 0x0000              |
| SW_SIZE   | 264                 |
| MODEL_ID  | 0x0000              |
| SHA256    | True                |
| APP_ID    | None                |
| CRASH_DUMP| None                |
| ROT_EN    | None                |
| Exponent  | 3                   |
| TCG_MIN   | 0x0001E240          |
| TCG_MAX   | 0x0001E240          |
| FID_MIN   | None                |
| FID_MAX   | None                |

Signed image is stored at /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/secimage_output/tcg/testsig_local/testsigbase.so
WARNING: Loadable segment - 5 is of size: 4
Image /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/secimage_output/tcg/testsig_local/testsigbase.so signature is valid
Image /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/secimage_output/tcg/testsig_local/testsigbase.so is not encrypted

Base Properties:
| Integrity Check                 | True  |
| Signed                          | True  |
| Encrypted                       | False |
| Size of signature               | 256   |
| Size of one cert                | 2048  |
| Num of certs in cert chain      | 3     |
| Number of root certs            | 1     |
| Hash Page Segments as segments  | False |
| Cert chain size                 | 6144  |

ELF Properties:
Elf Header:
| Magic                      | ELF                           |
| Class                      | ELF32                          |
| Data                       | 2's complement, little endian  |
| Version                    | 1 (Current)                    |
| OS/ABI                     | No extensions or unspecified   |
| ABI Version                | 0                              |
| Type                       | DYN (Shared object file)       |
| Machine                    | 164                            |
| Version                    | 0x1                            |
| Entry address              | 0x000010b0                     |
| Program headers offset     | 0x00000034                     |
| Section headers offset     | 0x00000000                     |
| Flags                      | 0x00000003                     |
| ELF header size            | 52                             |
| Program headers size       | 32                             |
| Number of program headers  | 5                              |
| Section headers size       | 40                             |
| Number of section headers  | 0                              |
| String table section index | 0                              |

Elf Program Headers:
| S.No |   Type  | Offset | VirtAddr | PhysAddr | FileSize | MemSize | Flags | Align |
|------|---------|--------|----------|----------|----------|---------|-------|-------|
|  1   |   LOAD  | 0x3000 |  0x0000  |  0x0000  |  0x2fc   |  0x2fc  |  0x4  | 0x1000|
|  2   |   LOAD  | 0x4000 |  0x1000  |  0x1000  |  0x104   |  0x104  |  0x5  | 0x1000|
|  3   |   LOAD  | 0x5000 |  0x2000  |  0x2000  |  0x004   |  0x004  |  0x4  | 0x1000|
|  4   |   LOAD  | 0x6000 |  0x4000  |  0x4000  |  0x0d0   |  0x100  |  0x6  | 0x1000|
|  5   | DYNAMIC | 0x6010 |  0x4010  |  0x4010  |  0x0a8   |  0x0a8  |  0x6  | 0x4   |

Hash Segment Properties:
| Header Size  | 40B  |

Header:
| cert_chain_ptr  | 0x00005208  |
| cert_chain_size | 0x00001800  |
| code_size       | 0x000000e0  |
| data_is_none    | 0x00000000  |
| flash_parti_ver | 0x00000003  |
| image_dest_ptr  | 0x00005028  |
| image_id        | 0x00000000  |
| image_size      | 0x000019e0  |
| image_src       | 0x00000000  |
| sig_ptr         | 0x00005108  |
| sig_size        | 0x00000100  |

SecElf Properties:
| image_type        | 0           |
| max_elf_segments  | 100         |
| testsig_serialnum | 0x018faee3  |

------------------------------------------------------

SUMMARY:
Following actions were performed: "sign, validate"
Output is saved at: /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/secimage_output

| Idx |     SignId    | Parse | Integrity | Sign | Encrypt |              Validate              |
|     |               |       |           |      |         | Parse | Integrity | Sign | Encrypt |
|-----|---------------|-------|-----------|------|---------|-------|-----------|------|---------|
|  1. | testsig_local |   T   |     NA    |  T   |    NA   |   T   |     T     |  T   |    F    |

Signing complete! Output saved at /opt/Qualcomm/Hexagon_SDK/2.0/tools/elfsigner/testsigs/testsig-0x18faee3.so
 

  • Up0
  • Down0
raziebe
Join Date: 17 Jan 16
Posts: 13
Posted: Sun, 2016-07-03 23:55

Now I reverted to Snapdragon with Intrinsic's sdk. IntrinsycAPQ8074DragonBoardBSP-KK-2.2 .

I flashed the snapdragon with the supplied binaries and did the entire process from the begining. Same result - .This is /proc/version:

Linux version 3.4.0-g7662155-00014-g59b27a4 (git@build1) (gcc version 4.7 (GCC) ) #4 SMP PREEMPT Tue Sep 23 11:08:22 PDT 2014
The Build Number is msm8974-userdebug 4.4.2 APQ8074_KK_V22 . eng.git.20140911 test-keys.

  • Up0
  • Down0
chenna
Join Date: 4 Feb 16
Posts: 54
Posted: Mon, 2016-07-04 00:18

can you please provide testsig.sh output

  • Up0
  • Down0
raziebe
Join Date: 17 Jan 16
Posts: 13
Posted: Mon, 2016-07-04 01:28

yaeee.... found it.

All I needed to run  was ./tools/scripts/push_adsp.sh images/8074_8084/adsp_proc/ non_reloc

  • Up0
  • Down0
v-jayakumar
Join Date: 4 Feb 18
Posts: 13
Posted: Fri, 2018-06-08 01:45
hi ..i am trying to run calculator example by using .. python calculxxxx.py -T 8996 -D adsp error .. it says /vendor/lib/rfsc/adsp. is read only not able to creat testsigxxxxxxxxx.so file rest all going through ... any advice thanks in advance
  • Up0
  • Down0
v-jayakumar
Join Date: 4 Feb 18
Posts: 13
Posted: Fri, 2018-06-08 01:45
hi ..i am trying to run calculator example by using .. python calculxxxx.py -T 8996 -D adsp error .. it says /vendor/lib/rfsc/adsp. is read only not able to creat testsigxxxxxxxxx.so file rest all going through ... any advice thanks in advance
  • Up0
  • Down0
v-jayakumar
Join Date: 4 Feb 18
Posts: 13
Posted: Fri, 2018-06-08 01:45
hi ..i am trying to run calculator example by using .. python calculxxxx.py -T 8996 -D adsp error .. it says /vendor/lib/rfsc/adsp. is read only not able to creat testsigxxxxxxxxx.so file rest all going through ... any advice thanks in advance
  • Up0
  • Down0
v-jayakumar
Join Date: 4 Feb 18
Posts: 13
Posted: Fri, 2018-06-08 01:45
hi ..i am trying to run calculator example by using .. python calculxxxx.py -T 8996 -D adsp error .. it says /vendor/lib/rfsc/adsp. is read only not able to creat testsigxxxxxxxxx.so file rest all going through ... any advice thanks in advance
  • Up0
  • Down0
v-jayakumar
Join Date: 4 Feb 18
Posts: 13
Posted: Fri, 2018-06-08 01:45
hi ..i am trying to run calculator example by using .. python calculxxxx.py -T 8996 -D adsp error .. it says /vendor/lib/rfsc/adsp. is read only not able to creat testsigxxxxxxxxx.so file rest all going through ... any advice thanks in advance
  • Up0
  • Down0
v-jayakumar
Join Date: 4 Feb 18
Posts: 13
Posted: Fri, 2018-06-08 01:45
hi ..i am trying to run calculator example by using .. python calculxxxx.py -T 8996 -D adsp error .. it says /vendor/lib/rfsc/adsp. is read only not able to creat testsigxxxxxxxxx.so file rest all going through ... any advice thanks in advance
  • Up0
  • Down0
v-jayakumar
Join Date: 4 Feb 18
Posts: 13
Posted: Fri, 2018-06-08 01:46
hi ..i am trying to run calculator example by using .. python calculxxxx.py -T 8996 -D adsp error .. it says /vendor/lib/rfsc/adsp. is read only not able to creat testsigxxxxxxxxx.so file rest all going through ... any advice thanks in advance
  • Up0
  • Down0
v-jayakumar
Join Date: 4 Feb 18
Posts: 13
Posted: Fri, 2018-06-08 01:46
hi ..i am trying to run calculator example by using .. python calculxxxx.py -T 8996 -D adsp error .. it says /vendor/lib/rfsc/adsp. is read only not able to creat testsigxxxxxxxxx.so file rest all going through ... any advice thanks in advance
  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.