# Importing the NXP Cup sample app

To import the example project, go to File > New > S32DS Project from Example

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FdrddLz2qvqqHtdqO5j8R%2Fimage.png?alt=media&#x26;token=364bcba0-9027-4c77-a2fa-c80cc64eeae3" alt=""><figcaption><p>The button is in the top left corner </p></figcaption></figure>

Inside the window that popped up, go to **S32K1 AUTOSAR 4.4 - R21-11 RTD 2.0.0 > Dio Examples** and choose one of the examples provided for Nxp Cup.

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FI8euOliRtmpCBPL5GgRz%2Fimage.png?alt=media&#x26;token=ce34f2f7-2e8e-4c63-b11c-ac031891dcc8" alt="" width="375"><figcaption><p>Press on the arrow to the left of the folder to find the project</p></figcaption></figure>

To generate the configuration of the drivers, go to Peripherals tab, select Update Code and press ok. **All errors in the Peripherals tool should go away after this step**. This step must be repeated if/when you change the configuration in the Peripherals, Clocks, Pins tools.

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FBFihZHxRfVuucDSdilYQ%2Fimage.png?alt=media&#x26;token=8acded8e-a82c-4ee8-949a-d387b9cb00be" alt=""><figcaption><p>The Peripherals tool button is in the top right corner</p></figcaption></figure>

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FdUaYu5TWE3lbtF5mGWlV%2Fimage.png?alt=media&#x26;token=357d48bf-7256-41b6-8edb-e2d28c5ef1f5" alt=""><figcaption><p>The Update code button is the top middle</p></figcaption></figure>

## Running the code

To run the code, go back to code view (C/C++ button) and press Debug Configurations under the Debug button menu.

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FKhVIR3XoGb2jrcauafdl%2Fimage.png?alt=media&#x26;token=df066df3-5d3e-4981-b29d-2fa630b68adc" alt=""><figcaption><p>Top-right is the C/C++ button; Top Middle is the green Debug button</p></figcaption></figure>

Under GDB PEMicro Interface Debugging, select the one with your project’s name. If there isn’t one, create a new one. Press debug to upload the code.

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FcB6w9E4DI7LuY0ovkj5O%2Fimage.png?alt=media&#x26;token=8c1a0b81-0d4e-443c-ac4c-b4849681d794" alt=""><figcaption></figcaption></figure>
