Debugging Linux project on a VDK

This topic describes how to start a debug session for a Linux project in the simulation environment. Before you proceed, make sure that you have downloaded VDK , installed the simulation software and set the required environment variables. For details, refer to S32DS Installation Guide > Installing Synopsys tools.

When using a certain VDK for the first time, add the VDK configuration files to the Synopsys workspace: launch Virtualizer Studio with the Run as administrator option and select your target from the Fixed VDKs list on the Welcome page.

  1. Before simulating debug session on a Linux target for the first time, setup your environment:
    1. Download Linux BSP from the Automotive SW - Linux product list on the nxp.com website.
    2. Copy the following files from the s32<mcu>sim folder to vdk_workspace/NXP_S32<mcu>_ECU/software/s32xxxx_gen1/output:
      • fsl-image-auto-s32<mcu>sim.cpio.gz
      • Image
      • Image-s32<mcu>-simulator.dtb
      • u-boot-s32<mcu>sim.bin
    3. Open the vdk_workspace/NXP_S32<mcu>_ECU/vpconfigs/s32<mcu>_linux/s32<mcu>_linux.vpcfg file and edit the last paramOverrides value to use fsl-image-auto-s32<mcu>xsim.cpio.gz:
      value="{../../software/s32xxxx_gen1/output/fsl-image-auto-s32<mcu>xsim.cpio.gz,0x4000000,,image,} {../../software/s32xxxx_gen1/output/Image,0x80000,,image,} {../../software/s32xxxx_gen1/output/Image-s32<mcu>-simulator.dtb,0x2000000,,image,}
    4. Install the VHub utility to support Real World I/O for Synopsys Ethernet models. The installer is located in the vdk_workspace/NXP_S32<mcu>_ECU/bin/VirtualAndRealWorldIO/VHub folder.
    5. Install the VHub Protocol driver. For details, refer to VHub User Guide > Installing VHub on Windows (vdk_workspace/NXP_S32<mcu>_ECU/bin/Documentation/IPDocs/DESIGNWARE_ETHERNET/IP_VHubUserGuide.pdf).

    Now the environment is ready for debugging Linux project on a VDK.

  2. Launch VHub with the Run as administrator option.


    Run VHub

  3. In Virtualizer Studio, click VDK Debug > Launch Simulation using VP Config on the menu bar.
  4. In the Open VP Config dialog box, specify the following settings:
    • VP Project: Locate the snps.vpproject file from the vdk_workspace/NXP_S32<mcu>_ECU folder.
    • VP Config: Select the s32<mcu>_linux configuration.

    Make sure that option Launch simulation after opening VP Config is selected.

  5. Click OK to start simulation. This procedure may take a few minutes.
  6. (Optional) When the simulator has stopped at the initial_crunch breakpoint, check the Vhub Port status:


    VHub port status

  7. By default, simulation is suspended. Click Resume (Resume suspended simulation) on the toolbar.
  8. Go to the LIN_MONITOR_0_B terminal view and login as root. You can use the U-boot run bootcmd command.
  9. Load the GMAC driver and obtain dynamic address:
    modprobe dwmac-s32cc
    udhcpc -i eth0 -n -q

    You can see the IP address in the Linux terminal and the VHub registration MAC addresses in Simulation Output.

  10. Start the SSH server with the following commands:
    /usr/bin/ssh-keygen -A
    mkdir -p /var/run/sshd
    /usr/sbin/sshd
  11. In , use the project wizard to create a new project for a Linux target.
  12. Build the project.
  13. Open the Debug Configurations dialog and go to the C/C++ Remote Application group of configurations. Click the debug configuration for debugging remote Linux generated for your project.
  14. On the Main tab, click the New button next to the Connection field to create a new remote connection. Then select the SSH connection type.
  15. In the New connection dialog box, specify the following settings:


    remote host vdk

    • Connection name: Specify the preferred connection name.
    • Host: Enter the VDK IP address that you have obtained in the Linux terminal.
    • User: Enter the Linux user name (root).
    • Authentication: If required, enable authentication and enter the passphrase or password.

    Then click Finish.

  16. Click Apply, then click Debug.