Skip to main content

How to make Surf 5 Projects


If you haven't downloaded the Surf 5 project yet, Click the link below to access GitHub and download it.

Surf 5 Github Link


How to make Surf 5 Project in VS Code

1. Create a New Workspace (Prevent Changes to Existing Settings)

Step 1

Create a new workspace. The reason for creating a new workspace is to prevent changes to the existing settings.

First, select "File -> Add Folder to Workspace".




Step 2

Select the "W7500x-Surf5" project folder as the target for the workspace, and then click the "Add" button. (The "W7500x-Surf5" should be the top-level directory.)




Step 3

If you've added the workspace with the W7500x-Surf5 folder path, then click on "File -> Save Workspace As..." again.




Step 4

Simply press "Save" with the same file name.






2. Save the CMake Extension Settings for the stored workspace.

Step 1

In CMake Tools, go to "the gear icon (settings) -> Extension Settings



Go to the Workspace tab in the red box. In the top search bar, type "@ext:ms-vscode.cmake-tools" to search.




Step 2

In the options, press "Add Item" in the Configure Args section and add the following two definitions:

-DCMAKE_MAKE_PROGRAM is the location of the make executable (inside the previously extracted xpack folder).

-DARM_TOOLCHAIN_DIR is the location of the GNU Arm compiler's executable files that you previously downloaded.

For example, the author used:

CMake: Configure Args
-DARM_TOOLCHAIN_DIR=C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin
-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/xpack-windows-build-tools-4.4.0-1/bin/make.exe

Adjust the Configure Args to match your own file paths according to your setup.




Step 3

Once you have completed the path configuration, enter "Unix Makefiles" in the "CMake: Generator" field. make sure to check the case sensitivity of "Unix Makefiles".

CMake: Generator
Unix Makefiles




3. Build Project in VS Code

Step 1

Press the F1 key, and then click on "CMake: Select a Kit".




Step 2

Select "GCC Arm Embedded" to configure the kit.




Step 3

Click the "Build" button at the bottom or press F7 to start the build process.




Step 4

Once the build is completed, you will see a message like the one above in the OUTPUT window.

You will also be able to confirm that the Build directory has been created. The project folder within the Build directory contains the generated bin files. You can save these bin files to your Surf 5 and use the project.






4. How to solve Surf 5 build error in VS Code

If the build is still not working despite configuring Visual Studio Code settings, follow the steps below.




Step 1

If other files have appeared in the .vscode directory, please structure the directory as shown in the image below. You should delete all files except "cmake-kits.json".





Step 2

Check the path that was previously set in CMake: Configure Args. If it hasn't been saved to the workspace, it is advisable to add it again and save. Configure "CMake: Configure Args" according to your own path as shown in the picture below. Also, check if the directory exists on your PC at that path.




Check the command for the "Cmake: Generator". If the command is not entered, please input the command as follows. also, Be sure to respect the case sensitivity of "Unix Makefiles".





Step 3

Next, delete the "Build" directory. Deleting this directory should not pose any issues for the build process.





Step 4

Press the F1 key, and then click on "CMake: Select a Kit".




Select "GCC Arm Embedded" to configure the kit.





Step 5

Rebuild now. If you have completed the four steps above perfectly, try building the project again within VS Code.







How to make Surf 5 Project in Keil 5

1. Download Keil 5 & Compiler for Keil 5

If you haven't installed the Keil 5 development environment and the compiler for Keil 5 (version 5.37 or later) yet, click the link below to install them first.

Install Keil 5 for Surf 5




2. Set-up Compiler in Keil 5

Step 1

Run Keil 5 and click on the "Project' -> 'Manage' -> 'Project Items..." tab at the top.



Step 2

Click the "..." button under the 'Folders/Extensions' tab.



Step 3

Click the "Add another ARM Compiler Version to List..." button.



Step 4

Set the path to the installed compiler for the latest version of Keil 5 (version 5.37 or later). If you haven't installed the compiler for the latest version of Keil 5, refer to [Install Keil 5 for Surf 5].



Step 5

Verify that the compiler has been added and click the "Close" button.



Step 6

Press the "OK" button to complete the compiler path setup.




3. Build Surf 5 Project in Keil 5

Step 1

within the 'Project' tab at the top, click on "Open Project..."



Step 2

Open the project by selecting "Project.uvproj" from the path "...\w7500x-surf5\Projects\W7500x_StdPeriph_Templates\MDK" where the project files exist in the Surf 5 library.



Step 3

Within the 'Project' tab at the top, click on "Options for Target 'W7500x'..."



Step 4

Go to the "Target" tab at the top, set the ARM Compiler under Code Generation to "V5.06 update 7 (build 960)", and click the "OK" button



Step 5

In the Keil 5 project, click on "main.c" in the "User" folder to open the file.



Step 6

Press the "F7" button to complete the build.