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:
Install Git for Windows Download and install Git for Windows from the official Git website.
Install SDCC Download and install the latest version of SDCC from the SDCC downloads page.
Install MinGW Download and install MinGW, a set of development tools for Windows, from the official MinGW website.
Install CH372 Driver Download the latest version of the CH372 driver from the official website.
Install Zadig Download and install the latest version of Zadig from the official website.
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.
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.
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.
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.
Open the Start Search, type in “env”, and select “Edit the system environment variables”.
In the System Properties window, click on the “Environment Variables” button.
In the Environment Variables window, under “System variables”, select the “Path” variable and click “Edit”.
In the Edit Environment Variable window, click “New” and add the path:
C:\MinGW\bin
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.
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.
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.