# Software Setup for Flashing NXPRT117X

#### Scene Composer Configuration

1. Open Scene Composer and create a new solution using the Empty Sample Solution template.
2. Select and import multiple images into Scene Composer from the following path:  
    (CGI-ROOT/cgi\_studio\_content/2D/Paid\_Stock\_Images)
3. Drag and drop the imported images into the Scene Editor.
4. In the Scene Editor, adjust the images by scaling and rotating them as needed.
5. Add the following elements to the Scene Editor: 
    1. One Solid Color Node
    2. One Text Node
    3. One Button
6. Open the Render Target tab (next to the toolbox) and select an available render target.
7. In the Properties panel, set the following values: 
    1. Orientation: 
        1. 90 ° for 720x1280/Portrait mode displays.
        2. 0° for 800 x 480/ Landscape mode displays.
    2. Width: 720
    3. Height: 1280
8. Click on Display (0) under the Render Target tab.
9. In the Display properties, set the X and Y resolution to match the Render Target resolution.
10. Navigate to File → Solution Options → General Configuration.
11. Finally, generate the Target Asset.

#### VS Code Configuration

1. Open Visual Studio Code (VS Code) from the CGI root directory.
2. Navigate to the toolchain file as per the hardware revision (rev\_a/rev\_b) and BSP version used, refer the following table to select the necessary toolchain file:  
    **Toolchain Table:**<table border="1"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><td class="align-center">**Hardware Revision**</td><td class="align-center">**Toolchain file**</td><td class="align-center">**Description** </td></tr><tr><td rowspan="2">Rev\_a </td><td>IAR-toolchain-RT117X\_Native2D.txt</td><td>Rev\_a without Touch</td></tr><tr><td>IAR-toolchain-RT117X\_Native2D\_Touch.txt</td><td>Rev\_a with touch enabled display</td></tr><tr><td rowspan="3">Rev\_b</td><td>IAR-toolchain-RT117X\_Native2D\_B.txt</td><td>Rev\_b without Touch support</td></tr><tr><td>IAR-toolchain-RT117X\_Native2D\_B\_Touch.txt</td><td>Rev\_b with Touch enabled display</td></tr><tr><td>IAR-toolchain-RT117X\_Native2D\_B\_Touch\_2.16.txt</td><td>Rev\_b with Touch enabled display
    
    and BSP version 2.16
    
    </td></tr></tbody></table>
    
    For Eg: If using a Rev\_b hardware version with BSP version 2.16, navigate to the following file.  
    (CGI-ROOT/cgi\_studio\_devices/src/RT117X/ToolchainFiles/IAR-toolchain-RT117X\_Native2D\_B\_Touch\_2.16.txt)
3. Open the file and make the following edits: 
    1. Disable touch (only if the display does not support touch)  
        set (CGIDEVICE\_TOUCH\_ENABLED OFF CACHE BOOL "Enable Touch support").
    2. Update the **BSP path** to match the local directory.
4. Next, open the following file and update the display configurations as required:  
    (CGI-ROOT/cgi\_studio\_devices/src/RT117X/CourierPlatformDefs/Target\_FreeRTOS\_RT117X  
    /KernelTargets/iar/bsp\_cm7\_B216\_cgi/vglite/cm7/display\_support.h)
5. In this file, go to line 28 and update the display panel configuration as shown below: 
    1. **Before:**  
        \#define DEMO\_PANEL DEMO\_PANEL\_RASPI\_7INCH //DEMO\_PANEL\_RK055MHD091
    2. **After:**  
        \#define DEMO\_PANEL DEMO\_PANEL\_RK055MHD091  
        This removes the commented-out section and sets the display to **RK055MHD091**.

#### Project Configuration using Cmake GUI

1. Open **CMake GUI**.
2. Set the **source code folder** to:  
     (CGI-ROOT\\cmake\\Apps\\Courier\\CourierSampleAppLight)
3. Set the **build folder** (the location where build files will be generated).
4. Click **Configure**.
5. When prompted, select **Ninja** as the generator.
6. Specify the **toolchain file** for cross-compiling refer the toolchain table, select the appropriate toolchain file as per the hardware version.
7. Click **Finish → Next**.
8. Click **Configure** again until all red entries disappear, then click **Generate**.
9. Close **CMake GUI**.
10. Open terminal in the **build folder** and give a **ninja** build.
11. Run the following command  
    **ninja**

#### Adding Assets

1. Create an **Assets** folder in:  
     CGI-ROOT\\cgi\_studio\_courier\_apps\\src\\CourierSampleAppLight
2. Add the generated asset file to this folder.
3. Rename it to:  
     AssetLibCff\_RT117X\_Target.bin

#### Flashing and Execution

1. Open the generated project from the following path:   
    BUILD-ROOT\\iar\_project\\debug\_cm7\_B\_cgi\\CGI\_RT117X.ew
2. **IAR Embedded Workbench IDE** will launch automatically.
3. Click **Download and Debug** to flash the binary to the hardware.
4. After flashing, click **GO** in IAR to start execution.
5. Observe the output on the display connected to the NXP RT117X board.