This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Trouble Running Executable - Sitara EVM



Hi,

I have troubles invoking an executable on Sitrara EVM. Here is what I did:

1) Firstly, I invoked the environment setup script

bh@bh-laptop:~$ source ti-sdk-am335x-evm-06.00.00.00/linux-devkit/environment-setup
[linux-devkit]:~>

2) Next I compiled the source code

3) I checked the executable for compliance

[linux-devkit]:~/MTest/test/src> file test
test: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.31, not stripped

4) Copied the executable " test" to the target file system

5) Tried to invoke the executable from the Sitara EVM.

The following occurs:

root@am335x-evm:~/Test# test                                          
-sh: /home/root/Test/test: No such file or directory


But the executable is present in this directory. In order to confirm this I do the following:

root@am335x-evm:~/Test# ls | grep test                            
test    
root@am335x-evm:~/Test# ls -l | grep test                         
-rwxr-xr-x    1 root     root        172778 Aug  8  2013 test 

Need some help on figuring this out.

Thanks.


  • Try running ./test instead.

    In Linux you have to specify where the file is located even if it is in the present working directory (note that specifying the current directory in the PATH environment variable is acceptable).

    Running ./test is comparable to typing out /home/root/Test/test

  • Hi Tim,

    Thanks for the response. I forgot to mention this in the previous post.  I had updated the environment variable using

    export PATH=$PATH:/home/root/Test

    None the less, the result is the same.

  • Echo the PATH for me?

    Do you get the same result if you just try to run it locally (./test)?If it were built improperly you should receive an error similar to cannot execute binary file.

  • Hi Tim,

    The problem persists despite the attempt to execute it locally. Please refer to the log for PATH variable and local execution results:

    root@am335x-evm:~/Test# ./test                                   
    -sh: ./test: No such file or directory                                     
    root@am335x-evm:~/Test# $PATH                                          
    -sh: /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin: No such file
    or directory                                                                    
    root@am335x-evm:~/Test# export PATH=$PATH:/home/root/Test    
    root@am335x-evm:~/Test# echo $PATH                                     
    /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/root/Test                                                                           
    root@am335x-evm:~/Test# test                                      
    -sh: /home/root/Test/test: No such file or directory 


    Thanks

  • The error message "No such file or directory" is missleading.

    You have created an executable with dynamic linking.

    And you forget to transfer the dynamic libraries to the target into the /lib directory.

    (Or you have used the wrong dynamic libraries for linking).

    The linux loader on the target can not resolve the dynamic linking, and fails to load the application.

    regards

    Wolfgang

  • Hi Wolfgang,

    That did the trick. I missed copying the dynamic libraries.

    Thanks a bunch for the tip.

    Regards.

  • I am sorry to revive this old thread but I think I am having the same issue as described here.

    But I am unsure of what libraries to copy from where (on the host) to where (on the target).

    Thanks

  • Use the program ldd on the host to check which dynamic libraries you are needing.