Using signed images on the Hexagon DSP

Using signed images on the Hexagon DSP

The fastrpc shell will load either signed or unsigned images. Unsigned images have restrictions signed images don’t. This example will show the steps needed to permit usage of signed images on the device.

  • Get the device serial number:
    • cat /sys/devices/soc0/serial_number
    • 3141592653
  • On the machine with the SDK installed go to <HEXAGON_SDK_ROOT>/tools/elfsigner
    • elfsigner.py -t 3141592653

This will create a file: output/testsig-0xbb40e64d.so

  • Copy this file to the RubikPI/usr/lib/dsp/cdsp
    • scp output/testsig-0xbb40e64d.so rubikpi:/tmp
  • Back on the RubikPI, copy from /tmp to the DSP library directory
    • sudo cp /tmp/testsig-0xbb40e64d.so /usr/lib/dsp/cdsp

Now when using run_main_on_hexagon the option unsigned_pd=0 should work.

Errors you may see:

  • Not running with sudo:
./run_main_on_hexagon 3 random.so stack_size=0x50000 unsigned_pd=0
Attempting to run on signed PD on domain 3
Domain 3 failed to open (0x72), run_main_on_hexagon_URI_domain: file:///librun_main_on_hexagon_skel.so?run_main_on_hexagon_skel_handle_invoke&_modver=1.0&_dom=cdsp
Error 114: Failed to call main() on DSP
Failed to close handle

I could not get this to work without sudo. Any tips?

  • Messed up the testsig.so. Wrong location, maybe wrong serial number (the one above is not valid)
 sudo ./run_main_on_hexagon 3 random.so stack_size=0x50000 unsigned_pd=0
Attempting to run on signed PD on domain 3
Domain 3 failed to open (0x80000406), run_main_on_hexagon_URI_domain: file:///librun_main_on_hexagon_skel.so?run_main_on_hexagon_skel_handle_invoke&_modver=1.0&_dom=cdsp
Error -2147482618: Failed to call main() on DSP
Failed to close handle

Thank you for sharing this information.