Environment Setup on Windows#

This section provides a step-by-step guide to setting up the SDCC compiler on Windows operating systems. It also includes instructions for installing the necessary tools and configuring the environment variables. Additionally, it covers the installation of the pyusb library and updating the driver using Zadig.

Compiler Installation#

Follow these steps to install the necessary tools:

  1. Install Git for Windows Download and install Git for Windows from the official Git website.

  2. Install SDCC Download and install the latest version of SDCC from the SDCC downloads page.

  3. Install MinGW Download and install MinGW, a set of development tools for Windows, from the official MinGW website.

  4. Install CH372 Driver Download the latest version of the CH372 driver from the official website.

  5. Install Zadig Download and install the latest version of Zadig from the official website.

  6. Install Filter Wizard Download the latest version of libusb-win32 from the official website. This driver is used by the Loadupch tool to communicate with the device.

  7. Install Python Download and install the latest version of Python from the official Python website.

Tip

It is recommended to install the tools in the order listed above.

Caution

Remember to restart your computer after installing the tools.

Environment Variable Configuration#

Remember that for Windows operating systems, an extra step is necessary, which is to open the environment variable -> Edit environment variable:

C:\MinGW\bin

Locate the file#

After installing MinGW, you will need to locate the mingw32-make.exe file. This file is typically found in the C:MinGWbin directory. Once located, rename the file to make.exe.

Locating the mingw32-make.exe file.

Fig. 3 Locating the mingw32-make.exe file#

Rename it#

After locating mingw32-make.exe, rename it to make.exe. This change is necessary for compatibility with many build scripts that expect the command to be named make.

Renaming mingw32-make.exe to make.exe.

Fig. 4 Renaming mingw32-make.exe to make.exe#

Warning

If you encounter any issues, create a copy of the file and then rename the copy to make.exe.

Add the path to the environment variable#

Next, you need to add the path to the MinGW bin directory to your system’s environment variables. This allows the make command to be recognized from any command prompt.

  1. Open the Start Search, type in “env”, and select “Edit the system environment variables”.

  2. In the System Properties window, click on the “Environment Variables” button.

  3. In the Environment Variables window, under “System variables”, select the “Path” variable and click “Edit”.

  4. In the Edit Environment Variable window, click “New” and add the path:

    C:\MinGW\bin
    
Adding MinGW bin directory to environment variables.

Fig. 5 Adding MinGW bin directory to environment variables#

Verify the installation#

To verify that the make command is correctly set up, open a new command prompt and type:

make --version

You should see the version information for make, indicating that it is correctly installed and recognized by the system.

Verifying the installation of make.

Fig. 6 Verifying the installation of make#

Update driver#

The current loading tool can utilize the default driver and coexist with the official WCHISPTool. In case the driver encounters issues, it is advisable to switch the driver version to libusb-win32 using Zadig.

GitHub build status reporting for pull requests.

Fig. 7 driver#

Warning

The use of Zadig is at your own risk. if you are not familiar with the tool, it is recommended to seek assistance from someone who is. In the case of changing the driver any device , it is important to have the original driver available to revert the changes.