GDB Remote Linux connection

To start the GDB Remote Linux debugging the following steps should be executed on a Linux target. Use the COM-port terminal with the following settings: 115200 b/s 8 bits, no parity, 1 stop bit. For example:


putty

  1. Login as “root” (or create another Linux user).
  2. Set the password for root (passwd):
    # passwd
  3. Execute the ifconfig command to obtain ip address.
    root@s32v234evb:~# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:1b:c3:12:34:22
              inet addr:10.222.24.206  Bcast:10.222.24.255  Mask:255.255.255.0
              inet6 addr: fe80::21b:c3ff:fe12:3422/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:709 errors:0 dropped:1 overruns:0 frame:0
              TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:91479 (89.3 KiB)  TX bytes:1512 (1.4 KiB)
    
    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:65536  Metric:1
              RX packets:10 errors:0 dropped:0 overruns:0 frame:0
              TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:700 (700.0 B)  TX bytes:700 (700.0 B)
    

    To set remote connection from S32DS:

    1. Choose the C/C++ Remote Application launch configuration.


    Remote launch configuration

    2.Select SSH connection:


    SSH

    3. Set connection options:
    • Connection name
    • Host information:
      • Host - the address from “ifconfig” command executed on the Linux target.
      • User - the user name.
      • Password - the password which was set with “passwd” command on the Linux target.

    For example:


    Connection options

    4. Select created connection:


    Select connection

    5. Press Debug.

The connection is established and the executable file is loaded on the board:
cd /home/root/vsdk;gdbserver  :2345 /home/root/vsdk/apex2_fac 
e_detection.elf;exit
Process /home/root/vsdk/apex2_face_detection.elf created; pid = 912
Listening on port 2345
Remote debugging from host 10.222.24.157
Note: If the created connection was established at least once and the board was switched off/on after that, an error message shows due to GDB remote debugger restriction. Restart the application again or create another connection.