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.

how to execute c programe in OMAPL138 LCDK

Other Parts Discussed in Thread: OMAPL138

hi

i hv tried to run c program in OMAPl138LCDK i have followed the link which is

http://processors.wiki.ti.com/index.php/OMAP-L138_LCDK_Linux_SDK_Getting_Started_Guide#Edit_and.C2.A0compile_.22Hello_World.21.22

by following this link i verified the PATH which is step 3 given on link

3) Verify that your path has been updated to include the GCC tool chain provided by the SDK using the command:

after this step

when i maked the hello.c file and tried to cross compile it using

Cross-compile the program:

host $ arm-arago-linux-gnueabi-gcc hello.c –o hello

i am getting errors which is

 

[linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> arm-arago-linux-gnueabi-gcc --version
arm-arago-linux-gnueabi-gcc (GCC) 4.5.3 20110311 (prerelease)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> ls
bin dsp-tools Hello.c Rules.make
board-support example-applications host-tools setup.sh
docs filesystem linux-devkit
[linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> arm-arago-linux-gnueabi-gcc Hello.c –o Hello
arm-arago-linux-gnueabi-gcc: –o: No such file or directory
arm-arago-linux-gnueabi-gcc: Hello: No such file or directory
[linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00>

i cant able to compile the Hello.c file there

Plz help

  • Hi Vivek,

    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> arm-arago-linux-gnueabi-gcc Hello.c –o Hello
    arm-arago-linux-gnueabi-gcc: –o: No such file or directory
    arm-arago-linux-gnueabi-gcc: Hello: No such file or directory
    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00>

    I suspect that the problem is due to –o given instead "-o" in compiler args.

    Better to avoid "-o"

    Ex:

    arm-arago-linux-gnueabi-gcc  hello.c

    The default "a.out" output file will get generated and run "a.out" on your target OMAPL138 LCDK board.

    target# ./a.out

    Try this and let me know.

  • i successfully complies the Hello programe and binary file is create on that folder now i want to copy the binary file to the LCDk through ethernet i connected the cable to my pc to LCDK after that i got

     

    root@omapl138-lcdk:~# PHY: 0:07 - Link is Up - 100/Full
    root@omapl138-lcdk:~# ls

    i executed ifconfig i got

    root@omapl138-lcdk:~# ifconfig
    eth0 Link encap:Ethernet HWaddr 7A:8C:18:A1:FE:72
    inet6 addr: fe80::788c:18ff:fea1:fe72/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:96 errors:0 dropped:0 overruns:0 frame:0
    TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:33120 (32.3 KiB) TX bytes:48258 (47.1 KiB)
    Interrupt:33

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    root@omapl138-lcdk:~#

    so igot the ip address as this  127.0.0.1 marked above

    for sending the binary file to the kit i run this command on host PC

    scp hello root@<LCDK IP address>:/home/root/

    which is like

    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> scp Hello root@127.0.0.1:/home/root/
    ssh: connect to host 127.0.0.1 port 22: Connection refused
    lost connection
    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00>

    i cant able to send the file through the ethernet

    PLZ help 

     

  • Hi,

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0

    This is a loop back interface and not actual IP.

    1) Connect ethernet cable between your PC to target board.

    target# ifconfig eth0 10.100.1.1 up

    host-linux-PC$ sudo  ifconfig eth0 10.100.1.2 up

    2) Now, Test ethernet connection between two devices through  pinging.

    3) target# ping 10.100.1.2 (pinging PC IP addr)

    4) host-linux-PC$ ping 10.100.1.1 (pinging target board IP addr)

    5) If it works & pinging successfully then exchange files between devices through scp

  • it connects for some seconds not more than 10 sec and then automatically getting disconnected and gain i give command sudo  ifconfig eth0 10.100.1.2 up it again connects and disconnects automatically

    it happens from both the sides it automatically disconnects.

    root@omapl138-lcdk:/# ifconfig eth0 10.100.1.1 up
    root@omapl138-lcdk:/# ping 10.100.1.2
    PING 10.100.1.2 (10.100.1.2): 56 data bytes
    64 bytes from 10.100.1.2: seq=0 ttl=64 time=3.242 ms
    64 bytes from 10.100.1.2: seq=1 ttl=64 time=0.606 ms
    64 bytes from 10.100.1.2: seq=2 ttl=64 time=0.719 ms
    64 bytes from 10.100.1.2: seq=3 ttl=64 time=0.741 ms
    64 bytes from 10.100.1.2: seq=4 ttl=64 time=0.667 ms
    64 bytes from 10.100.1.2: seq=5 ttl=64 time=0.724 ms
    64 bytes from 10.100.1.2: seq=6 ttl=64 time=0.725 ms
    64 bytes from 10.100.1.2: seq=7 ttl=64 time=0.736 ms
    64 bytes from 10.100.1.2: seq=8 ttl=64 time=0.631 ms
    64 bytes from 10.100.1.2: seq=9 ttl=64 time=0.758 ms
    64 bytes from 10.100.1.2: seq=10 ttl=64 time=0.719 ms
    64 bytes from 10.100.1.2: seq=11 ttl=64 time=0.728 ms
    64 bytes from 10.100.1.2: seq=12 ttl=64 time=0.733 ms
    64 bytes from 10.100.1.2: seq=13 ttl=64 time=0.553 ms
    64 bytes from 10.100.1.2: seq=14 ttl=64 time=0.632 ms
    64 bytes from 10.100.1.2: seq=15 ttl=64 time=0.582 ms
    64 bytes from 10.100.1.2: seq=16 ttl=64 time=0.634 ms
    64 bytes from 10.100.1.2: seq=17 ttl=64 time=0.628 ms

    --- 10.100.1.2 ping statistics ---
    33 packets transmitted, 18 packets received, 45% packet loss
    round-trip min/avg/max = 0.553/0.819/3.242 ms

    i cant able to transfer file

  • Hi,

    Are you in LAN connection (campus or college) or open IP connection through data card or some thing?

    If it so, You can't

    If you are connected to the LAN network,

    Connect your PC to your LAN and connect your target board to LAN through different ethernet cable,

    then run the "dhcpc" command on OMAPL138 LCDK board after that you will get IP address for your board through DHCP protocol.

  • i hv tried in LAN connection as u have posted but dhcpc command is not working on LCDK so i tried to know ip address through ifconfig i got

    root@omapl138-lcdk:/# dhcpc
    -sh: dhcpc: not found
    root@omapl138-lcdk:/# ifconfig
    eth0 Link encap:Ethernet HWaddr F2:9C:85:08:54:91 
    inet addr:192.168.1.171 Bcast:0.0.0.0 Mask:255.255.255.0
    inet6 addr: fe80::f09c:85ff:fe08:5491/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:15094 errors:0 dropped:57 overruns:0 frame:0
    TX packets:414 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000 
    RX bytes:1418508 (1.3 MiB) TX bytes:84591 (82.6 KiB)
    Interrupt:33

    lo Link encap:Local Loopback 
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:57 errors:0 dropped:0 overruns:0 frame:0
    TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0 
    RX bytes:6384 (6.2 KiB) TX bytes:6384 (6.2 KiB)

    root@omapl138-lcdk:/#

    i got the ip address as 192.168.1.171

    i pinged the ip adrress of my PC it pings which is

    root@omapl138-lcdk:/# ping 192.168.1.126
    PING 192.168.1.126 (192.168.1.126): 56 data bytes
    64 bytes from 192.168.1.126: seq=0 ttl=64 time=0.882 ms
    64 bytes from 192.168.1.126: seq=3 ttl=64 time=0.733 ms
    64 bytes from 192.168.1.126: seq=4 ttl=64 time=0.731 ms
    64 bytes from 192.168.1.126: seq=5 ttl=64 time=0.706 ms
    64 bytes from 192.168.1.126: seq=6 ttl=64 time=0.653 ms
    64 bytes from 192.168.1.126: seq=7 ttl=64 time=0.735 ms
    64 bytes from 192.168.1.126: seq=9 ttl=64 time=0.739 ms
    64 bytes from 192.168.1.126: seq=10 ttl=64 time=0.740 ms
    64 bytes from 192.168.1.126: seq=11 ttl=64 time=0.704 ms
    64 bytes from 192.168.1.126: seq=13 ttl=64 time=0.725 ms
    64 bytes from 192.168.1.126: seq=14 ttl=64 time=0.852 ms
    64 bytes from 192.168.1.126: seq=15 ttl=64 time=0.728 ms
    64 bytes from 192.168.1.126: seq=16 ttl=64 time=0.759 ms
    64 bytes from 192.168.1.126: seq=21 ttl=64 time=0.764 ms
    64 bytes from 192.168.1.126: seq=22 ttl=64 time=0.741 ms
    64 bytes from 192.168.1.126: seq=23 ttl=64 time=0.723 ms
    64 bytes from 192.168.1.126: seq=25 ttl=64 time=0.729 ms
    64 bytes from 192.168.1.126: seq=27 ttl=64 time=0.732 ms
    64 bytes from 192.168.1.126: seq=28 ttl=64 time=0.746 ms

    --- 192.168.1.126 ping statistics ---
    30 packets transmitted, 19 packets received, 36% packet loss
    round-trip min/avg/max = 0.653/0.743/0.882 ms
    root@omapl138-lcdk:/#

    i also pinged the LCDK ip from PC which comes

    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> ping 192.168.1.171

    PING 192.168.1.171 (192.168.1.171) 56(84) bytes of data.
    64 bytes from 192.168.1.171: icmp_req=1 ttl=64 time=0.415 ms
    64 bytes from 192.168.1.171: icmp_req=2 ttl=64 time=0.399 ms
    64 bytes from 192.168.1.171: icmp_req=4 ttl=64 time=0.384 ms
    64 bytes from 192.168.1.171: icmp_req=5 ttl=64 time=0.393 ms
    64 bytes from 192.168.1.171: icmp_req=7 ttl=64 time=0.420 ms
    64 bytes from 192.168.1.171: icmp_req=8 ttl=64 time=0.433 ms
    64 bytes from 192.168.1.171: icmp_req=10 ttl=64 time=0.411 ms
    64 bytes from 192.168.1.171: icmp_req=11 ttl=64 time=0.402 ms
    64 bytes from 192.168.1.171: icmp_req=12 ttl=64 time=0.392 ms
    64 bytes from 192.168.1.171: icmp_req=13 ttl=64 time=0.406 ms
    64 bytes from 192.168.1.171: icmp_req=14 ttl=64 time=0.374 ms
    64 bytes from 192.168.1.171: icmp_req=16 ttl=64 time=0.405 ms
    64 bytes from 192.168.1.171: icmp_req=17 ttl=64 time=0.410 ms
    64 bytes from 192.168.1.171: icmp_req=19 ttl=64 time=0.450 ms
    64 bytes from 192.168.1.171: icmp_req=23 ttl=64 time=0.425 ms
    64 bytes from 192.168.1.171: icmp_req=25 ttl=64 time=0.372 ms
    64 bytes from 192.168.1.171: icmp_req=26 ttl=64 time=0.388 ms
    64 bytes from 192.168.1.171: icmp_req=30 ttl=64 time=0.394 ms
    64 bytes from 192.168.1.171: icmp_req=33 ttl=64 time=0.411 ms
    64 bytes from 192.168.1.171: icmp_req=34 ttl=64 time=0.385 ms
    ^C
    --- 192.168.1.171 ping statistics ---
    34 packets transmitted, 20 received, 41% packet loss, time 32998ms
    rtt min/avg/max/mdev = 0.372/0.403/0.450/0.026 ms
    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00>

    when i used scp command to copy it stucks to that only for long and could not copy

    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> ls
    bin dsp-tools Hello linux-devkit Rules.make
    board-support example-applications Hello.c pira setup.sh
    docs filesystem host-tools pyramis.cpp
    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> scp Hello root@192.168.1.171:/home/root/

  • Hi,

    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> ls
    bin dsp-tools Hello linux-devkit Rules.make
    board-support example-applications Hello.c pira setup.sh
    docs filesystem host-tools pyramis.cpp
    [linux-devkit]:/home/vivek/Desktop/ti-sdk-omapl138-lcdk-01.00.00> scp Hello root@192.168.1.171:/home/root/

    This command is used wrongly,

    scp means "shell copy" that you can only copy/get the file from any PC through LAN but you can't put/send.( thats what your command doing)

    I assume that your target IP is 192.168.1.171 and host PC IP is 192.168.1.126

    If you want to get the file from PC to target,

    target# scp -r vivek@192.168.1.126:/home/vivek/Desktop/Hello /home/root/

    If you want to get the file from target to PC,

    host-ubuntu# scp -r root@192.168.1.171:/home/root/Hello2 /home/vivek/Desktop/

    Please let me know the status.

  • i done this scp command to get file from host to target.. 

    /usr/bin/dbclient: exited: Error connecting: Connection refused.

  • Hi,

    Try to install "sshd" daemon (sudo apt-get install sshd) on host and then try scp command from target.

    If issue persists, Create new post for your issue,

  • thank uuu .... its working

    i executed sqlite3 in target.. 

    i transferred file through scp... 

  • Hi,

    Sounds good,

    Thanks for your update.